Groups | Blog | Home
all groups > flash actionscript > december 2004 >

flash actionscript : Movies on Layers



Lilibeta
12/3/2004 10:53:02 PM
:confused;

Hello, I am attempting to create a website in Flash. I have several buttons
with links on one layer and I need one of them to: onRelease, run a movie on
another layer. So far I have been able to get the movie to run onRelease but
not on a specific layer. Can this be done and if so, how?

Thanks,
Lilibeta

Lilibeta
12/4/2004 12:46:06 AM
:o
Let's see if I can explain this a little better. The website is your basic
rectangle shape but it is subdivided into some rather interesting shapes like
trapezoids and triangles. I need to run a movie in a specific shape, let's say
a triangle, without the movie showing outside the triangle. Does that make
sense?

Lilibeta
Lilibeta
12/4/2004 3:05:46 AM
It's an .swf file. About 10 mins after I posted it occurred to me to use a
mask. I don't use them very often so I don't think to use them. :-)

The mask seems to indeed be the solution, but I am having trouble writing the
action script to trigger the movie to play onRelease of the desired button. I
want the movie to be invisible until the button is clicked.

Any suggestions?
Lilibeta
NSurveyor
12/4/2004 3:11:13 AM
Well, let's say you used this script to load your movie:

createEmptyMovieClip("myHolder",1);
myHolder.loadMovie("something.swf");
//Then you would add:
myHolder.onLoad = function(){
myHolder.stop();
myHolder._visible = false;
}
//=====================
//And then for your button:
myButton.onRelease = function(){
//where myButton is the instance name of your button
myHolder._visible = true;
myHolder.play();
}
Lilibeta
12/4/2004 4:03:33 AM
I get one error with that code:

Scene=Scene 1, Layer=Lab button, Frame=1: Line 1: Statement must appear within on handler
NSurveyor
12/4/2004 4:07:45 AM
NSurveyor
12/4/2004 4:08:08 AM
Lilibeta
12/4/2004 4:22:58 AM
I guess I'm just confused. Here's the code I added to the first frame my
button appears on (I changed the names as necessary):

createEmptyMovieClip("myHolder",1);
myHolder.loadMovie("labMovie.swf");
//Then you would add:
myHolder.onLoad = function(){
myHolder.stop();
myHolder._visible = false;
}
//=====================
//And then for your button:
labButton.onRelease = function(){
//where labButton is the instance name of your button
myHolder._visible = true;
myHolder.play();
}

When I test the movie, my labMovie clips plays upon loading, rather than when
the labButton is released.


Lilibeta
12/4/2004 5:17:10 AM
Nevermind, I got it!

I took the code off the frame where the button was, applied it to the button
itself, added an onRelease and voila! It works just as I hope.

Thanks a bunch for the help. I doubt I could have figure this out alone.

Lilibeta
Jeckyl
12/4/2004 9:54:50 AM
You cannot run a movie in a layer

You can run one in a level, or in a clip .. but not in a layer.

Maybe its your terminology that is confusing things .. can you explain more
clearly what result you want?
--
All the best,
Jeckyl

Jeckyl
12/4/2004 12:12:27 PM
Sounds like you need the shape to be in a mask layer over the layer that
contains either the video (if it is video) or the clip playing the movie (if
it is a loaded swf movie).
--
All the best,
Jeckyl

AddThis Social Bookmark Button