Search Results

Search found 338 results on 14 pages for 'mxml'.

Page 13/14 | < Previous Page | 9 10 11 12 13 14  | Next Page >

  • Resizing a container when child's visibility is changed?

    - by deux11
    When I set the visible property to false for a child in a container, how can I get the container to resize? In the example bellow, when clicking on "Toggle", "containerB" is hidden, but the main container's scrollable area is not resized. (I do not want to scroll through a lot of empty space.) <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ public function toggle():void { containerB.visible = !containerB.visible; } ]]> </mx:Script> <mx:VBox height="300" width="200" horizontalAlign="center"> <mx:Button label="Toggle" click="toggle()" width="200"/> <mx:VBox id="containerA" height="400" width="150" horizontalAlign="center"> <mx:Button label="A" height="400" width="100"/> </mx:VBox> <mx:VBox id="containerB" height="400" width="150" horizontalAlign="center"> <mx:Button label="B" height="400" width="100"/> </mx:VBox> </mx:VBox>

    Read the article

  • Web service actionscript error

    - by H P
    Hello, I am new to Flex and needed some help setting up Web service client. I have a web service of method: public String printEchoStr(String str); I am facing problem while creating action script to call this service. I am getting error: 1067: Implicit coercion of a value of type String to an unrelated type generated.webservices:PrintEcho. I am not sure if this is the correct way. Thanks, -H <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:srv="generated.webservices.*" creationComplete="initFunc()"> <mx:Script> <![CDATA[ import generated.webservices.EchoService; import generated.webservices.PrintEchoStrResultEvent; import generated.webservices.PrintEchoResultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import generated.webservices.PrintEchoStr; import generated.webservices.PrintEcho; public var myService:EchoService = new EchoService(); private function initFunc():void{ myService.addprintEchoStrEventListener(argPrintEchoStr); /*-------------- 1067: Implicit coercion of a value of type String to an unrelated type generated.webservices:PrintEcho. at line below ----------------*/ myService.printEchoStr(textAreaPrintEchoStr.text); myService.addEventListener(FaultEvent.FAULT,myServices_faultHandler); } public function argPrintEchoStr(event:PrintEchoStrResultEvent):void{ trace(event.result); } private function myServices_faultHandler(event:FaultEvent):void { Alert.show(event.fault.faultString,"error with WebServices"); } ]]> </mx:Script> <mx:TextArea id ="textAreaPrintEchoStr" x="81" y="125"/> </mx:Application>

    Read the article

  • How to parse XML to flex Data Grid contents.

    - by Jeeva
    My xml file which is in a webserver is show below. <root> <userdetails> <username>raja</username> <status>offline</status> </userdetails> <userdetails> <username>Test</username> <status>online</status> </userdetails> </root> How can i parse this to flex data grid contents. I tried with below coding < ?xml version="1.0" encoding="utf-8"? < mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" < mx:HTTPService id="userList" result="handleData(event)" resultFormat="object" url="http://apps.facebook.com/ajparkin/user_list.xml" / <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.controls.Alert; public function initApp():void { userList.send(); } [Bindable] var userdetailsArray:ArrayCollection; private function handleData(evt:ResultEvent):void { this.userdetailsArray= evt.result.userdetails; } ]]> </mx:Script> <mx:DataGrid dataProvider="{userdetailsArray}"> <mx:columns> <mx:DataGridColumn dataField="username" headerText="User Name"/> <mx:DataGridColumn dataField="status" headerText="Status" /> </mx:columns> </mx:DataGrid> </mx:Application> I'm getting only the field names not the data.

    Read the article

  • I am trying to add a link on an Image

    - by firemonkey
    Hi, I am trying to add a link to an image using ActionScript. I do not see the link no matter what. Below is my code, Can you please suggest what am I doing wrong. <?xml version="1.0" encoding="utf-8"?> <mx:Application creationComplete="application1_creationCompleteHandler(event)" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"> <mx:Script> <![CDATA[ import mx.controls.Button; import mx.controls.Image; import mx.events.FlexEvent; protected function application1_creationCompleteHandler(event:FlexEvent):void { var but:Button = new Button(); but.label = "BUT"; uic.addChild(but); var dollLoader:Loader=new Loader(); dollLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dollCompleteHandler); var dollRequest:URLRequest = new URLRequest("http://www.google.com/intl/en_ALL/images/logo.gif"); dollLoader.load(dollRequest); uic.addChild(dollLoader); } private function dollCompleteHandler(event:Event):void { } ]]> </mx:Script> <mx:UIComponent id="uic" width="100%" height="100%"> </mx:UIComponent> </mx:Application>

    Read the article

  • How to properly set button phase after dragging over button?

    - by irobeth
    I have a class (mxml) that extends Button while implementing drag/drop support. When I drag one of them onto another, the drag receiver stays stuck in its 'over' phase until I click on it (As if something about DragManager.acceptDragDrop is preventing the MouseEvent from getting to button) Is there a way to make a button re-evaluate its phase after the drop? I've tried fabricating a MouseEvent and sending it to rollOverHandler with no luck. This resembles the scenario in Button.as (lines 2606-2647) described like Drag over and up mouse down while out of Button roll over Button - stay in "up" phase mouse up while over Button - "over" phase continue with step 2 of first three sequences above This is my drag/drop handler private function dragDropHandler(event:DragEvent):void { trace("dropped"); var ib : IconButton = (event.dragInitiator as IconButton); if(this.data is Section) { if(ib.data is Item) { trace("ITEM"); //move an item into a section. var ae : AldonaEvent = new AldonaEvent(AldonaEvent.MOVE); ae.data = ib.data; dispatchEvent(ae); } else if(ib.data is Section) { trace("SECTION"); //change a section's parent. var ae : AldonaEvent = new AldonaEvent(AldonaEvent.MOVE); ae.data = ib.data; dispatchEvent(ae); } } //you can only drag stuff into sections. }

    Read the article

  • Center label instance inside VGroup in Flex

    - by Jerry
    Hi all I am trying to center my labels below my image inside my VGroup. The labels are align to left now and it seems like HorizontalAlign is not working on spark component. Anyone knows how to fix it? Thanks a lot. <?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" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:VGroup width="800"> <mx:Image source="images/big/city1.jpg"/> <s:Label text="test1" horizontalCenter="0" /> //doesn't work....:( <s:Label text="test2" /> </s:VGroup> </s:Application>

    Read the article

  • Flex: Method doesn't work when being called on parentDocument

    - by ChrisInCambo
    Hi, I wonder is anyone can look at this code and tell me why calling the removeSelectedChild works when called from the same document, but returns the following error when called from the child document/component. "ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller." <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Accordion id="myAccordion" width="100%" height="100%" selectedIndex="0"> <mx:Script> <![CDATA[ public function removeSelectedChild():void { myAccordion.removeChild(myAccordion.selectedChild); } ]]> </mx:Script> <mx:headerRenderer> <mx:Component> <mx:Button click="{ parentDocument.removeSelectedChild() }" /> </mx:Component> </mx:headerRenderer> <mx:HBox> <mx:Button click="{ removeSelectedChild() }" /> </mx:HBox> </mx:Accordion> </mx:Application> Clicking on the button in the child produces the expected result, whilst clicking on the header throws an error despite the fact they both call exactly the same method. Sorry that the example is a little contrived, this problem arose in a quite complicated view, which was using all kinds of custom components. This was the only way I could display it in a way that will be quick for you to compile and easy to focus on the real issue without background noise. I'm pulling my hair out on this one and would really appreciate it if anyone could help. Cheers, Chris

    Read the article

  • flex 4 release changes to application are not showing up.

    - by guacamoly
    I just took over a clients flex project and I can't get the app to reflect even a simple trace statement. Before I took over, the project was last successfully built using the Flash Builder Beta 2 environment/sdk. I have the latest release version of Flash Builder 4. Upon importing the project into FB4, I got a ton of errors. Most of them mostly because of the changes made to the sdk from beta2 to release. Some of the things I corrected: - mx namespace from library://ns.adobe.com/flex/halo to library://ns.adobe.com/flex/mx - video player skinning: a lot of the state names for the video player component had been changed, more required states had been added. also there were other video related component and property names that had to be updated. But I fixed all that and the application was finally able to compile (although with some warnings mostly of the duplicate variable type) The only thing now is that whatever change I make to the project doesn't get reflected in the build (debug or release). I changed existing traces, added additional traces. Nothing shows up. I even removed the applicationComplete property in the main.mxml. Everything still ran like nothing changed. Also I can't seem to debug the app. Whenever I try to debug.. flash builder says.. "Swf Application doesn't contain the required debugging information ... " Anyone have any idea how I need to even begin tackling all this? Any help or pointers would be greatly appreciated.

    Read the article

  • How to add/get Sprite to/from UIComponent

    - by user955399
    How to add Sprite to BorderContainer (UIComponent)? var sprite:Sprite = new Sprite(); sprite.graphics.lineStyle(10,0); sprite.graphics.moveTo(40,40); sprite.graphics.lineTo(60,60); mybordercontainer.addChild(sprite); //mybrodercontainer is id of BorderContainer created in mxml This code doesnt work. I cant see Sprite on my BorderContainer. How can I add Sprites on UIComponents, so I can see them? I tried this and it kinda worked: var comp:UIComponent = new UIComponent(); comp.addChild(sprite); myborderconteiner.addElement(comp); But I dont think, that this is a right way to add Sprites to UIComponents. Is there another method to do that? Second problem: When I have few Sprites added to my UIComponent (lines/circles/images or others) how can I receive an object Sprite from that UIComponent, which is containing all Sprites added before to that UIComponent? I need to create Bitmap from that Sprite and do some things. I hope I make myself clear

    Read the article

  • Fastest way to learn Flex and Java EE?

    - by LostWebNewbie
    Ok so me and my 2 friends have to make a webapp and well we think it's a good opportunity to learn JEE and Flex. The thing is we have very little knowledge about them and we have only 3 months to do it (it doesn't have to be super complicated). So my question is: what, in your opinion, would be the fastest way to learn them both? I guess we need to know some JSP, Serlvets, JPA (??), Flex, maybe JavaScript+CSS? Anything else like EJB? Should we also learn Spring (or Struts)? Obviously reading books would be a good idea, but I bet we won't make the deadline if we try to read all the books... @Edit: I know the basics of JSP/Servlets (read Head First JSP&Servlets) but I made only 1 project so far (a semi-decent hangman with JSP/Serlvets and JPA for persistance) that's about it. Flex - I'm just starting, I know really the basics of mxml and as3. As for why: 1) because we need to do a project for the uni and well I was thinking bout becoming a web dev (yup - jee+flex) after graduation, this is the perfect opportunity to learn them.

    Read the article

  • Not Understanding Basics Of Dynamic DataBinding (bindPropety) In Flex

    - by Joshua
    I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change. I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty. Can someone please help me understand what I'm missing? <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" xmlns:ns2="*" creationComplete="Init();"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.binding.utils.*; public var Available:ArrayCollection=new ArrayCollection(); public function get Value():String { return (Available.getItemAt(0).toString()); } public function Init():void { Available.addItemAt('Before', 0); BindingUtils.bindProperty(Lab, 'text', this, 'Value'); } public function Test():void { Available.setItemAt('After', 0); } ]]> </mx:Script> <mx:Label x="142" y="51" id="Lab"/> <mx:Button x="142" y="157" label="Button" click="Test();"/> </mx:WindowedApplication> Thanks in advance.

    Read the article

  • FLEX: how to better align my Tile component to the puppet (and how to solve roll over out effects) ?

    - by Patrick
    hi, At the moment my Puppets are larger on the left if I add them the <mx:Tile> component (with tags): http://dl.dropbox.com/u/72686/puppets.png how can I move my Tile component to the right ? In order to align with the left border of my puppets ? <mx:Tile id="tagsPopup" width="200" visible="false" > <mx:LinkButton label="Tag1" /> <mx:LinkButton label="Tag2" /> <mx:LinkButton label="Tag3" /> <mx:LinkButton label="Tag4" /> </mx:Tile> <mx:VBox verticalGap="0"> <mx:Image id="puppet" source="@Embed(source='../icons/userIcon.png')" /> <mx:Label id="username" text="Nickname" visible="false" fontWeight="bold" /> </mx:VBox> 2nd Question: I want to add objects on top of the puppets, some of them are visible only when the mouse is over, and they are overlying the ones are permanently visible. How do you suggest to implement it ? I was thinking to add in MXML all visible elements and then use Actionscript to add the fade in fade out components. However I just realize it is quite tricky, because I want the user select for example tag1, tag2 and tag3, with the mouse. Instead now they disappear when the mouse rolls out from the puppet image. Any guideline ? thanks

    Read the article

  • trouble with custom 'Text Bubble' component (examples included)

    - by gmoniey
    I'm trying to use a custom Text component to show a series of comments. I got the original idea from: http://www.eonflex.com/?p=40 I've got the base case working but I am stuck with 2 problems I cant seem to figure out: Since I am drawing around the text, the actual height of each bubble is greater than that of the Text field, as a result, the last bubble is always chopped off. I have tried explicitly overriding the height getter, and adding some padding, but I cant seem to get it right. You can see an example here: http://test.lambandtunafish.com/bubbles/CommentTest.swf In my layout, I have 2 VBoxes (one nested inside the other). The first vbox shows a form where the user can enter a comment, and the second box has all the comments. In order to ensure that the scrollbars only show up on the second box, I set minHeight="0" on the nested VBox, but then for some reason, some comments' text is shifted to the right. You can see an example here (look at the first comment): http://test.lambandtunafish.com/bubbles/CommentTest-minHeight.swf Rather than posting the code here, I've provided some links: Container: http://test.lambandtunafish.com/bubbles/CommentTest.mxml Bubble: http://test.lambandtunafish.com/bubbles/CommentBubble.as If anyone has any ideas, I would appreciate it. Thanks!

    Read the article

  • Why does the roll_out event fire in this code?

    - by user339681
    I have made this simple example to demonstrate some problems I'm having. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas id="buttonCanvas" x="100" y="100" opaqueBackground="#000000" width="80%" height="300" creationComplete="init(event)"> <mx:Button x="5" y="5"/> <mx:Button x="5" y="50"/> </mx:Canvas> <mx:Script> <![CDATA[ private function init(event:Event):void{ buttonCanvas.addEventListener(MouseEvent.ROLL_OUT, function(event:Event):void{ buttonCanvas.opaqueBackground=(buttonCanvas.opaqueBackground==0)? 0x666666:0; }); } ]]> </mx:Script> </mx:Application> I don't understand the following: Why doesn't the percentage nor absolute dimensions affect the canvas? Why does the roll_out event fire when the mouse leaves a button (even when it is still inside the canvas). I'm going nuts trying to figure this out. Any help would be greatly appreciated!

    Read the article

  • Trouble managing events in Flex/actionscript

    - by Zaka
    Hello all, I'm doing some newbie tests, so I decided to capture the keyboard events to move a rectangle. But I don't get the desired result. Unless I click on the TextArea box, I'm not able to capture the event key code. After that, all goes pretty well. I'm using Eclipse 3.3 + Flex 3.0 on Linux. Here's my code: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" enterFrame="enterFrame(event)" keyDown="onKeyDown(event)"> <mx:TextArea id="myText" x="200" y="200" width="100" height="100" /> <mx:Canvas id="myCanvas" x="0" y="0" width="100" height="100" /> <mx:Script> <![CDATA[ public var clearColor : uint = 0xFF456798; public var myPoint : Point = new Point(0,0); public function enterFrame(event:Event):void { myCanvas.graphics.clear(); myCanvas.graphics.beginFill(0xFF344ff0); myCanvas.graphics.drawRect(myPoint.x,myPoint.y,40,40); myCanvas.graphics.endFill(); } public function onKeyDown(event:KeyboardEvent):void { myText.text = "Keycode is: " + event.keyCode + "\n"; switch(event.keyCode) { case 37: //Left myPoint.x -= 1; break; case 38: //Up myPoint.y -= 1; break; case 39: //Right myPoint.x += 1; break; case 40: //Down myPoint.y += 1; break; } } ]]> </mx:Script> </mx:Application>

    Read the article

  • flex using tweenmax library

    - by Nishant
    Hello, I am currently using flex transition effects on state change. Is there a way I can use tweenmax library for that? Update: In the code below, I have transitions from state one to state two. I would like to replace that code tweenermax library. <?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" minWidth="955" minHeight="600"> <s:states> <s:State name="one" /> <s:State name="two" /> </s:states> <s:transitions> <s:Transition fromState="one" toState="two"> <s:Parallel targets="{one, two}"> <s:Fade /> </s:Parallel> </s:Transition> <s:Transition fromState="two" toState="one"> <s:Parallel targets="{one, two}"> <s:Fade /> </s:Parallel> </s:Transition> </s:transitions> <component:one id="one" /> <component:one id="two" /> </s:Application>

    Read the article

  • How do I set the dimensions of a custom component defined in an ActionScript class?

    - by user339681
    I'm trying to set the height of a vertical bar (activityBar) but it does not appear to do anything. i have tried something similar with the whole component, but setting the dimensions does nothing (even in the mxml used to instantiate the class). Indeed, I've added transparent graphics just to give the component some dimensions I'm not sure what I'm doing wrong. It's something bad though; my approach seems dire. FYI: I'm trying to create a mic activity bar that will respond to the mic by simply setting the height of the activityBar child (which seems to me to be more efficient than redrawing the graphics each time). Thanks for your help! package components { import mx.core.UIComponent; public class MicActivityBar extends UIComponent { public var activityBar:UIComponent; // Constructor public function MicActivityBar() { super(); this.opaqueBackground = 0xcc4444; graphics.beginFill(0xcccccc, 0); graphics.drawRect(0,-15,5,30); graphics.endFill();// background for bar activityBar = new UIComponent(); activityBar.graphics.beginFill(0xcccccc, 0.8); activityBar.graphics.drawRect(0,-15,5,20); activityBar.graphics.endFill(); activityBar.height=10; addChild(activityBar); } } }

    Read the article

  • How can I force a tree itemrenderer to redraw during a drag and drop operation?

    - by swidnikk
    I have a tree control with a custom item renderer. The item renderer has different states that should be set while an item is being dragged over the item renderer. I understand from reading this post http://forums.adobe.com/message/2091088 that the 'right way' to do this is to override the 'getCurrentState' method and append some text. I do that. Now in my tree control I handle the drag over event and get a reference to the itemrenderer that is being dragged over and I set the boolean 'dragOver' property to true. Now I just need to force my itemRenderer to redraw. I can't figure that out. A workaround, is to just set the currentState of the itemRenderer. My question then, how can I force my itemRenderer to refresh? (and I've tried calling validateNow, invalideDisplayList/Properties/Size, to no avail) <?xml version="1.0" encoding="utf-8"?> <s:MXTreeItemRenderer 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:Script> <![CDATA[ import mx.events.DragEvent; import mx.events.FlexEvent; import spark.layouts.supportClasses.DropLocation; public var dragOver:Boolean = false; override protected function getCurrentRendererState():String { var skinState:String = super.getCurrentRendererState(); if( dragOver ) skinState += "AndDragOver"; trace('getCurrentRendererState', skinState); return skinState; } ]]> </fx:Script> <s:states> <s:State name="normal" /> <s:State name="hovered" /> <s:State name="selected" /> <s:State name="normalAndDragOver" stateGroups="dragOverGroup" /> <s:State name="hoveredAndDragOver" stateGroups="dragOverGroup" /> <s:State name="selectedAndDragOver" stateGroups="dragOverGroup" /> </s:states> ...

    Read the article

  • Can't interact with children of an itemRenderer in Flex 4 Gumbo

    - by BlueDude
    I thought this would be pretty easy but I'm running into all sorts of problems with this. I have an ItemRenderer with a an image and two labels. I want to assign separate mouse events to the image and two labels. It seems like the item renderer is treated like a single interactive piece and I haven't found a way to override that. I couldn't even disable the default rollover effect so I had to style the rollOverColor to match my background. Can anyone provide a solution? <s:DataGroup id="browserDataGroup" dataProvider="{model.userBoardList}" verticalCenter="0" left="10" rollOverColor="0x424242" itemRenderer="edu.xxxxx.components.board.BrowserItemRenderer"> <!--itemrenderer code below --> <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:ns="library://ns.adobe.com/flex/mx" buttonMode="true" useHandCursor="true" mouseChildren="true"> <s:states> <s:State name="up"/> <s:State name="over"/> </s:states> <s:layout> <s:VerticalLayout gap="2"/> </s:layout> <s:Group> <ns:Image id="image" source="{data.thumbnail}" addedEffect="Fade" completeEffect="Fade" removedEffect="Fade" width="130" height="89" horizontalCenter="0" verticalCenter="0"/> <s:Rect id="imageRect" width="130" height="89"> <s:stroke> <s:SolidColorStroke color="0xFFFFFF" joints="miter" pixelHinting="true"/> </s:stroke> </s:Rect> </s:Group> <s:Label text="{data.title}" color="0xFFFFFF" fontWeight="bold"/> <s:Group> <s:layout> <s:HorizontalLayout gap="3"/> </s:layout> <s:Label text="Edit" color="0xFFFFFF" click="trace('edit');" textDecoration.up="underline" textDecoration.over="none"/> <s:Label text="|" color="0xFFFFFF"/> <s:Label text="Delete" color="0xFFFFFF" click="trace('delete');" textDecoration.up="underline" textDecoration.over="none"/> </s:Group> </s:ItemRenderer>

    Read the article

  • Flex 4 IntelliJ IDEA wrapper html crashes browser

    - by user347641
    I'm building an Flex 4 application using IntelliJ IDEA generated sample Flex application. I replace the mxml with the following code from the book Hello Flex 4. It simply crashes the browser when I run it. I tried it on both FF and Chrome. Any clues? [Bindable] public var _bread:Number = Number.NaN; ]]></fx:Script> <fx:Declarations> <s:RadioButtonGroup id="moralityRBG"/> <s:RadioButtonGroup id="restaurantRBG" selectedValue="{_theory.length % 2 == 0 ? 'smoking' : 'non'}"/> </fx:Declarations> <s:Panel width="100%" height="100%" title="Simple Components!"> <s:layout> <s:HorizontalLayout paddingLeft="5" paddingTop="5"/> </s:layout> <s:VGroup> <s:TextArea id="textArea" width="200" height="50" text="@{_theory}"/> <s:TextInput id="textInput" width="200" text="@{_theory}"/> <s:HSlider id="hSlider" minimum="0" maximum="11" liveDragging="true" width="200" value="@{_bread}"/> <s:VSlider id="vSlider" minimum="0" maximum="11" liveDragging="true" height="50" value="@{_bread}"/> <s:Button label="{_theory}" width="200" color="{alarmTB.selected ? 0xFF0000 : 0}" click="_bread = Math.min(_theory.length, 11)"/> <s:CheckBox id="checkBox" selected="{_bread % 2 == 0}" label="even?"/> </s:VGroup> <s:VGroup> <s:RadioButton label="Good" value="good" group="{moralityRBG}"/> <s:RadioButton label="Evil" value="evil" group="{moralityRBG}"/> <s:RadioButton label="Beyond" value="beyond" group="{moralityRBG}"/> <s:RadioButton label="Smoking" value="smoking" group="{restaurantRBG}"/> <s:RadioButton label="Non-Smoking" value="non" group="{restaurantRBG}"/> <s:ToggleButton id="alarmTB" label="ALARM!"/> <s:NumericStepper id="numericStepper" value="@{_bread}" minimum="0" maximum="11" stepSize="1"/> <s:Spinner id="spinner" value="@{_bread}" minimum="0" maximum="11" stepSize="1"/> </s:VGroup> </s:Panel>

    Read the article

  • Flex Spark DropDownList selectedItem didn't update after dataProvider changed

    - by Candy Chiu
    I have two dataProvider's for one DropDownList. The following code can be compiled and run. <?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" creationComplete="flipLast()" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; public function flipLast():void { if( last ) { list.dataProvider = dp1; list.selectedItem = "Flex"; } else { list.dataProvider = dp2; list.selectedItem = "Catalyst"; } last = !last; } public var last:Boolean = true; public var dp1:ArrayCollection = new ArrayCollection( [ "Flex", "Air" ] ); public var dp2:ArrayCollection = new ArrayCollection( [ "Catalyst", "FlashBuilder" ] ); ]]> </fx:Script> <s:VGroup> <s:DropDownList id="list" requireSelection="true" /> <s:Label id="listSelectedItem" text="{list.selectedItem}" /> <s:Label id="listSelectedIndex" text="{list.selectedIndex}" /> <s:Button label="Flip" click="flipLast()" /> </s:VGroup> </s:Application> Scenario 1: dataProvider updated, but selectedIndex is the same. At startup: [ listSelectedItem=Flex, listSelectedIndex=1 ]. Click Flip: dataProvider is updated, but still [ listSelectedItem=Flex, listSelectedIndex=1 ]. Scenario 2: dataProvider updated, selectedIndex is also updated. At startup: [ listSelectedItem=Flex, listSelectedIndex=1 ]. Select Air from list: [ listSelectedItem=Air, listSelectedIndex=2 ]. Click Flip: dataProvider is updated, but still [ listSelectedItem=Catalyst, listSelectedIndex=1 ]. Seems to me that selectedItem is driven by selectedIndex. selectedItem updates only when selectedIndex updates. Shouldn't selectedItem be updated when dataProvider is updated? Is binding to selectedItem flawed?

    Read the article

  • E4X in ActionScript help needed

    - by voipsecuritydigest.com
    Here is the XML How using E4X read values of nodes <status>??</status> and of node <invisible value="false"/> ? <?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" creationComplete="init()"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ var xml:XML = <iq type="result" id="ss-1"> <query status-min-ver="1" status-max="512" status-list-contents-max="5" status-list-max="3" xmlns="google:shared-status"> <status> ?? </status> <show> default </show> <status-list show="default"> <status> ?? </status> <status> ? </status> <status> ?? </status> </status-list> <status-list show="dnd"> <status> ?? </status> <status> dnd, i have bad mood </status> <status> showering </status> <status> ??_???¦ </status> <status> ? </status> </status-list> <invisible value="false"/> </query> </iq> public function init() { trace(xml.query.invisible.@value); } ]]> </fx:Script> </s:Application>

    Read the article

  • Flex/Air/AS3 Selecting and Populating a unFocused tab.

    - by Deyon
    I'm having a problem displaying data from a function to text box within a tab. If you run the code and click "Select Tab 2 and Fill..." I get an error; "TypeError: Error #1009: Cannot access a property or method of a null object reference." I'm guessing this is because "Tab 2" is/was not rendered yet. Now if I run the code, select "Tab 2" then select "Tab 1" and click "Select Tab 2 and Fill..." it works the way I would like. Dose any one know a way around this problem. ----Full Flex 4/Flash Builder Code just copy paste---- <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" creationComplete=" "> <fx:Script> <![CDATA[ public function showtab2():void { mytextbox.text="I made it!"; tn.selectedIndex=1; } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <mx:Panel title="TabNavigator Container Example" height="90%" width="90%" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> <mx:Label width="100%" color="blue" text="Select the tabs to change the panel."/> <mx:TabNavigator id="tn" width="100%" height="100%"> <!-- Define each panel using a VBox container. --> <mx:VBox label="Panel 1"> <mx:Label text="TabNavigator container panel 1"/> <mx:Button label="Select Tab 2 and Fill with Text" click="showtab2()"/> </mx:VBox> <mx:VBox label="Panel 2"> <mx:Label text="TabNavigator container panel 2"/> <s:TextInput id="mytextbox" /> </mx:VBox> </mx:TabNavigator> <mx:HBox> </mx:HBox> </mx:Panel> </s:WindowedApplication>

    Read the article

  • Selecting and Populating a unFocused tab.

    - by Deyon
    I'm having a problem displaying data from a function to text box within a tab. If you run the code and click "Select Tab 2 and Fill..." I get an error; "TypeError: Error #1009: Cannot access a property or method of a null object reference." I'm guessing this is because "Tab 2" is/was not rendered yet. Now if I run the code, select "Tab 2" then select "Tab 1" and click "Select Tab 2 and Fill..." it works the way I would like. Dose any one know a way around this problem. ----Full Flex 4/Flash Builder Code just copy paste---- <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" creationComplete=" "> <fx:Script> <![CDATA[ public function showtab2():void { mytextbox.text="I made it!"; tn.selectedIndex=1; } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <mx:Panel title="TabNavigator Container Example" height="90%" width="90%" paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> <mx:Label width="100%" color="blue" text="Select the tabs to change the panel."/> <mx:TabNavigator id="tn" width="100%" height="100%"> <!-- Define each panel using a VBox container. --> <mx:VBox label="Panel 1"> <mx:Label text="TabNavigator container panel 1"/> <mx:Button label="Select Tab 2 and Fill with Text" click="showtab2()"/> </mx:VBox> <mx:VBox label="Panel 2"> <mx:Label text="TabNavigator container panel 2"/> <s:TextInput id="mytextbox" /> </mx:VBox> </mx:TabNavigator> <mx:HBox> </mx:HBox> </mx:Panel> </s:WindowedApplication>

    Read the article

  • Check to see if CallResponder is processing

    - by Travesty3
    I'm using Flash Builder 4.6. As a simple example, say I have the following application: <?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:sdk="services.sdk.*"> <fx:Script> <![CDATA[ private function btnGetValue_clickHandler():void { getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { // ... } ]]> </fx:Script> <fx:Declarations> <sdk:SDK id="sdk" fault="{Alert.show(event.fault.faultString +'\n\n'+ event.fault.faultDetail, 'SDK ERROR');}" showBusyCursor="false"/> <s:CallResponder id="getValueResult" result="getValueResultHandler()"/> </fx:Declarations> <s:Button id="btnGetValue" click="btnGetValue_clickHandler()" label="Get Value" /> </s:Application> So when you click on the button, it calls a PHP file and when it gets a result, it calls getValueResultHandler(). Easy enough. But what if the response from the PHP file takes a second or two and the user clicks the button rapidly? Then the result handler function may not get called every time, since the call responder gets a new token before it received the last response. Is there a standard way of resolving this issue? I came up with the following workaround, and it works fine, but it seems like this issue would be common enough to have a more built-in solution. My workaround is: var getValueResultProcessing:Boolean = false; private function btnGetValue_clickHandler():void { var interval:uint = setInterval(function():void { if (!getValueResultProcessing) { getValueResultProcessing = true; getValueResult.token = sdk.getValue(); clearInterval(interval); } }, 100); getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { getValueResultProcessing = false; // ... } Any better way of resolving this issue?

    Read the article

< Previous Page | 9 10 11 12 13 14  | Next Page >