getUrl does not send current dynamic variable

Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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 ...
    5. 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...
  3. #2

    Default Re: getUrl does not send current dynamic variable


    roddyguy wrote:
    > 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139