[thelist] Flash: Buttons, Movies, Instances, Confusion

Benjer futureweb at macmail.com
Tue Dec 17 09:44:01 CST 2002


On button:

On (release){
_root.textUpdate(this._name);
Trace(this._name);
Trace(_parent._name);
}

this may need to be _parent.name, use a trace on the button as above to
test.

Frame 1:

function textUpdate(chosen){
_root.myTextField=_root.textArray[chosen]
}

textArray=["","button1text", "button2text" etc.... ]

1st textArry is blank since arrays start at 0, and your instances start at
01.

So basically your button calls the function textUpdate(), passes its
instance name. The function retrieves the chosen text from the textArray.
Updates a textField called myTextField on the stage with the value.

Clear as Mud??

Email off list if so...

Benjer


On 17/12/02 4:25 pm, "Frank" <lists at frankmarion.com> wrote:

>
> I'm all confused. I've created two buttons (one red, one blue), and two
> movies. I then created 18 (9x2) separate instances of the movies, all
> placed on a layer. I've given each movie instance a name (01 through
> 18--creative, aren't I?). I now want to make it so that I can change the
> content of a dynamic text field based on the instance of that was clicked.
>
> A button does nothing but trigger, it generates an event. A movie is needed
> to append a function to said button, and the button must be enclosed in the
> movie. The function can make the various object do whatever. So, how do I
> make each instance discreet, or how do I run a separate function that will
> determine which instance of one of two movies that contains one of two
> buttons was clicked? Aarrghh.
>
> How do I go about creating a list of 18 captions to be displayed in a text
> field, each triggered by a separate instance of the same button/movie? Is
> there a way of placing a case statement somewhere (say frame 1, layer 1,
> root level) and getting it to react based on the instance name? This seems
> to be the most logical choice to me, but then again, I don't really grok
> Flash all that well.
>
> I'm really pulling my hair out on this one.
>
> Thanks.
>
>





More information about the thelist mailing list