I've been trying to think of the best way to ask this question, but I don't know how to word it exactly...
Anyways, I'm a little confused about creating, initializing and returning the values of variables on a timeline of a movieclip instance created in actionscript. Was that a run-sentence? Oh well.
So, on the main timeline I want to create X amount of movieclips using attachMovie(). The instance(s) of the created movieclips needs to have a variable to hold a url to an image. How/where do I create/declare the variable? Do I add that variable to the Movieclip timeline or can is this something I can do from the main timeline? Furthermore, how/where do/can I set the variable?
These questions aren't so much for the: "How do I do this?", but more for the "Why do I do it this way?".
I thought that I could do the following to display a trace of msgText on a rollOver.
In the movieclip's timeline:
On the main timeline:
The trace doesn't display "Some Message", but it will if I remove: var msgText = ""; from the movieclip timeline. This is confusing.
Anyways, I'm a little confused about creating, initializing and returning the values of variables on a timeline of a movieclip instance created in actionscript. Was that a run-sentence? Oh well.
So, on the main timeline I want to create X amount of movieclips using attachMovie(). The instance(s) of the created movieclips needs to have a variable to hold a url to an image. How/where do I create/declare the variable? Do I add that variable to the Movieclip timeline or can is this something I can do from the main timeline? Furthermore, how/where do/can I set the variable?
These questions aren't so much for the: "How do I do this?", but more for the "Why do I do it this way?".
I thought that I could do the following to display a trace of msgText on a rollOver.
In the movieclip's timeline:
Code:
var msgText = "";
this.onRollOver = function() {
trace(this.msgText);
};
Code:
var a = this.attachMovie(.....);
a.msgText = "Some Message";