View Full Version : actionscript problem
EEE
June 14th, 2004, 05:48 AM
hi,
im doing actionscript to link pages.The needs is : have a set of .swf file movie ,i need to let the user to click on the .swf file they would like to see later .Examples: the user click 1.swf and 2.swf , so it must show 1.swf then 2.swf.
i already try out this using array but how can i using array to loadmovie and trace 2 movie like the case above.
If array cannot , how urs opinion to do this?help..
best wishes~~
Voetsjoeba
June 14th, 2004, 07:51 AM
Is this what you mean ? http://www.kirupa.com/developer/mx/full_site.htm
EEE
June 14th, 2004, 09:15 PM
hmm, i dont think so is that. what i want is something like this :
example :
on (release) {
_root.contents.loadMovie("music.swf");
_root.contents.loadMovie("membership.swf");
}
i want the to load 2 .swf file like wat i wrote above
i mean how to load a file after a file finish loading.
best wishes
Voetsjoeba
June 15th, 2004, 01:50 PM
Ooh, so you want to load membership.swf after music.swf has loaded ? Or are you trying to let the user click a serie of buttons, and then show the swfs in the clicked order ? I'm kinda confused.
ScriptFlipper
June 15th, 2004, 03:33 PM
I think he means:
* User clicks on button
* movie1.swf starts playing
* When movie1.swf is finished, movie2.swf starts playing
This might be what you are looking for
EEE
June 16th, 2004, 11:45 PM
what i mean is :let the user click a serie of buttons, and then show the swfs in the clicked order.
already try out using the probability ,did you know any to do this beside using probability cos using that need to count all the probability and the swf file is already set according the probability. i want to try to find another method to do this.
ScriptFlipper
June 17th, 2004, 05:06 AM
Okay then, how about this?
karena
June 18th, 2004, 11:03 PM
er...how about if the user can choose as many choices they like or 1 choice only????
cos your script is set the choice to 3 choices only
karena
June 18th, 2004, 11:40 PM
sorry...and one more thing is how about when i would like my movie play in next frame?
EEE
June 19th, 2004, 01:23 AM
can do if while loading the swf file after choosing the choice , make a pause & play button to pause the swf file then play again??
thanks~
ScriptFlipper
June 19th, 2004, 07:49 AM
er...how about if the user can choose as many choices they like or 1 choice only????
cos your script is set the choice to 3 choices only
yes, I'm sorry about that. if you replace this part of the script, it will work with multiple clicks. simple copy this new code into the .fla and replace the old showMovies function
showMovies = function (i) {
contents.loadMovie(moviesToShow_array[i]);
contents.play();
if (i<num-1) {
this.onEnterFrame = function() {
if (contents._currentframe == contents._totalframes && contents._currentframe>0) {
showMovies(i+1);
}
};
} else {
delete moviesToShow_array;
delete this.onEnterFrame;
moviesToShow_array = new Array();
}
};
karena
June 19th, 2004, 01:32 PM
:sleep: i try to replace but ...
izzit the script....
num = 3;
moviesToShow_array = new Array();
addMovie = function (movie) {
len = moviesToShow_array.push(movie);
if (len == num) {
showMovies(0);
}
};
have to delete also?
or..can u attach a new zip file to me?
sorry to answer my question again but really thankx a lots
ScriptFlipper
June 19th, 2004, 01:41 PM
sure, here's the new example.fla
have fun :)
karena
June 19th, 2004, 09:10 PM
thankx scriptFlipper...:bu:
karena
June 19th, 2004, 09:17 PM
soli..the latest example you post is not able for user to choose whatever number of swf movie they like such as 1 or 2 or 4 to load..
ScriptFlipper
June 20th, 2004, 06:20 AM
that can be done easily by yourself if you follow these instructions:
1. create an "Input Text" textfield in the movie. give it the instance name "num_txt"
2. write 3 in it.
3. in the actionscript code, delete this line (the first line of code)
num=3;
4. insert this actionscript code at the top:
num = num_txt.text;
num_txt.onChanged = function () {
_root.num = this.text;
};
now you can test your movie and enter any number you want in that textfield, and that number will also be the number of clicks before the movies start playing (so if the number is 5, it will play 5 movies in the order you clicked them)
karena
June 20th, 2004, 07:54 PM
thankx..i get it and did it...
but how if i want my movie load in frame two?i mean the movie clip at another frame....
EEE
June 21st, 2004, 05:00 AM
how about i don't want to load the file automatically and use a next button for user to click to it.After click to the next button the file will load to second swf file which the user choose just now.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.