Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
SWF Protect, Amayeta or others ?   Message List  
Reply | Forward Message #71182 of 150475 |
RE: [flexcoders] swap Children>?

You say your container is a DisplayObjectContainer. Is it also a Flex Container such as Canvas or VBox? If so, there is a bug with using swapChildrenAt() and maybe with swapChildren() as well. Try using removeChildAt() and addChildAt() instead.
 
A Flex Container does tricky stuff with child indexes and overrides child management APIs such as numChildren, addChildAt(), removeChildAt(), etc., because there are two kinds of children -- content children and non-content children. If you write
 
<HBox>
    <Button/>
    <Button/>
</HBox>
 
there are only two content children but, if the HBox has a background or scrollbars, there can be additional non-children children.
 
I think what happened is that the swapChildren() and swapChildrenAt() methods got added to DisplayObjectContainer in Player 9, and the Flex framework is not yet supporting them properly in the Container class.
 
- Gordon


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Wicks
Sent: Wednesday, April 11, 2007 5:39 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] swap Children>?

Thanks for this - still doesn't work though ... driving me mad


matt
On 11 Apr 2007, at 12:44, Ciarán wrote:

Hi Matt,

Sounds like there's a problem with flex updating the screen before the
children are swapped properly.

Try validating the component after the call to swap the children, and
catching any exception thrown.

try {
container.swapChildrenAt(ind,1);
container.validateNow();
}
catch (err:Error())
{

}

Does that make any difference?

Best Regards,
Ciarán

On 11 Apr 2007 03:44:04 -0700, Matt Wicks <matt@thewebforge.co.uk> wrote:
>
>
>
>
>
>
> Hi there all,
>
>
>
> bit of a puzzle I'm having and would be grateful for some help...
>
>
>
>
> container is a displayObjectContainer and objectToMove is a Display object
>
>
> var ind:int = container.getChildIndex(objectToMove)
>
>
>
>
> container.swapChildrenAt(ind,1)
>
>
> each time I run this I get an error that the supplied index is out of bounds . How can this be? ind is always 9 (of 10 childrren)??
>
>
> thanks as always
>
>
>
>
> matt
>
>




Thu Apr 12, 2007 12:28 am

gsmithsf
Online Now Online Now
Send Email Send Email

Forward
Message #71182 of 150475 |
Expand Messages Author Sort by Date

Hi, we would like to protect our SWF files against decompile. What is the best solution ? SWF protect, Amayeta or other ??? Non free solution is acceptable....
nowak_petr
Offline Send Email
Apr 6, 2007
1:36 pm

... You can't. They must decompile in order to run :-) -- Tom Chiverton Helping to authoritatively morph killer web-readiness on:...
Tom Chiverton
tom.chiverton
Offline Send Email
Apr 11, 2007
9:26 am

Hi there all, bit of a puzzle I'm having and would be grateful for some help... container is a displayObjectContainer and objectToMove is a Display object var...
Matt Wicks
matt@...
Send Email
Apr 11, 2007
10:44 am

Hi Matt, Sounds like there's a problem with flex updating the screen before the children are swapped properly. Try validating the component after the call to...
Ciarán
parallax1313
Offline Send Email
Apr 11, 2007
11:44 am

Thanks for this - still doesn't work though ... driving me mad matt ... Thanks for this - still doesn't work though ... driving me mad matt On 11 Apr 2007, at...
Matt Wicks
matt@...
Send Email
Apr 11, 2007
12:43 pm

check the pieces of the code. What I mean by that is try: var child1 = container.getChildAt(ind)"; var child2 = container.getChildAt(1); ...
Daniel Freiman
FreimanCQ@...
Send Email
Apr 11, 2007
1:58 pm

You say your container is a DisplayObjectContainer. Is it also a Flex Container such as Canvas or VBox? If so, there is a bug with using swapChildrenAt() and...
Gordon Smith
gsmithsf
Online Now Send Email
Apr 12, 2007
12:28 am

Brilliant, thanks Gordon - not only a fix but also an explanation which is great much appreciated Matt ... Brilliant, thanks Gordon - not only a fix but also...
Matt Wicks
matt@...
Send Email
Apr 12, 2007
7:36 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help