Flex :: 4 AddElement Or Something Wrong With CreationComplete Event?
Aug 19, 2010
I am using the new Flex4 Spark stuff but I'm stuck at an awful problem. Let me explain a bit of the situation first. I have a container (mx:Canvas) in which I do addElement() of one type instances (DocumentWindow). The document window class is supposed to be the holder for a view according to the type of the document. The DocumentWindow class extends TitleWindow. I also have a task bar which is a mx:Canvas with buttonBar inside so that the windows should be switchable. So in 2 words I got windows holder and a taskbar. The strange thing comes now: When I put a DocumentWindow with type "doc" (which loads swf made by swftools) the window appears in the windows holder and as task on the taskbar.
But if first I open something else - DocumentWindow with type audio or video which causes the DocumentWindow to instantiate different view inside, the window doesn't appear on the screen neither a task button is being shown in the taskBar. I put a trace() on that and it shows that numElements is increasing, the taskBar ButtonBar.dataProvider.length is increased, so the things are there - just that they stay invisible until I open DocumentWindow with type 'doc'? I even tried to make DocumentWindow not to load the view inside because I thought that the only difference is the view... but then even the 'doc' typed DocumentWindow didn't show. A clue may be that creationComplete is never called until a 'doc' view is added.
[Code]...
View 1 Replies
Similar Posts:
May 16, 2011
I didn't get the difference between those two event.What is the difference between them ?
View 3 Replies
Mar 7, 2011
I tried to send some services to fetch data in the creationComplete handler. Then I need to process the server raw data before displaying some sub components. Where should I put these kind of code?
View 2 Replies
Jan 13, 2011
I have created a flex project on flash builder 4. In the MXML I have
xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init();"
And to check if it runs
[Code]...
View 2 Replies
Oct 12, 2010
I have a function that's called when a file download has reported progress:
private function progressHandler(event:ProgressEvent):void
{
var percent:Number = Math.round((event.bytesLoaded / event.bytesTotal) * 100.0);
Alert.show(event.bytesLoaded.toString());
//pb.setProgress(percent, 100);
}
Now, this should work fine but unfortunately, event.bytesLoaded is returning much larger values than it should. For a test file (8555 bytes), bytesLoaded goes all the way up to 8973384.
View 1 Replies
Apr 27, 2011
I have an issue where using MXML, the height and width properties of myBox is correctly acquired but using ActionScript the correct height and width acquired is not correct.
my:Tab extends NavigatorContent (This is NOT the tab in a Tab Bar)
com:myBox extends BorderContainer.
<mx:ViewStack id="viewstack_main" width="100%" height="100%" creationPolicy="all">
<my:Tab label="My Tab">
<s:Scroller height="100%" width="100%">
[Code] .....
In the constructor of myBox I set the percentWidth and percentHeight to both 100. In the creationComplete event of the same myBox, I need to access the height and width. This works all ok with the MXML. However using ActionScript I need to add another tab.
var navContainer:Tab = new Tab();
viewstack_main.addElement(navContainer);
var scroller:Scroller = new Scroller();
scroller.percentHeight = 100;
scroller.percentWidth = 100;
[Code] .....
But unfortunately, in the creationComplete event of box, the height and width properties are NOT what is expected (the height & width after setting 100%). It is 112. Why this works with MXML but NOT ActionScript?
View 2 Replies
Dec 2, 2010
[URL] This article seems to say that all Flex 4 elements are now being added to a project using addElement() instead of addChild(). So my only question is why the switch?
View 3 Replies
Jul 3, 2010
I have made a tile list is Adobe Flex as follows
[Code]...
the problem is the creationComplete event is not fired for each PageImageRenderer, and it is fired only for the tiles visible at start so the rectangles drawn in initComponents() is only drawn for those tiles with valid values, and when I scroll to next row using scrollToIndex() function the rectangles are shown with previous values. and no initComponents() is called for these tiles? however the data.name, data.class are correctly displayed but not the rectangles, why it is so? What is the proper event against which I should call initComponents()?
View 1 Replies
Apr 4, 2011
I'm working with a large flex applications and I have noticed that one of our largest components (with lots of child canvases) takes about 6 seconds between the initialize and creationComplete events. I've been doing some reading and have found that having lots of nested canvases can cause slowdowns, but i'm not sure if this is where the slowdowns would be?
View 3 Replies
Jul 26, 2011
I have a creationComplete="myMethod(event)" in my s:Application, and it runs fine on my 3 flex (Flash Builder 4) development machines. However it is not working on the 2 end user machines I tried it on today!
It is not executing the creationComplete at all, but it is running the application and it seems like all the other code is running fine - with the exception of possibly some other creationComplete code for other components in the app.
On my machines I have tested it under IE 8 and 9, FireFox and Chrome - on all 3 machines.
On these two machines it has the problem on both IE 7 and IE 8. I even installed FireFox new and it also has the issue. After installing the latest flash player and deleting all browser history/cookies it still has the problem.
What might cause the creationComplete to not execute?
Update: I tried using initialize() and no difference.
However, I believe I found the line of code causing the problem:
var isDebug:Boolean = new Error().getStackTrace().search(/:[0-9]+]$/m) > -1;
If I comment that out, it works fine. I need that to know if my app is running in development/debug mode or on an end users machine.
View 2 Replies
Nov 12, 2009
I have a simple component I created which I instantiate in my main program like so:[code]I receive the error "Cannot access a property or method of a null object reference" on the second line because newMessage was not fully created prior to hitting the second line of code trying to set my "body" textarea's text. I know I can build a "creationComplete" event handler, but isn't there a simpler way to do this?
View 2 Replies
Feb 2, 2011
I have a component that, once it's all ready, I need to set the state based on a variable I'm reading in from XML. I tried doing it with creationComplete, but it's apparently not ready, as the state isn't being set with elements rendering properly, but the states & rendering work fine if I do a subsequent state change with a click action on some element.
What should I do in this situation to make sure the state gets set at the right time & elements that should appear due to includeIn exist so they can be rendered? initialize instead of creationComplete doesn't seem to do the trick for the first time the component is created. Any successive calls to the component are fine.
View 3 Replies
Apr 30, 2010
I've coded this small snippet to show what I'm not understanding:
[Code]...
Shouldn't I be able to read loaderInfo inside the creationComplete handler? I'm trying to pass a string from the html to my flash component, that's why I have to get loaderInfo working.
View 1 Replies
Dec 17, 2010
In my flex application I use the viewstack.selectedchild() property to change the views.
When I revisit the views by the viewstack.selectedchild() property the initialize method doesnot get invoked..
View 5 Replies
Dec 1, 2010
Now, when I click on the button in the area where the movieclip is it will register this movieclip as event.target. I would like to make the button the event.target regardless where I click and prevent flash from registering the movieclip inside the button as the target.
View 3 Replies
Sep 8, 2011
I have a spark DataGrid component with several columns and I want to have my application default to descending order on the first column in the DataGrid. I would like to use the built-in default sort that occurs when clicking the top header once. I have no need to sort the ArrayCollection I'm working with or change what the comparators are.I also want any user-generated sorting such as clicking on a different column's header to override the default sorting.
View 1 Replies
Mar 26, 2012
I created a class in actionscritpt that extends the spark.components.Button, as I will be loading a bunch of buttons at runtime. I have a SkinnableContainer.mxml file that the spark buttons will be loaded into.When I use the addElement() method within that mxml file like so my custom skin for my button does not show.
[Code]...
View 1 Replies
Mar 26, 2012
I had this problem (Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.) and I followed the recommended solution:
// container ( IVisualElement ) for DisplayObjects
var container:UIComponent = new UIComponent();
addElement( container );
[Code].....
What I need to be able to do, is get the string Locale to be read by the Child swf.
View 1 Replies
Mar 19, 2012
I have the following Application tag code in my widget:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:local="*"
width="100%" height="100%" minWidth="200" minHeight="200" layout="absolute"
creationComplete="init()"
defaultButton="{Send_btn}">
[Code]...
View 1 Replies
Apr 16, 2011
How do I addElement() to the topGroup of a Spark Panel component skin?For instance, if I create a custom UIComponent, then create an associative skin that uses the Spark Panel as a default, how do I add elements to the topGroup from within the skin?
View 1 Replies
Nov 6, 2009
I have a List, that is not showing any items until you scroll, then the items show up. Does anyone know how to fix this? I tried calling list.invalidateDisplayList(); and list.invalidateList();
EDIT: Here is some code:
<mx:Script>
<![CDATA[
[Bindable][code]...........
I found that if I add creationComplete="{list.dataProvider = _xmlList }" It solves the problem.
View 2 Replies
Nov 9, 2009
I have write a simple example that adds a canvas and draw a rectangle with stroke size 20 scale mode none. The problem is that if I call getBounds() first time I will get a correct result but after I call scale(); the getBounds() function will give me a wrong result. It will take in cosideration the stroke but stroke has scalemode to none and on the screen nothing happens but in the result I will have a x value smaller. Can sombody tell me how can I fix this ?
[Code]....
View 1 Replies
Aug 10, 2011
When I use a descendant of the SkinnableContainer (eg BorderContainer) which itself is included or excluded in a state, the child elements in the default state appears in incorrect order. This problem disappears when using a Group instead of BorderContainer, or when the container itself is not included or excluded in a state, or when states changes forth and back. What is going on here? Am I missing something or is this a bug in Flex?
[Code]...
View 1 Replies
Jan 2, 2012
I am recording FLV videos with Red5 server and playing them back in a Flex app. I am aware that Red5 does not properly inject the FLV MetaData, so I am using an external commandline tool to get the metadata in there.
Because I am injecting the metadata, my duration of the video is correct.
The problem I am having, and this is true with all FLV players I try to play the video with (even 3rd party stand-alone video players), is the PlayHead time is never started at 0. When I load up the FLV to play and lets say the video is 10 seconds long, the current time label on the playhead starts at 1-2seconds instead of 0 and the horizontal slider current time indicator also is moved away from 0 and is set to 1-2 seconds along the slidebar. the video plays back fine from what I can see though.
Is there a byte in the FLV that I need to change so that it will start the playhead at 0? I realize this is probably something to do with Red5, so if anyone has any work-arounds or potential things to watch out for that may be causing this
View 1 Replies
Feb 22, 2010
How to I get the creationComplete function so that I can safely access swf objects? I thought going to the parent of all (the stage?) would work..I have tried unsuccesfullly to use :
stage.addEventListener(Event.COMPLETE, myCheckComplete);
but am having problems.
View 4 Replies
Feb 9, 2010
I have a List component using multiple item renderers determined by the itemRendererFunction. When I set the data the first time, it works as expected. Then, when I set the data a second time with new data, it doesn't call the itemRendererFunction and tries to reuse the current renderers even though they don't match the data.Once I scroll, the function is called and the correct renderers are used. I tried calling invalidateDisplayList and such prior to setting the data, but that didn't fix the problem.
View 3 Replies
Jan 4, 2012
I want to draw a squiggle line below misspelled word in a Flex Spark RichEditableText component.
View 1 Replies
Apr 12, 2011
I have editable grids which are 2-way binded to my model. What I want is to validate my data when user edits any cell before it get updated in model. I have applied my validation at ItemEditEnd handler, but, I want to apply validation in between itemEditBegin and itemEditEnd events.
View 1 Replies
Nov 5, 2009
If you have two textareas, one has a rotation value besides 0 and the other has no rotation value or a value of 0 and you 'tab' focus from the one w/rotation to the one w/out. The border around the textArea w/out rotation will be rotated. If you set the rotation value of the non-rotated text field to a non-zero number, even 0.01, it fixes the problem, this causes tons of other problems in text rendering though so its not a solution.
I found setting the focusThickness style to 0 removes the border, which is a good solution but not a great one, anybody got a better one? Here is some sample code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:VBox width="100%" height="100%">
<mx:TextArea id="source" width="100%" fontWeight="bold" fontSize="20" height="50" rotation="5" />
<mx:TextArea id="dest" width="100%" height="50" />
</mx:VBox>
View 1 Replies
Feb 25, 2011
Is it possible to create wrong Regular expression in ActionScript/Flex which will cause runtime error? I've tried so many weird regexpes in Flex and Flex never complained! How do I know If my regexp valid?
View 3 Replies