Newbie Needs Help With attachMovie logic

For the life of me, I can’t make Flash do a gosh darn thing ‘flashy’, no matter how many tutorials I read, and how many demo’s I see, it never seems to do what would make sense.

This worked fine until I tried to plop the dynamic text box into its own movie object in the library…

I’ve opened flash, drawn a simple dynamic text box. Set the dynamic text box’s data variable to szTextBoxData (why don’t text boxes just have a value property? anyways…). Then selecting it, I convert it to a symbol (as a movie) call it DynamicTextMovie, and stuff it away into the library.

Now I delete it from the layer, as I want to add it dynamically at run time.

Next, on frame one of the main movie, I insert this code.
(sorry for the bad formatting, limit of the forum here…)

[AS]
//BEGIN

function doTextLoop()
{
_root.TextLoopValue ++;
_root.attachMovie(“DynamicTextMovie”,
“DTM” + _root.TextLoopValue, 2)
_root[“DTM” + _root.TextLoopValue].szTextBoxData=
"Hello World " + _root.TextLoopValue ;
}

setInterval(doTextLoop, 1000);

//END
[/AS]

I realize I’m not removing the movie after… I just am worried about the thing showing up first!! :slight_smile:

This displays a nice, white screen quite well. However, this should be perfectly valid code (even though it obviously isn’t) so that’s where I am at now.

As a side question, how can a variable be defined with a local scope (to a function)? All these global _root variables make me queasy!!

Thanks guys! for any help you can give.

Hi,

when you rightclick on your mc in the library, choose 'Linkage’
Then make sure that ‘Export for Actionscript’ is active.
I think that should do the trick.

As for the scope-question. I’m not sure about that, sorry.

Cheers.

sonofagun

see, tutorials never tell you to do that kind of thing.
I wish you could just open up the activescript window and use that exclusivly… its jumping between so many different settings on so many different windows that makes flash difficult.

THANK YOU very much for the tip, worked great :slight_smile:

No problem and welcome to the forum btw :slight_smile:

*Originally posted by Dust *
**sonofagun

see, tutorials never tell you to do that kind of thing.
I wish you could just open up the activescript window and use that exclusivly… its jumping between so many different settings on so many different windows that makes flash difficult.

THANK YOU very much for the tip, worked great :slight_smile: **

heh it happens to all of us at one point.