|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Movie clip to low opacity when external movie is loaded
Hi all,
I have a movie clip with a button that loads an external flash movie when clicked. Once the external movie is loaded I would like the movie clip (that will remain as a background) to low its opacity. How can I do that ??? I'm using AS2 and the way that I'm loading the external movie is: Code:
on (release) {
loadMovieNum("new.swf", 1);
}
Thanks a lot in advance! |
|
#2
|
|||
|
|||
|
Hi, use the MovieClipLoader class instead of loadMoviesNum. That class has an event handler called onLoadInit which gets called once the external movie has finished loading. Inside there you can then set the _alpha property of the other MovieClip to a lower value.
|
|
#3
|
|||
|
|||
|
Thanks once again Tann!
I'm doing the following: Code:
on (release) {
var loader = new MovieClipLoader();
loader.onLoadInit = function(){
pathtotheclip._alpha = 50;
};
loader.loadClip("new.swf",_root.createEmptyMovieClip(1,1));
}
But when publishing I get a "Type mismatch" error in Code:
loader.loadClip("new.swf",_root.createEmptyMovieClip(1,1));
what's wrong?? Thanks! |
|
#4
|
|||
|
|||
|
Hi, createEmptyMovieClip requires a unique String identifier for the new MovieClips name:
_root.createEmptyMovieClip("holder", 1) |
|
#5
|
|||
|
|||
|
Ok, now it's loading the new movie (new.swf) but the movie clip does not change the opacity .. what am I doing wrong?
![]() |
|
#6
|
|||
|
|||
|
hehe oops, I hadn't noticed how you'd setup the MCL class. You have to add an event listener for onLoadInit, not call it directly.
Code:
// Goes on keyframe that button sits on, not on button directly
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
function onLoadInit(targ:Object):Void
{
pathtotheclip._alpha = 50;
}
// Goes on the button as you currently have it
on(release)
{
this._parent.loader.loadClip("new.swf", _root.createEmptyMovieClip("holder", 1));
}
|
|
#7
|
|||
|
|||
|
Tann, I'm such a newbie, I cannot make it work.
Nevertheless this works: Code:
on (release) {
loadMovie("new.swf", 1);
_root.speEntrada._alpha=20;
}
Now I'm seeing new.swf over a 20% opacity movie clip, what do I have to add to new.swf to close it and return the 100% opacity to the movie clip. Thanks a zillion! |
|
#8
|
|||
|
|||
|
Code:
on(release)
{
unloadMovieNum(1);
_root.speEntrada._alpha = 100;
}
|
|
#9
|
|||
|
|||
Doing: Code:
on(release)
{
unloadMovieNum(1);
_root.speEntrada._alpha = 100;
}
Unloads new.swf perfectly but the alpha does not go to 100 ![]() |
|
#10
|
|||
|
|||
|
hmm try the lines the other way around.
|
|
#11
|
|||
|
|||
|
This worked:
on(release){ unloadMovieNum(1); _level0.speEntrada._alpha=100; } Thanks so much, if not for you I would be lost! you're my hero ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Movie clip to low opacity when external movie is loaded |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|