flex4

flex 4 swfloader: SWFLoader.content.stage.width and height returns the main stage width and height

Hiya. When I load a flash application using SWFLoader, the Stage width and height of the loaded application becomes the stage of the main flex application. so if i created a game that uses stage width and height to calculate where to draw, it actually draws outside of the bounds of the loaded application stage because it gets the width ...

Flex 4: How to get actual width of a group when using 100% and top/bottom/left/right?

I have an application with width/height of 100%. I have several nested groups within and their measurements are all not set, instead being defined as top=5 or left/right=10, etc. I'm trying to get the actual with of a group that should be 390. I've set the swf object size to be 400 from the html embed code, and the group is inside ano...

Flex 4: How to override the default button functionality in a skin class?

I have a videoplayer with a custom skin class. I want to override the functionality of the fullscreen button. When I add an click event, the player still goes into fullscreen mode. How can I prevent the fullscreen event from firing? ...

flex display issue , adding a simple graphic to display weirdness

For some reason same function called from another class acts differently, if function called from ini() then it adds the button to the display and we can see it. If we call the same function externally then it adds the button just that we cant see it....what do I need to do to fix this ?? <fx:Script> <![CDATA[ imp...

Proper MXML Class Factory

I would really like to be able to write something like the following: <magical:ClassFactory id="factory"> <some:UIComponentOrWhatever with_event="handlers(event)" event_snippets="like.so()" code_values="{ foo + ' ' + bar }" bound_values="{bindabl...

Flex 4: Can I animate multiple objects within the same parallel?

I have multiple spinning balls that I want to animate altogether. Here's what I have so far but when I play the parallel (spinning.play()), nothing happens. Where am I going wrong? <fx:Declarations> <fx:Vector id="kfP1" type="spark.effects.animation.MotionPath"> <s:MotionPath property="baseColor"> ...

Resizing Flex spark control with a custom skin

Hi, I have made a custom skin for TextInput spark control in Catalyst. The problem is that in Flash Builder's design view I can't resize TextInput control with applied custom skin. I want to be able to adjust only TextInput's length keeping the same font metrics and proportions of the skin, so I can use the same skin for short, medium,...

Accessing itemRenderer instance flash buiilder 4

My setup is pretty basic. I have an s:List with a custom itemRenderer and a dataprovider. What I would like to do is access the generated instances of the item renderer but I have no idea how. Here is the code for the list: <s:List id="layersList" borderVisible="false" allowMultipleSelection="true" ...

Flex's FileReference.save() can only be called in a user event handler -- how can I get around this?

I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an ...

custom MXML container in Flex 4

I want to make a custom container, usable in MXML like: <local:MyContainer> <s:Label/> <s:Button/> ... </local:MyContainer> ...but I'd like to be able to catch when the children are added so that I can control stuff like when & where they're added. I tried overriding addChild(), addChildAt(), addElement(), addElementAt(), (exte...

Accessing scrollbar in a group component Flex 4

This is the setup. I have created a timeline with a playhead. When my playhead is dragged I would like the timeline to scroll with the drag. So far, the only way I can do this is by setting clipAndEnableScrolling to true. But in this case I lose the scrollbars(not to mention the impact on my view). So what I would like is to set this pr...

How to implement custom container with separators in Flex 4?

I want to implement custom HDividedBox using Flex 4 API. Splitter should be dynamic skin part. I can't find any examples of controls where skin parts position should be calculated depending on the number of children and their sizes. Seems like this kind of controls does not fit into the standard Flex 4 model: Skin, Control, Layout. Can s...

How to close x number of popups one by one according to their visiblity?

Hi, Lets suppose, there are 4 popups in my application and a viewer presses Escape once. Now i want application to close the popup which is on the top. I dont know how to accompish this because i dont know thich popup is to the front right now. Regards Max ...

flex 4: creating a group that slides off stage during fullsize mode

I have no problems getting this to work in smaller sizes, but as soon as the application goes to full screen it throws off all of the layout. Any suggestions? here's the effects (stageWidth is updated on resize and I've checked that it contains the correct value). <s:Bounce id="bounceEasing"/> <s:Parallel id="panelIn"> ...

Flex 4 Application Skin - Create Footer

Hi, I'm trying to create a skin for my Application in Flex 4. I started with editing the Application wireframe skin found at /flex4-sdk-folder/frameworks/projects/wireframe/src/spark/skins/wireframe/ I need a skin upon applying should provide a header, content area and a footer. I set the controlBar visible in the normal state so that...

mixing flex 4 gui components with papervision3d

I'd like to mix papervision rendering (either "fullscreen" or constrained in some area) with flex gui components laying over that rendering.. how could this be achieved? For now I can design .mxml templates at hand and do some papervision rendering in a separate .as file (definig [SWF ...]), but I'm still very new at as3/flex, so don't ...

Display HTML text in the Spark TextArea

The Below code is running well... <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" > <fx:Declarations> <mx:HTTPService id="httpRSS" url="http://www.petefreitag.com/rss/" resultFormat="objec...

How do I get the visual width and height of a rotated component?

I'm playing around with code like this: <s:Button id="test" label="test" transformX="{Math.floor(test.width/2)}" rotationY="20" x="20" y="20" /> The button is rotated on the Y axis and the rotate pivot is in the middle of the button. This will create a button that looks something like this: The rotated button is, visually, filling...

Flex 4 lifecycle and drawing stuff manually

I have a component which inherrits Group. I made a property called dataSource:ArrayList. I wish to draw a Line for each of the entries. When the 'function set dataSource' -method is invoked I do the following (simplified): var newLine:Line = new Line(); newLine.stroke = new SolidColorStroke(); newLine.xFro...

How to search a string within a flex datagrid dataProvider 4?

Hello friends, I tried using filterFunction not get any results, check out this example: [Bindable] public var SearchLoadlistOneDP:ArrayCollection; public function SearchList():void { SearchLoadlistOneDP.filterFunction = filter; SearchLoadlistOneDP.refresh() } public function filter(item:Object):Boolean { var beginsWithStrin...