Linking with dynamic variables problem..getUrl

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

  1. #1

    Default 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 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();

    :confused;

    roddyguy Guest

  2. Similar Questions and Discussions

    1. Limiting variables passed in getURL
      Is there a way to limit the variables that get passed into the URL when using getURL? Basically I have this: getURL(_root.clickTAG, "_top",...
    2. PASSING VARIABLES WITH getURL
      Hopefully, this is a simple answers. Need to pass variables to a .cfm page in another frame using getURL. getURL("frame2.cfm","bottom","POST") ...
    3. CF linking with variables
      I want to give some background information first: I am making an online book selling/trading for a small group of people. They can request a book...
    4. 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...
    5. Controlling Sent Variables in getURL
      is there a way to control sent variables using getURL. Ive tried putting them into the second set, but it doesn't seem to work......
  3. #2

    Default Re: Linking with dynamic variables problem..getUrl

    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 {

    By the way, I'll have to agree with the post above mine.
    This board kind of sucks. Where are the people that made the product.

    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