Ask a Question related to Macromedia Flash, Design and Development.
-
roddyguy #1
getUrl does not send current dynamic variable
I needed to create a flash scrollbar with dynamically generated
thumbnails that would link to a page and send the ImageID as a URL
parameter. Could not find much reference material for this, was but
successfully able to produce such a scenario... almost. My problem is,
that even though my ProblemVariable (taken from a Dataset) displays
correct ImageIDs and Thumbnails (loader objects) display correct
Thumbnails (within a while statement)...The ProblemVariable when placed
in the repeating getUrl function always links to the last
ProblemVariable set and not the current.
The only reason I had added the Label object was so that I could test
that the problem really was within the getUrl function. Sure enough,
the Label's HTML link with the ProblemVariable works perfectly because
it is picking up the current dataset record.
I'm sure the reason that the repeating getUrl functions keep grabbing
the last ProblemVariable set is because the function actually happens
outside of the loop and because the variable is not static, it will
always grab the last value set.... but does anyone know and answer to
my problem. I have been wresting with this for days now. I have tried
using 'eval', 'String.concat', 'loadVars.send', among other things.
I'm sure there is a simple answer, but it is out of my expertise.
Below is my code for the movieclip that resides in the scrollpane:
var thisim:Number = _root.iid;
var numstr:Number = 0;
var ImageDepth:Number = 0;
var LabelDepth:Number = 10;
var yVal:Number = 10;
var strImageName = "loader"+(numstr);
var strLabelName = "label"+(numstr);
var ProblemVariable = "";
while (images_dataset.hasNext()) {
if (images_dataset.currentItem.ImageID != thisim) {
newxImage = createClassObject(mx.controls.Loader, strImageName,
ImageDepth);
newxImage._y = yVal;
newxImage._x = 10;
newxImage.contentPath = (images_dataset.currentItem.Thumbnail);
newxLabel = createClassObject(mx.controls.Label, strLabelName,
LabelDepth);
newxLabel._x = 1;
newxLabel._y = yVal;
newxLabel.html = true;
ProblemVariable = images_dataset.currentItem.ImageID;
newxLabel.text = "<a
href=\"project_category.php?iid="+ProblemVariable+ "\">"+ProblemVariable+"</a>";
newxImage.onPress = function() {
getUrl("project_category.php?iid="+ProblemVariable +");
};
yVal = yVal+110;
ImageDepth = ImageDepth+1;
LabelDepth = LabelDepth+1;
numstr = numstr+1;
strImageName = "loader"+(numstr);
strImageName = "label"+(numstr);
}
images_dataset.next();
}
stop();
roddyguy Guest
-
Passing Variable in getURL
Having a little trouble,its probably something simple but I've not that familiar with Java. <cfinput type="button" name="EditPass" value="Edit... -
Linking with dynamic variables problem..getUrl
I needed to create a flash scrollbar with dynamically generated thumbnails that would link to a page and send the ImageID as a URL parameter. Could... -
problem: geturl with variable?
Hi I am trying to build a user-friendly Flas detection. This is supposed to use the old trick of displaying a swf on the page with one frame. The... -
Using getURL to send a Variable to a PHP File
Using the getURL method i am attempting to attach a php variable to the URL and open it in a browser... the url is simular to this ... -
putting a variable into getURL in flash
Hi, I am sure this is a quick fix. But could use some help. I am pulling a bunch of variables from a php page. from those vairables i want to... -
roddyguy #2
Re: getUrl does not send current dynamic variable
roddyguy wrote:is,> I needed to create a flash scrollbar with dynamically generated
> thumbnails that would link to a page and send the ImageID as a URL
> parameter. Could not find much reference material for this, was but
> successfully able to produce such a scenario... almost. My problemplaced> that even though my ProblemVariable (taken from a Dataset) displays
> correct ImageIDs and Thumbnails (loader objects) display correct
> Thumbnails (within a while statement)...The ProblemVariable whenbecause> in the repeating getUrl function always links to the last
> ProblemVariable set and not the current.
>
> The only reason I had added the Label object was so that I could test
> that the problem really was within the getUrl function. Sure enough,
> the Label's HTML link with the ProblemVariable works perfectlyhref=\"project_category.php?iid="+ProblemVariable+ "\">"+ProblemVariable+"</a>";> it is picking up the current dataset record.
>
> I'm sure the reason that the repeating getUrl functions keep grabbing
> the last ProblemVariable set is because the function actually happens
> outside of the loop and because the variable is not static, it will
> always grab the last value set.... but does anyone know and answer to
> my problem. I have been wresting with this for days now. I have tried
> using 'eval', 'String.concat', 'loadVars.send', among other things.
>
> I'm sure there is a simple answer, but it is out of my expertise.
>
> Below is my code for the movieclip that resides in the scrollpane:
>
> var thisim:Number = _root.iid;
> var numstr:Number = 0;
> var ImageDepth:Number = 0;
> var LabelDepth:Number = 10;
> var yVal:Number = 10;
> var strImageName = "loader"+(numstr);
> var strLabelName = "label"+(numstr);
> var ProblemVariable = "";
>
> while (images_dataset.hasNext()) {
> if (images_dataset.currentItem.ImageID != thisim) {
> newxImage = createClassObject(mx.controls.Loader, strImageName,
> ImageDepth);
> newxImage._y = yVal;
> newxImage._x = 10;
> newxImage.contentPath = (images_dataset.currentItem.Thumbnail);
>
> newxLabel = createClassObject(mx.controls.Label, strLabelName,
> LabelDepth);
> newxLabel._x = 1;
> newxLabel._y = yVal;
> newxLabel.html = true;
>
> ProblemVariable = images_dataset.currentItem.ImageID;
>
> newxLabel.text = "<a
>>
> newxImage.onPress = function() {
> getUrl("project_category.php?iid="+ProblemVariable +");
> };
>
> yVal = yVal+110;
> ImageDepth = ImageDepth+1;
> LabelDepth = LabelDepth+1;
> numstr = numstr+1;
> strImageName = "loader"+(numstr);
> strImageName = "label"+(numstr);
> }
> images_dataset.next();
> }
> stop();roddyguy Guest
-
roddyguy #3
Re: getUrl does not send current dynamic variable
someone on another board gave me the solution. I hope this helps
others:
newxImage.ProblemVariable = images_dataset.currentItem.ImageID;
....
newxImage.onPress = function() {
getUrl("project_category.php?iid="+this.ProblemVar iable+"");
};
This solves the problem ... a local variable in the newximage object,
wich will have no connection with the changes in while {
roddyguy Guest



Reply With Quote

