Professional Web Applications Themes

using dynamically created Xml data for movieClipsresident on the Scene? - Macromedia Flash Data Integration

I am creating a virtual map of the united states. As some of you might know, it is easier to assemble all of the states right on the timeline than it is to dynamically do it in code (it would be a mess). The issue that I am encountering is that instead of coding a "onRollover" event for each state I can do it dynamically in code. My plan is to use an XML object with all of the states names and attributes and pass those values to the movieClips as well as assign the events for those movieClips. The ...

  1. #1

    Default using dynamically created Xml data for movieClipsresident on the Scene?

    I am creating a virtual map of the united states. As some of you might know,
    it is easier to assemble all of the states right on the timeline than it is to
    dynamically do it in code (it would be a mess). The issue that I am
    encountering is that instead of coding a "onRollover" event for each state I
    can do it dynamically in code. My plan is to use an XML object with all of
    the states names and attributes and pass those values to the movieClips as well
    as assign the events for those movieClips. The problem that I am encountering
    is that when I go through and extract the values from the XML object's nodes,
    that information is only availible as long as the function that is calling the
    values is still running. When the function is finished doing it's job, the
    movieClip's event doesn't know how to process the "dynamic" argument. (e.g.
    this.statename= parentnode.childNodes(i).attributes.value;) It appears that it
    needs a string value that is not dynamically dependant. My question is: Is
    there a better method than the one that I am using? I there a way to store the
    dynamic values in memory for later retreval of the clip events? I don't want
    to make 51 different global variables to store the values.

    pls hlp

    thx

    ))||((
    (-J-)




    this.umldata = function()
    {
    parentnode = this.xmldata.firstChild;
    totalnodes = parentnode.childNodes.length;

    for(i=0;i<totalnodes;i++)
    {
    var statenode:MovieClip = parentnode.childNodes[i].attributes.id
    this.statename = parentnode.childNodes[i].attributes.value;
    trace(this.statename);
    this[statenode].onRollOver = function()
    {
    this._parent.stateName.text = this.statename;
    this._parent.zoom(this[statenode]);
    }
    }
    }

    janussanders Guest

  2. #2

    Default Re: using dynamically created Xml data for movieClipsresident on the Scene?

    Thanks for the fast reply guys...Not! Anyway, for those who want to know what
    the answer is...I simply created a variable outside of the function that will
    hold the Xml information for later retreval. In my case I needed to use arrays.

    var DataArray:Array = new Array()

    Inside the function, I populated the array with pd xml data.

    mymovieclip.onRelease = function
    {
    this._parent.DataArray = xmldata.childNodes.childNodes[0].attributes.id;
    }

    that's all.

    ;)

    janussanders Guest

Similar Threads

  1. Capturing Data of Dynamically Created TextBox's
    By Jack Johnston in forum ASP.NET General
    Replies: 6
    Last Post: August 4th, 10:37 AM
  2. Replies: 0
    Last Post: December 8th, 09:32 AM
  3. applying xsl to dynamically created xml
    By CanaryMason in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: December 5th, 07:39 AM
  4. Dynamically created user controls
    By Denise in forum ASP.NET Building Controls
    Replies: 4
    Last Post: March 16th, 06:55 PM
  5. need help with dynamically created user control
    By Karl Seguin in forum ASP.NET General
    Replies: 1
    Last Post: August 10th, 08:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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