pages.page1.width :)

On Thu, Apr 9, 2009 at 12:35 PM, Dav <d...@funkdaweb.com> wrote:

> Hi all,
>
>
>
> Wondering if anyone can help me with a problem that's left me scratching my
> head!
>
>
>
> Basically I have a main movieclip (group) and then several other movieclips
> inside it (page[1-6]).
>
>
>
> I was thinking I could access them like this group.page1, group.page2 and
> so
> on. However it is not working for me.
>
>
>
> Here is some stripped down sample code, obviously the moviclips have
> content
> rather than just being blank:
>
>
>
> ///////////////////////////////////////////////////
>
> var group:MovieClip       = new MovieClip();
>
> addChild(group);
>
>
>
> var pages:Object              = new Object();
>
> pages["page1"]                = new MovieClip();
>
> pages["page2"]                = new MovieClip();
>
> pages["page3"]                = new MovieClip();
>
> pages["page4"]                = new MovieClip();
>
> pages["page5"]                = new MovieClip();
>
> pages["page6"]                = new MovieClip();
>
>
>
> for each (var page:MovieClip in pages)
>
> {
>
>                group.addChild(page);
>
> }
>
>
>
> group.page1.width         = 200;    // [Fault] exception,
> information=TypeError: Error #1010: A term is undefined and has no
> properties. Fault, initScene() at Main.as:103
>
> ////////////////////////////////////////////////////
>
>
>
> So I get this error when trying to access the width of page1 inside group:
> [Fault] exception, information=TypeError: Error #1010: A term is undefined
> and has no properties. Fault, initScene() at Main.as:103
>
>
>
> Any ideas how I can access the page movieclips within the group movieclip?
>
>
>
> Thanks!
>
> Dav
>
> _______________________________________________
> 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

Reply via email to