PDA

View Full Version : a graphic...in a button...in a movie...still reading? help!



smccallig
May 22nd, 2002, 07:25 AM
i'm writing a flash movie that creates a few boxes displaying an image that you can fling around the screen with a sort of gravity effect eventually slowing them down.

I've managed to do what i thought would be the hard part...
i've made a movie clip in which theres a button (to detect the clicks and drags) which contains a graphic (a .png file). After adding some nice bits of code, I can now stick loads of instances of the movie clip on the main stage and then start flinging them round. Marvellous. Now what I want to do next is change the image displayed on the button in each instance of the movie.

logically, something like :
myinstanceofmovie.nameofbutton.mygraphic="name_of_other_image.png"

...or something...

Anyone got any idea how to do this? halp!

hope that was all very clear...!!!

upuaut8
May 22nd, 2002, 11:24 PM
In flash 5.0 you cannot target buttons, only movie clips and a couple other object types.

the way you do it is this.

create a new movie clip inside the movie clip with your button.
give it an instance name like myMovieClip, then in button.

on(release){
_parent.myMovieClip;
}

_parent relates to the timeline that this clip sits in.