[thelist] Actionscript: loading content from a CF list

Frank Sartory frank.sartory at mcom.de
Tue Aug 21 01:35:28 CDT 2001


Nick Boyce schrieb:

> Hey,
>
> An advance warning, this a bit of a long one...
>
> I am working on redoing my play site (http://anarchitect.net) in Flash 5
> using the same CF back end. As you can see from the link, it loads each link
> item into a layer which is draggable around the screen. I have made some
> progress in recreating this in Flash, but have run into a few problems.
>
> The first frame loads the CF file (http://anarchitect.net/new/getlinks.cfm)
> which executes a query and outputs the data in the following format:
>
> &1_linkdesc=this is the info&1_linkurl=the url&1_memberusername=the
> author...
>
> It repeats over the latest 20. So it will continue with "2_linkdesc" etc
> etc. With me so far?
>
> loadVariablesNum ("http://anarchitect.net/new/getlinks.cfm", 0);
>
> On the second frame I generate duplicated movie clips for the 20
>
> // begin looping over the 20 variables
> for (i=1; i<20; i++) {
>
>         // duplicate the clips
>         duplicateMovieClip (clip, "clip" add i, i);
>
>         // make them scatter across the screen
>         setProperty ("clip" add i, _y, random(300));
>         setProperty ("clip" add i, _x, random(500));
>
>         // this is where I try and fail to set the text fields to the value
> outputted from CF
>         // I want the variable "text" have the value of [repeatnumber]_linkdesc
> from the CF file

Hi Nick,
What if you tried:
'text=_this[repeatnumber add "_linkdesc];'  ?
As far as my experience reaches this is the only way to build variable-values with
repeatnumbers in actionscript. I use this way often and it works pretty well.
please let me know if you were successful.
Frank

>
>         // the text field in the movie clip is called "linkdesc"
>         text = i add "_linkdesc";
>         set ("clip" add i add ".linkdesc", text);
>
> }
> stop ();
>
> What happens is that it puts "19_linkdesc" into the field instead of the
> actual value from it. Here is what I mean:
> http://anarchitect.net/new/anarchitect_3.swf
>
> So my question is: how do I get the value into the variable and into the
> text field? Am I going about this the right way? I could do it using an
> actual list/array. Or if I could change the name of the text field on each
> layer that would open up other options.
>
> Thanks in advance.
>
> Nick
>
> ----------------------------------------------------------------
> triple zero digital  |  upstairs at 200 the parade, norwood 5067
> (08) 8332 0545 | www.triplezero.com.au | nick at triplezero.com.au
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list