Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-22-2003, 07:54 PM   #1
Shaded
Registered User
 
Join Date: Mar 2003
Posts: 4
Question setInterval not working

Hello,

I am experiencing a strange problem with regards to "setInterval" not starting if "getSelectedIndex" has been called on a listBox.

I am using setInterval to fade in content loaded with loadMovie. All works well until "getSelectedIndex" is called - at that point, setInterval refuses to start doing its thing.

Any help or experience would be much appreciated.
Shaded is offline   Reply With Quote
Old 03-22-2003, 07:57 PM   #2
bluegel
Im watching in my absence
 
bluegel's Avatar
 
Join Date: Feb 2003
Location: wherever the mood takes me
Posts: 2,114
Default

can you put up a little code, cos it might just be something in your code thats not 100% correct.

thanx
__________________
Im a girl

Watching in my absence - courtesy of CyanBlue
bluegel is offline   Reply With Quote
Old 03-22-2003, 08:09 PM   #3
Shaded
Registered User
 
Join Date: Mar 2003
Posts: 4
Default

Sure,

Here is the code on Frame 1:

function fadeInContent(){
contentFadeAmount = 0;
fadeIn = setInterval(fade, 50);
contentMovieClip._alpha = 100;
}

function fade() {
contentMovieClip._alpha = contentFadeAmount;
contentFadeAmount = _global.contentFadeAmount+10;
if (_global.contentFadeAmount>=100) {
clearInterval(fadeIn);
}
}

And here is the button code affecting the (totally unrelated) listBox called myInfo which causes the above setInterval to not be called.

on(release)
{
listitem = _root.myInfo.getSelectedIndex();
_root.myInfo.removeItemAt(listitem);
}

Thanks for any help!
Shaded is offline   Reply With Quote
Old 03-22-2003, 08:21 PM   #4
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

ActionScript Code:
// This function you call to setInterval...*looks fine* function fadeInContent(){ contentFadeAmount = 0; fadeIn = setInterval(fade, 50); contentMovieClip._alpha = 100; } // This function is what is called by setInterval.... // I see you want to clear Interval when contentFadeAmount >= 100 // But are you refering to the same variable in "fadeInContent"? // If you are, you don't need to make in global and you need a // a counter of some sort .... b/c contentFadeAmount seems to be // only at 0. // If it only stays at zero, your condition will never be true to clearInterval.   function fade() { contentMovieClip._alpha = contentFadeAmount; contentFadeAmount = _global.contentFadeAmount+10; if (_global.contentFadeAmount>=100) { clearInterval(fadeIn); } }
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 03-22-2003, 08:29 PM   #5
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

as for...
Quote:
And here is the button code affecting the (totally unrelated) listBox called myInfo which causes the above setInterval to not be called.
ActionScript Code:
on(release) { listitem = _root.myInfo.getSelectedIndex(); _root.myInfo.removeItemAt(listitem); }
I'm not sure why you have this for.... I gotta fly....hopefully someone else can be of great help to you.

Well...I'll check the thread out later tonight *just in case*
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 03-22-2003, 08:33 PM   #6
Shaded
Registered User
 
Join Date: Mar 2003
Posts: 4
Default

Thanks so much for your help!

The Global variable designation were left over from part of an experiment. This part of the code works fine.

The trouble is after the button is pressed to remove an item from a list box - the setInterval then refuses to be called.

Thanks again.
Shaded is offline   Reply With Quote
Old 03-23-2003, 02:06 PM   #7
bluegel
Im watching in my absence
 
bluegel's Avatar
 
Join Date: Feb 2003
Location: wherever the mood takes me
Posts: 2,114
Default

thanx boyz - was being a bit tired today, and not very with it - as mentioned in PM

and shaded:

Quote:
The trouble is after the button is pressed to remove an item from a list box - the setInterval then refuses to be called.
put some traces in, to see where the problem starts, and if you still can't suss out what the problem is, post the code, where the problem begins - or even, upload your file.
__________________
Im a girl

Watching in my absence - courtesy of CyanBlue
bluegel is offline   Reply With Quote
Old 03-23-2003, 03:05 PM   #8
Shaded
Registered User
 
Join Date: Mar 2003
Posts: 4
Default

Thanks so much bluegel! I have attached a .zip of the FLA files - the item in question is called insideMM.fla.
Shaded is offline   Reply With Quote
Old 03-24-2003, 10:24 AM   #9
bluegel
Im watching in my absence
 
bluegel's Avatar
 
Join Date: Feb 2003
Location: wherever the mood takes me
Posts: 2,114
Default

file??
__________________
Im a girl

Watching in my absence - courtesy of CyanBlue
bluegel is offline   Reply With Quote
Old 03-25-2003, 01:40 AM   #10
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

this might help
http://www.umbc.edu/interactive/flas...etInterval.php
__________________
(6)
senocular is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:02 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.