View Full Version : bit of a problem controlling the MC...
Romulus
04-01-2002, 02:11 AM
I'm having a little problem with controlling individual MC's. I have somebuttons on "Scene1", on the stage and I want them to play MC's that I've made in the movie. So in other words, if I've made some movie clips with a single pic in each, just fading in (alpha fade) and I want them to play on the users rollOver...but without having to place them all on the stage...is this possible??
Right now I can get it to work if I have them on the stage with the instance name 'pic1' and then put the script on the button:
on (rollOver){
_root.pic1.gotoAndPlay(1);
}
on (rollOut){
_root.pic1.stop();
}
However, I want to be able to just make about 20 picture clips and then be able to call them without having to have them all placed on the stage.
Can this be done?
farafiro
04-01-2002, 05:15 AM
well, if u don't want to put them on the stage I think u have two ways to do so:
-- First is to linkage all your mc from the lib and to attach them to the buton when u rollOver
on (rollOver) {
_root.at.attachMovie("b", "ba", 10); // 'at" is the holder that u attach your MC in
}
but here u just can't controll its alpha
-- and/or u just phblish all your MC in swf and when u rollOver the button load them in diff levels or even the same as long as u won't load more that one at the same time
and here u can control the as
on (rollOver) {
loadMovieNum("b.swf", "ba");// ba is the target that u load youe movies in
_root.ba.alpha +=10 // this will increase its alpha
}
red penguin
04-01-2002, 12:47 PM
Better off sticking to the attach movie method. The second there that farafiro mentioned will only increase the alpha once.
on (rollOver) {
_root.attachMovie("mc1", "mc1", 5);
_root.mc1._x = 400;
_root.mc1._y = 25;
_root.mc1.gotoAndPlay("fadeIn");
}
Now, if you've got a lot of clips to attach, I think the next step would be to make a function out of that so you won't have to write the same code for each button. Arguments would be the clip to attach and its coords...
farafiro
04-01-2002, 01:33 PM
Originally posted by red penguin
Better off sticking to the attach movie method. The second there that farafiro mentioned will only increase the alpha once.
on (rollOver) {
_root.attachMovie("mc1", "mc1", 5);
_root.mc1._x = 400;
_root.mc1._y = 25;
_root.mc1.gotoAndPlay("fadeIn");
}
but if u wanna it to flade in with AS
on (rollOver) {
_root.attachMovie("mc1", "mc1", 5);
_root.mc1._x = 400;
_root.mc1._y = 25;
_root.mc1._alpha = ;
_root.mc1._alpha ++;
}
Romulus
04-01-2002, 02:01 PM
I'll give them a shot later today and I'll let ya know how it gows....
thanks for the help.
red penguin
04-01-2002, 02:11 PM
farafiro: Yeah, but it wil only execute that line of code once..thus it will only increase it by one...It's not like an "enterFrame"...
farafiro
04-02-2002, 08:26 AM
Originally posted by red penguin
farafiro: Yeah, but it wil only execute that line of code once..thus it will only increase it by one...It's not like an "enterFrame"...
Yep, and that's what he wants.... everytime u rollOver a different button ..... a different pic loads
wait, ooops u r right I was talking about loadMovieNum not attachMovie
ok, u r Mr.right
farafiro
04-02-2002, 08:30 AM
wait, after some thinking u look at the code in red
on (rollOver) {
_root.attachMovie("mc1", "mc1", 5);
_root.mc1._x = 400;
_root.mc1._y = 25;
_root.mc1._alpha = 0;
_root.mc1._alpha ++;
}
this will make sure that each time u rollOver any button the holder mc's _alpha will be 0
what do u think about that :D
red penguin
04-02-2002, 09:49 AM
Sure, it will make the clip's alpha zero..but he wants the thing to fade in and what you propose just doesn't work there...
Have you made that function yet, Romulus?
farafiro
04-02-2002, 10:42 AM
yep, u r right ... I just tested it now
u r right
But I still insist that u can do it by this way .... we can do it with Variables
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.