all groups > flash actionscript > june 2006 >
You're in the

flash actionscript

group:

s it possible to use an empty movie clip as a button?


s it possible to use an empty movie clip as a button? erye
6/22/2006 11:12:27 PM
flash actionscript: Is it possible to use an empty movie clip as a button? Right now I load in an
image from the xml file. I'd like to use this as a thumbnail that when clicked
loads a swf movie on the stage.
The loaded movie needs to be able to take the image path I send add an
extension (lrg.jpg). So the loaded movie knows to display the larger version of
the image.

Does anyone have an example or can someone suggest a better way to achieve
this?

Thanks,
Re: s it possible to use an empty movie clip as a button? caskater
6/22/2006 11:53:54 PM
Any movieclip can be used as a button, but will only work if you have something
actually visible to click on (an empty movie clip is just empty space).

So what you want to do is load the image thumbnail into a movieclip, and then
you'd put the following code onto the movieclip

myClip.onRelease = function() {
// open larger image here
}
Re: s it possible to use an empty movie clip as a button? _Chewtoy_
6/22/2006 11:57:52 PM
In your loop reading the xml values into the movieClips, assign the
emptymovieclip an id ( I assume you know how :-) then attach a value to the
movie clip, something like
movieID.url = "biggerImageLink";

then turn your (now filled) emptyMovieClip into a btn by using
id.OnRelease = function () {
//an example with getURL
getURL(this.url);
}
then it's time to loop again for the next value from the XML.

Hope this makes sense. I'm a bit tired and going to bed but I thought I'd try
to help. Apologies for typos and bad memory of 'script.

AddThis Social Bookmark Button