all groups > flash (macromedia) > june 2004 >
You're in the

flash (macromedia)

group:

path as variable


path as variable pwiop
6/29/2004 10:33:33 PM
flash (macromedia): Objective
What I am trying to achieve is this. 20 buttons (dynamically generated). Each
button displaying an external jpg which it loads into a picture viewer (this I
have achieved). On clicking each button information about each of the pictures
is loaded into a textfield from an external txt file (this I cannot achieve)

What I am Doing
I am loading 20 variables ?picinfo1? to ?picinfo20? from an external txt file
?myData.txt?

Each of the variables contains text such as ?my picture one? etc

I am dynamically generating buttons (within an mc) based on the number of
variables in the txt file ie. 20

I have a textfield component called ?textViewer?

If within the original button if I add the code _root.textViewer.text =
picinfo1, the textViewer is populated by information stored in that variable is
(obviously all the buttons display the information stored in that particular
variable)

Using the looping function that I have to dynamically create the buttons I
have a variable ?infoCount?

When I add the following code
_root.textViewer.text = ?_root.picinfo?+ infoCount - the text field just
displays _root.picinfo1 , _root.picinfo2, _root.picinfo3 etc but NOT the
information stored in those variables

It seems that it is being interpreted as a string NOT as a path. Is there any
way that I can make Flash recognise ?_root.picinfo?+ infoCount ? as a path NOT
a string

Sorry if this is a little confusing - I can upload a copy if anyone could be
bothered having a gander

paul

Re: path as variable robin NO[at]SPAM 19.5degs.com
6/30/2004 2:48:37 AM
[quoted text, click to view]

use this code

_root.textViewer.text = _root["picinfo" add infoCount ];

robin
Re: path as variable J formerly private news
6/30/2004 9:41:46 AM
as I got told off for it i wouldnt upload anything lol

post it to a server and provide a link, include the dependent files also

[quoted text, click to view]

AddThis Social Bookmark Button