Hak
01-28-2007, 05:07 PM
I'm a pro user of AS2, I like AS3, but Flex frameworks seems to be full of pitfalls to me.
Few questions:
1. <mx:Application ... backgroundImage="{ApplicationBackground}" >
When the application is created, say in onCreationComplete - how do I access the "backgroundImage" object that contains the image?
I want to have a click handler on the background of the application.
Also - what object "backgroundImage" transposes to - Image?
2. I'm coding my component as .as class. I have an Image, and two Labels.
How do I tell the programatically created label (var l:Label = new Label() ) to align itself to the right? Also - how do I tell it what font to use and if I want the font to be embedded or not (antialiased vs sharp)
3. Regarding component above - I'm embedding a symbol from swf, say:
[@Embed(source="../../assets/skin.swf", symbol="panelPopover")].
public var bPanel:Class;
...
img = new Image();
img.source = bPanel;
And this symbol/swf contains a background and two text fields, called _info_, and _title_. How do I access this loaded swf and how do I set value of these textfields? I tried pretty much everything in the area of
SomeType(img.content)._info_.text - and nothing!
Where is this embedded swf and what type of object it is?
How do I access its contents? Embedded symbol is exported in the first frame.
4. Now this is stupid. I'm using Canvases quite a lot, and sometimes I want Canvas to be of specified color, say red, alpha 50%.
[backgroundAlpha="0.5" backgroundColor="red"].
Superb, I have my canvas, but why the hell it covers all what's behind it?
I have no mouse handler on it or antyhing, it should be "transparent" to mouse clicks! Is Flex creating some MovieClip/Sprite/Whatever with rectangle of that red color that eats up all the mouse events?
Seems all components eat mouse events up, even if I have no mouse event handlers attached to them. How do I make them transparent and allow movieclips/displayobjects under them to receive mouse events?
Any help will be appreciated. Flex is nice, but when I try walk off the paved area, I run into trouble...
Few questions:
1. <mx:Application ... backgroundImage="{ApplicationBackground}" >
When the application is created, say in onCreationComplete - how do I access the "backgroundImage" object that contains the image?
I want to have a click handler on the background of the application.
Also - what object "backgroundImage" transposes to - Image?
2. I'm coding my component as .as class. I have an Image, and two Labels.
How do I tell the programatically created label (var l:Label = new Label() ) to align itself to the right? Also - how do I tell it what font to use and if I want the font to be embedded or not (antialiased vs sharp)
3. Regarding component above - I'm embedding a symbol from swf, say:
[@Embed(source="../../assets/skin.swf", symbol="panelPopover")].
public var bPanel:Class;
...
img = new Image();
img.source = bPanel;
And this symbol/swf contains a background and two text fields, called _info_, and _title_. How do I access this loaded swf and how do I set value of these textfields? I tried pretty much everything in the area of
SomeType(img.content)._info_.text - and nothing!
Where is this embedded swf and what type of object it is?
How do I access its contents? Embedded symbol is exported in the first frame.
4. Now this is stupid. I'm using Canvases quite a lot, and sometimes I want Canvas to be of specified color, say red, alpha 50%.
[backgroundAlpha="0.5" backgroundColor="red"].
Superb, I have my canvas, but why the hell it covers all what's behind it?
I have no mouse handler on it or antyhing, it should be "transparent" to mouse clicks! Is Flex creating some MovieClip/Sprite/Whatever with rectangle of that red color that eats up all the mouse events?
Seems all components eat mouse events up, even if I have no mouse event handlers attached to them. How do I make them transparent and allow movieclips/displayobjects under them to receive mouse events?
Any help will be appreciated. Flex is nice, but when I try walk off the paved area, I run into trouble...