|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
setInterval ProblemI have following scenario where setInterval does not fire.
On button Release Handler - Load sound -> On Complete Sound Handler -> Create XML Socket -> On Data Handler -> setInterval(myfunction, 30000) setInterval never fires and myfunction never gets called. However, if I use setInterval(myfunction, 30000) from the button release handler, it does works. Here is AS layout class myclass { static var app : myclass; // entry point static function main(mc) { app = new myclass(); } ... function myfunction() { } } This works fine in MMC though. Please help. ~Jim -- MTASC : no more coffee break while compiling |
|
|
Re: setInterval ProblemHave you tried
setInterval(this, 'myfunction', 30000); or setInterval(Delegate.create(this, this.myfunction), 30000); ? Jim Boykin a écrit : > I have following scenario where setInterval does not fire. > > On button Release Handler - Load sound -> On Complete Sound Handler -> > Create XML Socket -> On Data Handler -> setInterval(myfunction, 30000) > > setInterval never fires and myfunction never gets called. However, if > I use setInterval(myfunction, 30000) from the button release handler, > it does works. > > > Here is AS layout > > class myclass { > > static var app : myclass; > > // entry point > static function main(mc) { > app = new myclass(); > } > > ... > > function myfunction() { > > } > > } > > > This works fine in MMC though. > > Please help. > > ~Jim > > -- MTASC : no more coffee break while compiling |
|
|
Re: setInterval ProblemI tried first method earlier after searching mailing list and it does not work.
I just tried second method and it gives error - ' type error Unknown variable Delegate' Please help Thanks Anyway. type error Unknown variable Delegate On 10/2/07, Julien D <jd@...> wrote: > Have you tried > > setInterval(this, 'myfunction', 30000); > > or > > setInterval(Delegate.create(this, this.myfunction), 30000); > > ? > > > Jim Boykin a écrit : > > I have following scenario where setInterval does not fire. > > > > On button Release Handler - Load sound -> On Complete Sound Handler -> > > Create XML Socket -> On Data Handler -> setInterval(myfunction, 30000) > > > > setInterval never fires and myfunction never gets called. However, if > > I use setInterval(myfunction, 30000) from the button release handler, > > it does works. > > > > > > Here is AS layout > > > > class myclass { > > > > static var app : myclass; > > > > // entry point > > static function main(mc) { > > app = new myclass(); > > } > > > > ... > > > > function myfunction() { > > > > } > > > > } > > > > > > This works fine in MMC though. > > > > Please help. > > > > ~Jim > > > > > > > -- > MTASC : no more coffee break while compiling > -- MTASC : no more coffee break while compiling |
|
|
Re: setInterval Problemto use delegate, you need to import the delegate class. maybe it would
it would be a good idea if you post the relevant code, so we can see where the failure might be. regards, jan eric Jim Boykin schrieb: > I tried first method earlier after searching mailing list and it does not work. > > I just tried second method and it gives error - ' type error Unknown > variable Delegate' > > Please help > > Thanks Anyway. > > type error Unknown variable Delegate > > On 10/2/07, Julien D <jd@...> wrote: >> Have you tried >> >> setInterval(this, 'myfunction', 30000); >> >> or >> >> setInterval(Delegate.create(this, this.myfunction), 30000); >> >> ? >> >> >> Jim Boykin a écrit : >>> I have following scenario where setInterval does not fire. >>> >>> On button Release Handler - Load sound -> On Complete Sound Handler -> >>> Create XML Socket -> On Data Handler -> setInterval(myfunction, 30000) >>> >>> setInterval never fires and myfunction never gets called. However, if >>> I use setInterval(myfunction, 30000) from the button release handler, >>> it does works. >>> >>> >>> Here is AS layout >>> >>> class myclass { >>> >>> static var app : myclass; >>> >>> // entry point >>> static function main(mc) { >>> app = new myclass(); >>> } >>> >>> ... >>> >>> function myfunction() { >>> >>> } >>> >>> } >>> >>> >>> This works fine in MMC though. >>> >>> Please help. >>> >>> ~Jim >>> >>> >> >> -- >> MTASC : no more coffee break while compiling >> > -- MTASC : no more coffee break while compiling |
|
|
Re: setInterval Problem
If you call setInterval from your static main function, you should
instead do :
static function main(mc) {
app = new myclass();
setInterval(app, 'myfunction', 30000); // beware that 30000 is 30 seconds !
}
This should work.Anyway, good to know, to import delegate, add : import mx.utils.Delegate at the beginning of the file, and be sure to add -mx to compiler params. jannerick a écrit : to use delegate, you need to import the delegate class. maybe it would it would be a good idea if you post the relevant code, so we can see where the failure might be. regards, jan eric Jim Boykin schrieb:I tried first method earlier after searching mailing list and it does not work. I just tried second method and it gives error - ' type error Unknown variable Delegate' Please help Thanks Anyway. type error Unknown variable Delegate On 10/2/07, Julien D jd@... wrote: -- MTASC : no more coffee break while compiling |
| Free embeddable forum powered by Nabble | Forum Help |