Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: how do you dynamically rename variables? |
From: | Christian Cook |
Date: | Thu, 27 Jan 2000 15:41:45 GMT |
I am building a bulletin board in Flash 4 for a company intranet. All the
messages, headers, etc are stored in text files (with the view to hooking up
to a database). "m" is the number of messages (Loaded from txt files in
first frame), "z" is the z-index counter which starts at 1, "c" is a counter
which starts at 1 also. (I didn't combine c and z as other elements
elsewhere in the move add to z as other things are duplicated.)
The following is the script I am using to duplicate enough message boxes
according to how many messages there are and then space them out.
Loop While (/globals/:m > 0)
Set Variable: "/globals/:m" = /globals/:m - 1
Set Variable: "/globals/:c" = /globals/:c + 1
Set Variable: "/globals/:z" = /globals/:z + 1
Set Variable: "n" = "message" & /globals/:c
Duplicate Movie Clip ("/message", n, /globals/:z)
Begin Tell Target (n)
Load Variables ("bulletindata3.txt", /globals/:z)
Set Variable: ":header" = "header" & /globals/:c
End Tell Target
Set Property (n, Y Position) = GetProperty (n, _y) +
(/globals/:c)*(GetProperty (n, _height) + 15)
End Loop
The only bit that doesn't work is the tell traget bit. As you can see, I'm
no programmer. What i am actually trying to do is dynamiclly rename the
variable text filed "header" within movie clip "message" so that it is
called "header1" in the first duplication, "header2" in the second etc.. So
that the various message headers stored in bulletindata3.txt will load into
the correct boxes as they are dynamically created.
Any help greatly appreciated, sniggering is permitted.
Regards,
Christian Cook
Designer, ISL
Tel: +44 (0)1372 227400
Fax: +44 (0)1372 225120
<cccisluk [dot] com (mailto:cccisluk [dot] com)>
<http://www.isluk.com>
selection of ISL developed websites:
http://www.shanice.co.uk
http://www.barchester.demon.co.uk
http://www.jesuitmissions.org.uk
http://www.seabrooks.co.uk
----------------------------------------------------------
Internet communications are not secure. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
Company unless otherwise stated. This message is confidential and/or
privileged. If you have received it in error, please contact the sender and
delete the material from any computer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]