-
the display changes every variable no. of mins
hello everybody,
i would like to let the user enter a number of minutes resempling transition speed ,
where the display changes every bla bla minutes (entered no.)
(i.e. if the user entered 6 the display will change every 6 minutes .. )
what is the best way to do so ?????
la ALLAH ela ALLAH mohamed rasol ALLAH
-
hi rasha,
you could use setInterval for this and attach a listener to the textfield so when the textfield is updated it changes a var you set for the interval time. Here is an example input textbox instance name 'theNum':
function callback() {
//do stuff here, change display
trace("interval called");
}
function callInterval(num){
intervalID = setInterval(callback, 60*(num*1000));
//num in this case is the minutes, if you want seconds get rid
//of the 60
}
callInterval(5);
//start off with 5 minutes
//listener function for the textfield
function TListener() {
this.onChanged = function() {
//make sure that nothing happens if the textBox is empty
if(theNum.text==""){
null;
}else{
clearInterval(intervalID);
num = theNum.text;
callInterval(theNum.text);
}
};
}
myListener = new TListener();
theNum.addListener(myListener);
hope this helps,
Dunc
-
thanks a lot
this did help but still i have a problem here, the movie clips arent displayed sequencially right
what means i have the first then the second then the interval is called twice at a time displaying the fourth instead of the third and then the sixth instead of the fifth
i cant understand why is this happening , can u ??
here is the code i did add to yours, where next is the frame name where the next movie clip is called
Code:
function callback() {
_root.previousarrow._visible = false;
_root.nextarrow._visible = false;
if(index<5){
gotoAndPlay("next");
}
else{
loadMovieNum (nextfile, 0);
}
la ALLAH ela ALLAH mohamed rasol ALLAH
-
hmmm, interesting, it sounds like your jumping from frame to frame, do you have more than one callback function by chance? I noticed this, which is why i am asking.
if(index<5){
gotoAndPlay("next");
}
else{
loadMovieNum (nextfile, 0);
}
can you post a sample fla with the problems?
Dunc
-
ok i emailed u , send me your email to send the file to u
thanks
la ALLAH ela ALLAH mohamed rasol ALLAH
-
-
u r over qouta
la ALLAH ela ALLAH mohamed rasol ALLAH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|