Re: [Flashcoders] nested for loops stumper

2008-01-25 Thread Muzak

Classes/Components
Events
Delegate

So instead of having:

some_btn.onRollOver = function(){}

do this:

import mx.utils.Delegate;
myCustomButton.addEventListener("rollover", Delegate.create(this, 
rolloverHandler);

Where myCustomButton is a custom component dispatching an event (in this case 
rollover).

And in the event handler you can reference the component that dispatched the 
event through the argument passed to the event handler

function rolloverHandler(o:Object):Void {
   trace("target: " + o.target);
}

regards,
Muzak

- Original Message - 
From: "Bob Wohl" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Friday, January 25, 2008 6:23 PM
Subject: Re: [Flashcoders] nested for loops stumper



so then would it be this._parent["mc_"+i] ?

enlighten please.

On Jan 25, 2008 9:08 AM, Muzak <[EMAIL PROTECTED]> wrote:


You should never have to do that.
If for some reason you have to, something is wrong with your workflow.

"this" is and should always be "this".

- Original Message -
From: "Rob Emenecker" <[EMAIL PROTECTED]>
To: "'Flash Coders List'" 
Sent: Friday, January 25, 2008 3:53 PM
Subject: RE: [Flashcoders] nested for loops stumper


>
>> yep, you need some kind of scope declaration to tell you where the
>> items are. a lot of people use thisRoot = this; (or something that
>> states the location) and then all you have to do is pass 'thisRoot'
>> around as a reference to where that item is. That way you never
>> have to say 'this' when it's not actualy 'this'.
>
> Thumps himself in the head! Doh! What a great idea. Never thought of
doing
> that!
>


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] nested for loops stumper

2008-01-25 Thread Bob Wohl
so then would it be this._parent["mc_"+i] ?

enlighten please.

On Jan 25, 2008 9:08 AM, Muzak <[EMAIL PROTECTED]> wrote:

> You should never have to do that.
> If for some reason you have to, something is wrong with your workflow.
>
> "this" is and should always be "this".
>
> - Original Message -
> From: "Rob Emenecker" <[EMAIL PROTECTED]>
> To: "'Flash Coders List'" 
> Sent: Friday, January 25, 2008 3:53 PM
> Subject: RE: [Flashcoders] nested for loops stumper
>
>
> >
> >> yep, you need some kind of scope declaration to tell you where the
> >> items are. a lot of people use thisRoot = this; (or something that
> >> states the location) and then all you have to do is pass 'thisRoot'
> >> around as a reference to where that item is. That way you never
> >> have to say 'this' when it's not actualy 'this'.
> >
> > Thumps himself in the head! Doh! What a great idea. Never thought of
> doing
> > that!
> >
> >
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] nested for loops stumper

2008-01-25 Thread Muzak
You should never have to do that. 
If for some reason you have to, something is wrong with your workflow.


"this" is and should always be "this".

- Original Message - 
From: "Rob Emenecker" <[EMAIL PROTECTED]>

To: "'Flash Coders List'" 
Sent: Friday, January 25, 2008 3:53 PM
Subject: RE: [Flashcoders] nested for loops stumper




yep, you need some kind of scope declaration to tell you where the 
items are. a lot of people use thisRoot = this; (or something that 
states the location) and then all you have to do is pass 'thisRoot' 
around as a reference to where that item is. That way you never 
have to say 'this' when it's not actualy 'this'.


Thumps himself in the head! Doh! What a great idea. Never thought of doing
that!




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] nested for loops stumper

2008-01-25 Thread Rob Emenecker
 
> yep, you need some kind of scope declaration to tell you where the 
> items are. a lot of people use thisRoot = this; (or something that 
> states the location) and then all you have to do is pass 'thisRoot' 
> around as a reference to where that item is. That way you never 
> have to say 'this' when it's not actualy 'this'.

Thumps himself in the head! Doh! What a great idea. Never thought of doing
that!


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] nested for loops stumper

