views:

27

answers:

1

How can I hide a component and what AS3 code to use to hide a Flex Component from an external swf file?

A: 

I don't understand what you mean by hiding.

You can hide a component from visual display using the visible property on the component. I believe this is is imp,implemened in UIComponent and all Flex Components should be able to access this.

Once a component is added to it's parent, it can never be completely hidden. But, if you create it as a private variable in ActionScript; it'll make it hard to access the data.

Two Independent SWFs generally have no access to code inside the other unless you have set up a localconnection or are loading one SWF inside the other.

www.Flextras.com
Well the SWF movie is loaded inside of the Flex project (SWFLoader). I just don't know how to access FLEX components from a standalone but imbedded SWF.
Yan
and hide is like normally I do in AS3: image.visible=false;just don't know how to access flex properties
Yan
If your 'loaded swf' components are exposed as public properties you can access them using instructions here: http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
www.Flextras.com
you have any example on how to hide "<mx:Image..." component?
Yan
Set the visible and includateInLayout properties to false; use the instructions I linked to before to modify those properties inside a loaded swf. Or you can give me a call at http://www.asktheflexpert.com and we can work through it together.
www.Flextras.com
These are the 2 SWF files which are created in Flex by following your link, but I'm creating mine in Flash Professional...
Yan
LocalConnection is a Flash class; so you should be able to use it without any issues in Flash Pro.
www.Flextras.com