action script help
- Started
- Last post
- 12 Responses
- unknown
all right for all you code heads this should be mad simple.
what I want to do is make a button load two movies, but if one is already loaded I just want it to load the other. please help.
- unfittoprint0
myButton.onPress=function(){
if(movie1.getBytesLoaded() != movie1.getBytesTotal()) {
movie1.loadMovie("movie1.swf")
}if(movie2.getBytesLoaded() != movie2.getBytesTotal()) {
movie2.loadMovie("movie2.swf")
}}
- kodap0
unfit, how much will you take for actioncscript lessons?
€:
- unknown0
that's awesome. you da man. if i run in to probs i'll be back.
- unfittoprint0
meu caro, diz-me se precisares de ajuda.
- kodap0
ahah, só pa saber... tou a morar em LX a partir do primeiro de outubro - para começar o meu bizz. depois logo se vê
;)
- kodap0
[/end intermission]
- unfittoprint0
kool! LX precisa de mais um noctívago!
your bizz? startin' somethin' of your own?
- unknown0
so yeah it's not working and I'm not getting any errors.
- unfittoprint0
hmmm. try:
myButton.onPress = function() {
if (movie1.getBytesLoaded() != movie1.getBytesTotal() && movie1.getBytesTotal>0) {
movie1.loadMovie("movie1.swf");
}
if (movie2.getBytesLoaded() != movie2.getBytesTotal() && movie2.getBytesTotal>0) {
movie2.loadMovie("movie2.swf");
}
};
- unknown0
same problem notta
- unknown0
you must relize that I am very inept when it comes to this.
- unfittoprint0
copy/paste the actions to an action layer
name the button myButton
the external movies should be on the same directory of your main movie. if not, you should indicate it in the loadMovie action: "directory/movie.swf"...
name the movies movie1 e movie2 (should be empty empty movies). Better, you could add these 2 actions:
this.createEmptyMovieClip("movie...
this.createEmptyMovieClip("movie...
good luck.