2008-01-24 Thread Bob Wohl
yep, you need some kind of scope declaration to tell you where the items
are. a lot of people use thisRoot = this; (or something that states the
location) and then all you have to do is pass 'thisRoot' around as a
reference to where that item is. That way you never have to say 'this' when
it's not actualy 'this'.


B.

On Jan 24, 2008 7:08 PM, Dwayne Neckles <[EMAIL PROTECTED]> wrote:

> ok guys sorry for sending this quest out
>
> i found the answer .. u can not forget the this before any dynamically
> access variables..
>
> nothing wrong with a good reminder right : )
>
>
>
> > From: [EMAIL PROTECTED]
> > To: flashcoders@chattyfig.figleaf.com
> > Date: Fri, 25 Jan 2008 01:52:58 +
> > Subject: [Flashcoders] nested for loops stumper
> >
> > I 4 movie clips on the stage named scrollx where x are numbers 0- 3 and
> within each scrollx clip i have 5 nested movieclips..is called clipx where x
> are numbers 0-4
> >
> > YET when i run the function below.. tracing scroll works but not
> scrollx.clipx
> > yet j traces fine..
> >
> > any suggestions???
> >
> > also the for loop ran well went not in the onEnterframe function, im
> stuck..
> > this.onEnterFrame = function() {
> > //outerloop that goes through all of the clips the four scroll clips
> on the timeline
> > for (var i = 0; i<4; i++) {
> >
> > //inner loop that goes through each drink in the scroll clips
> >
> > for (var j = 0; j<5; j++) {
> > trace(j);
> >
> > trace(["scroll"+i]["clip"+j]._x);
> >
> >
> > }
> >
> >
> > }
> >
> > };
> >
> > _
> > Shed those extra pounds with MSN and The Biggest Loser!
> >
> http://biggestloser.msn.com/___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _
> Shed those extra pounds with MSN and The Biggest Loser!
>
> http://biggestloser.msn.com/___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] nested for loops stumper

2008-01-24 Thread Dwayne Neckles
ok guys sorry for sending this quest out

i found the answer .. u can not forget the this before any dynamically access 
variables..

nothing wrong with a good reminder right : )



> From: [EMAIL PROTECTED]
> To: flashcoders@chattyfig.figleaf.com
> Date: Fri, 25 Jan 2008 01:52:58 +
> Subject: [Flashcoders] nested for loops stumper
> 
> I 4 movie clips on the stage named scrollx where x are numbers 0- 3 and 
> within each scrollx clip i have 5 nested movieclips..is called clipx where x 
> are numbers 0-4
> 
> YET when i run the function below.. tracing scroll works but not scrollx.clipx
> yet j traces fine.. 
> 
> any suggestions???
> 
> also the for loop ran well went not in the onEnterframe function, im stuck..
> this.onEnterFrame = function() {
> //outerloop that goes through all of the clips the four scroll clips on 
> the timeline
> for (var i = 0; i<4; i++) {
> 
> //inner loop that goes through each drink in the scroll clips
> 
> for (var j = 0; j<5; j++) {
> trace(j);
> 
> trace(["scroll"+i]["clip"+j]._x);
> 
> 
> }
> 
> 
> }
> 
> };
>  
> _
> Shed those extra pounds with MSN and The Biggest Loser!
> http://biggestloser.msn.com/___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] nested for loops stumper

2008-01-24 Thread Dwayne Neckles
I 4 movie clips on the stage named scrollx where x are numbers 0- 3 and within 
each scrollx clip i have 5 nested movieclips..is called clipx where x are 
numbers 0-4

YET when i run the function below.. tracing scroll works but not scrollx.clipx
yet j traces fine.. 

any suggestions???

also the for loop ran well went not in the onEnterframe function, im stuck..
this.onEnterFrame = function() {
//outerloop that goes through all of the clips the four scroll clips on the 
timeline
for (var i = 0; i<4; i++) {

//inner loop that goes through each drink in the scroll clips

for (var j = 0; j<5; j++) {
trace(j);

trace(["scroll"+i]["clip"+j]._x);


}


}

};
 
_
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders