Groups | Blog | Home
all groups > flash actionscript > january 2005 >

flash actionscript : having a bit of trouble


TJMonster51
1/2/2005 9:26:30 PM
can some one help me optimize this. it works but not real well.

stop();
attachMovie("harpoles", "harpoles", 100);
harpoles._x = 440;
harpoles._y = 95;
harpoles.onRelease = function() {
attachMovie("harclp", "harclp", 125);
harclp._x = 72;
harclp._y = 120;
attachMovie("hartext", "hartext", 126);
hartext._x = 130;
hartext._y = 150;
attachMovie("closebtn", "closebtn", 127);
closebtn._x = 400;
closebtn._y = 370;
closebtn.onRelease = function() {
unloadMovie("harclp");
unloadMovie("closebtn");
unloadMovie("hartext");
};
};
attachMovie("willy", "willy", 101);
willy._x = 363;
willy._y = 173;
willy.onRelease = function() {
attachMovie("harclp", "harclp", 125);
harclp._x = 72;
harclp._y = 120;
attachMovie("willtext", "willtext", 126);
willtext._x = 130;
willtext._y = 150;
attachMovie("closebtn", "closebtn", 127);
closebtn._x = 400;
closebtn._y = 370;
closebtn.onRelease = function() {
unloadMovie("harclp");
unloadMovie("closebtn");
unloadMovie("willtext");
};
};
//bluebird
attachMovie("bluebirdbtn","bluebirdbtn",102);
bluebirdbtn._x=440;
bluebirdbtn._y=166;
bluebirdbtn.onRelease = function(){
attachMovie("harclp", "harclp", 125);
harclp._x = 72;
harclp._y = 120;
attachMovie("birdtext", "birdtext", 126);
birdtext._x = 130;
birdtext._y = 150;
attachMovie("closebtn", "closebtn", 127);
closebtn._x = 400;
closebtn._y = 370;
closebtn.onRelease = function() {
unloadMovie("harclp");
unloadMovie("closebtn");
unloadMovie("birdtext");
};
};
NSurveyor
1/2/2005 9:30:16 PM
TJMonster51
1/2/2005 9:33:28 PM
NSurveyor
1/2/2005 9:35:45 PM
Perhaps:

stop();
openWindow("harpoles",440,95,100);
openWindow("willy",363,173,101);
openWindow("bluebirdbtn",440,166,102);
function openWindow(screen,x,y,atDepth){
attachMovie("screen", "screen", atDepth);
screen._x = 440;
screen._y = 95;
screen.onRelease = function() {
attachMovie("harclp", "harclp", 125);
harclp._x = 72;
harclp._y = 120;
attachMovie("hartext", "hartext", 126);
hartext._x = 130;
hartext._y = 150;
attachMovie("closebtn", "closebtn", 127);
closebtn._x = 400;
closebtn._y = 370;
closebtn.onRelease = function() {
unloadMovie("harclp");
unloadMovie("closebtn");
unloadMovie("hartext");
};
};
}
NSurveyor
1/2/2005 9:37:30 PM
NSurveyor
1/2/2005 9:43:17 PM
Well, it probably takes time to load the movieclip from the library. So, you
could probably attach all the movies beforehand. And then instead of attaching
and unloading, you could simply change the _visible properties of the movieclip.
TJMonster51
1/2/2005 9:45:34 PM
AddThis Social Bookmark Button