RE: [Flashcoders] parent property woes in AS3

2008-01-06 Thread Jesse Graupmann

var a:MovieClip = new MovieClip ();
var b:MovieClip = new MovieClip ();
a.addChild( b );

trace  (  MovieClip( b.parent ).play ) // function Function() {}

trace  ( ( b.parent as MovieClip ).play ) // function Function() {}

trace  (  b.parent.play ) // 1119: Access of possibly undefined property
play through a reference with static type
flash.display:DisplayObjectContainer.



_

Jesse Graupmann
www.jessegraupmann.com 
www.justgooddesign.com/blog/ 
_


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Fumio Nonaka
Sent: Sunday, January 06, 2008 4:22 AM
To: Flash Coders List
Subject: Re: [Flashcoders] parent property woes in AS3

You should cast to the class.  About casting see the following:

Programming ActionScript 3.0 > ActionScript language and syntax > Data 
types > Type conversions:
http://livedocs.adobe.com/flash/9.0/main/0048.html
_
Omar Fouad wrote:
> so if I am inside a movieClip mc i should do:
> 
> mc(parent).play(); ???

> On Jan 6, 2008 5:45 AM, Fumio Nonaka <[EMAIL PROTECTED]> wrote:
>>The parent is a property of DisplayObject class, while the play() method
>>is belongs to MovieClip class which is a sub class of DisplayObject.
>>Therefore the reference of the property should be cast to MovieClip class.
>>
>>MovieClip(parent).play();
-- 
Fumio Nonaka

___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] parent property woes in AS3

2008-01-06 Thread Fumio Nonaka

You should cast to the class.  About casting see the following:

Programming ActionScript 3.0 > ActionScript language and syntax > Data 
types > Type conversions:

http://livedocs.adobe.com/flash/9.0/main/0048.html
_
Omar Fouad wrote:

so if I am inside a movieClip mc i should do:

mc(parent).play(); ???



On Jan 6, 2008 5:45 AM, Fumio Nonaka <[EMAIL PROTECTED]> wrote:

The parent is a property of DisplayObject class, while the play() method
is belongs to MovieClip class which is a sub class of DisplayObject.
Therefore the reference of the property should be cast to MovieClip class.

MovieClip(parent).play();

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books
Flash community
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] parent property woes in AS3

2008-01-05 Thread Omar Fouad
so if I am inside a movieClip mc i should do:

mc(parent).play(); ???

On Jan 6, 2008 5:45 AM, Fumio Nonaka <[EMAIL PROTECTED]> wrote:

> The parent is a property of DisplayObject class, while the play() method
> is belongs to MovieClip class which is a sub class of DisplayObject.
> Therefore the reference of the property should be cast to MovieClip class.
>
> MovieClip(parent).play();
> _
> Omar Fouad wrote:
> > In AS3 I am tring to get the parent movieClip that contains some
> movieClip
> > timeline animation...
> >
> > parent.play();
> >
> > It gets me an Error???
>
> Good luck,
> --
> Fumio Nonaka
> mailto:[EMAIL PROTECTED]
> http://www.FumioNonaka.com/
> My books
> Flash community
> ___
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] parent property woes in AS3

2008-01-05 Thread Fumio Nonaka
The parent is a property of DisplayObject class, while the play() method 
is belongs to MovieClip class which is a sub class of DisplayObject. 
Therefore the reference of the property should be cast to MovieClip class.


MovieClip(parent).play();
_
Omar Fouad wrote:

In AS3 I am tring to get the parent movieClip that contains some movieClip
timeline animation...

parent.play();

It gets me an Error???


Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books
Flash community
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders