> trace(this.isLoaded()); // when I try to trace the
method it
> gives
> me undefined.
Drop the parens:
trace(this.isLoaded);// [type Function]
I had to comment out the code relating to XMLLoader (since I
don't have it)
in order to eliminate compile errors. Otherwise I am not
seeing any problem
with the interval scope.
Regards,
-Keith
http://keithrei
nfeld.home.comcast.net
> -----Original Message-----
> From: flashnewbie-bounces chattyfig.figleaf.com
[mailto:flashnewbie-
> bounces chattyfig.figleaf.com] On Behalf Of ilteris kaplan
> Sent: Monday, September 03, 2007 5:19 PM
> To: Flashnewbie Mailing List
> Subject: [Flashnewbie] interval scope
>
> Hello Everyone,
>
> Once again I am struggling with finding the right scope
for my
> Interval. Please follow if you have the patience. What
happens is, I
> am trying to call a function from my setInterval but
this function
> doesn't seem to be in the scope of the class for some
weird reason.
> Am I missing something here?
>
> best,
> ilteris
>
>
> class EquipmentManager {
>
>
> private var xml:XmlLoader;
>
> private var equipArr:Array;
> public var xmlInterval;
> public function EquipmentManager(container_:MovieClip)
{
> xml = new XmlLoader("studio.xml");
>
> equipArr = new Array();
>
> buildTimer(container_);
>
> }
>
>
>
> private function buildTimer(container_:MovieClip) {
> xmlInterval = setInterval(this,
"isLoaded",100, container_);
> //
> this function never gets called!
> trace(this.isLoaded()); // when I try to trace the
method it
> gives
> me undefined.
>
> }
>
>
> public function isLoaded(container_:MovieClip):Void {
>
> if(xml.isDone()) {
> for(var i:Number = 0; i <
xml.getTotalNumOfEquipment();
> i++) {
> var equip = new Equipment(container_);
> equipArr.push(equip);
> //trace(equipArr[i]);
> }
> clearInterval(xmlInterval);
> }
>
> }
>
>
>
> }
>
>
>
>
>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|