Forum Moderators: open

Message Too Old, No Replies

importing text into flash

         

icpooreman

6:24 pm on Mar 14, 2006 (gmt 0)

10+ Year Member



I'm attempting to make a glossary for a flash movie and am looking for the easiest way to do it. I want to be able to store all the word/definition/pictures in some type of database and have flash import and create a scene for them so that if I add words to my glossary I can have flash automatically generate new pages for the words.

Two things I have to ask

1) can flash import text and such the way I'm planning to use it.

2) can I use flash to dynamically create a movie the way I'm looking to do it.

Harry

12:02 pm on Mar 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can with XML

Richard_N

4:22 pm on Mar 19, 2006 (gmt 0)



Yes flash can talk to a database via an intermediate scripting language such as PHP, ASP, or ColdFusion. For PHP we have used both Ghostwire and Flash remoting, they both work fine.

It can be done via XML but that relies on the site owner being able to edit XML files and upload directly via FTP,

icpooreman

8:04 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Ok XML is the way to go for me I just implemented that and I got the info into flash the way I wanted to. Thank you.

Now for the second part of my question. I want to dynamically create buttons with actionscript. I would ideally like to make each word that I load in a link to its definition/pictures associated with the word. I was wondering if anyone knows how or of any tutorials about dynamically creating buttons/writing images/text to the flash movie.

Richard_N

10:44 pm on Mar 21, 2006 (gmt 0)



If you now have the info in a multi dimensional array you can use a loop to cycle through it, just create a clip with an invisible button and a dynamic text box. Asign the button to the link, the text box to the description etc and use the duplicateMovie() function in conjunction with the loop outlined above.

We are not allowed to post links but google multi dimensional arrays in actionscript, should bring up what you want.

icpooreman

11:42 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



ok, I'm good with multidimensional arrays no problem there.

I also just found a tutorial about making a movie clip a button with a dynamic text box.

I'm having one last problem that's probably simple to fix.

for(i=0;i<numWords;i++){
instanceName = "instance" + i;
duplicateMovieClip(movieName,instanceName,depth);
instanceName._y = i*20;
etc. etc...
}

my problem is that the instanceName can't be the same every time because I need to do different things with each one. I can't say instanceName._y because it doesn't recognize instanceName as a variable it recognizes it as an instance. I can't seem to figure out how to get flash to recognize that as a variable of an instanceName.

icpooreman

10:49 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



HAHA I finally got it, Flash has an eval() function which does exactly what I needed in order to use my variable as an instance name simply put
eval(instanceName)._y = 100;
and voila

-thanks for the help.