Search Results

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

Page 7/14 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Flex: Why is line obscured by canvas' background

    - by mauvo
    I want MyCanvas to draw lines on itself, but they seem to be drawn behind the background. What's going on and how should I do this? Main.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:my="*"> <my:MyCanvas width="300" height="300" id="myCanvas"></my:MyCanvas> <mx:Button label="Draw" click="myCanvas.Draw();"></mx:Button> </mx:Application> MyCanvas.as package { import mx.containers.Canvas; public class MyCanvas extends Canvas { public function MyCanvas() { this.setStyle("backgroundColor", "white"); } public function Draw():void { graphics.lineStyle(1); graphics.moveTo( -10, -10); graphics.lineTo(width + 10, height + 10); } } } Thanks.

    Read the article

  • AIR:- Desktop Application related to Window Component (Need some work around)

    - by Mahesh Parate
    Create custom component which contains Combobox and Datagrid. Application conations two button 1) Same Window and 2) New Window. (Label of two button) When you click on “Same Window” button your custom component should get added dynamically in your application. And when you click on “New Window” button your custom component should get open in different window (it should get shifted from application and should appear in Window component). Issue faced:- Clicking on Combobox, list is not getting open as change event doesn’t get fired in Native Window as it looses reference from main application. Issue with DataGrid in Native window (AIR). • DataGridEvent.COLUMN_STRETCH event get affected if try to open datagrid in Native Window. • DataGridEvent get fired but takes long time or even stuck while column stretch Note: Application is an Desktop Application. Only one instance is created in Application for your custom component to preserve current state on your custom component it can be Style, data, or other subcomponent state of your custom component (as above mentioned 2 component are just sample). Please find sample code below:- DataGridStretchIssue.mxml:- < ?xml version="1.0" encoding="utf-8"? < mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" width="800" height="500" < mx:Script < ![CDATA[ import mx.events.FlexEvent; import mx.core.Window; private var dgComp:DataGridComp = new DataGridComp(); private var win:Window; private function clickHandler(event:Event):void{ dgComp.percentWidth = 100; dgComp.percentHeight = 100; dgComp.x = 50; dgComp.y = 100; if(win){ win.close(); } this.addChild(dgComp); } private function openClickHandler(event:MouseEvent):void{ dgComp.x = 50; dgComp.y = 100; win = new Window();; win.width = 800; win.height = 500; win.addChild(dgComp); dgComp.percentWidth = 100; dgComp.percentHeight = 100; dgComp.x = 50; dgComp.y = 100; win.open(true) } ]]> < /mx:Script < mx:HBox <mx:Button id="btnID" click="clickHandler(event)" label="Same Window"/> <mx:Button id="btnIDOpen" click="openClickHandler(event)" label="New Window"/> < /mx:HBox < /mx:WindowedApplication DataGridComp.mxml < ?xml version="1.0" encoding="utf-8"? < mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" <mx:Script> <![CDATA[ import mx.events.DataGridEvent; import mx.collections.ArrayCollection; [Bindable] public var cards:ArrayCollection = new ArrayCollection( [ {label:"Visa", data:1}, {label:"MasterCard", data:2}, {label:"American Express", data:3} ]); private function stretchFn(event:DataGridEvent):void{ trace("--- Stretched---") } ]]> </mx:Script> <mx:HBox> <mx:ComboBox dataProvider="{cards}" width="150"/> <mx:DataGrid columnStretch="stretchFn(event)" > <mx:ArrayCollection> <mx:Object> <mx:Artist>Pavement</mx:Artist> <mx:Price>11.99</mx:Price> <mx:Album>Slanted and Enchanted</mx:Album> </mx:Object> <mx:Object> <mx:Artist>Pavement</mx:Artist> <mx:Album>Brighten the Corners</mx:Album> <mx:Price>11.99</mx:Price> </mx:Object> </mx:ArrayCollection> </mx:DataGrid> </mx:HBox> < /mx:Canvas Can any one suggest me some work around to make my code workable... :)

    Read the article

  • Actionscript base class in Flex AIR app

    - by Alan
    I'm trying to build a Flex AIR app using Flex Builder 3, which I'm just getting started with. In Flash CS4, there's a text field in the authoring environment where you can specify a class that will become the "base" class - your class inherits from Sprite and then "becomes" the Stage at runtime. Is there a a way to do the same thing with Flex/AIR? Failing that, can anyone explain how to create and use an external class? Originally I had this in TestApp.mxml: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script source="TestApp.as"/> </mx:WindowedApplication> And this in TestApp.as: package { public class TestApp { public function TestApp() { trace('Hello World'); } } } That gives the error "packages cannot be nested", so I tried taking out the package statement: public class TestApp { public function TestApp() { trace('Hello World'); } } That gives an error "classes cannot be nested", so I finally gave up and tried to take out the class altogether, figuring I'd try to start with a bunch of functions instead: function init() { trace('Hello World'); } But that gives the error "A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package". I can't win! When I put my class in a package, it says I can't do that because it would be nested. When I don't, it says it needs to be in a package so it can be seen. Does anyone know how to fix this? If I can't do the custom-class-as-base-class thing, is there a way I could just have it like: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script source="TestApp.as"/> <mx:Script> var app = new TestApp(); </mx:Script> </mx:WindowedApplication> At the moment I can't import the class definition at all, so even that won't work. Thanks in advance!

    Read the article

  • binding to arraycollection does not work

    - by ron
    Hi, I am using flex SDK 3.5. I have model.as and in it i have an ArrayCollection (name it arr_mod) which is Bindable. From my mxml i link to this arr_mod in two ways: 1) in DataGrid i set dataprovider={arr_mode} ... 2) in Button i add new item to the arr_mod this way: 3) in textBox i want to add mx:TextBox text="{mySpecialCounterFunc(arr_mod)}" note that in the Script of mxml arr_mod is Bindable as well as in the class definition in model.as The problem is, that when clicking on button, mySpecialCounterFunc is not called! it should be called, since i use {} and this should listen to changes in arr_mod (a change that was made in the button should cause a new item to be added.. and than the listener to respond). While The DataGrid is updated correctly! Why??

    Read the article

  • Using an image as a border

    - by Tempname
    I am working on an custom container and I need a border for this container. I have a 15x15 image that I am creating a 9-slice border skin with. The issue that I am having is that the border skin does not appear the way that I had hoped it would. Here is a ss of the skin in place. Ideally I should have a transparent box with a 5 pixel border around it. Here is my current testing code: CSS Code: Box { borderSkin: Embed(source="15x15.png", scaleGridLeft="5", scaleGridTop="5", scaleGridRight="10", scaleGridBottom="10"); } MXML Code: <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Style source="MainTest.css"/> <mx:Box id="tw" width="400" height="400"> </mx:Box> </mx:WindowedApplication>

    Read the article

  • Flex Custom UIComponents

    - by user164142
    I have created a graph component in AS3 which extends UIComponent. I created an mxml component which is just a Label. The idea is to use the label component to show the values on the graph when you hover over points. I have tried two approaches. Create the Label component using ClassFactory inside the graph so it gets created in the graph component and addChild is called there. The problem is it is always 0 in size. Create in main mxml file and pass in to graph using a setter, the sizing is perfect but the x an y dont relate to my graph :( I suppose its similar to flex and itemrenderers, but in my case i have a graph and another component which can be changed, at the moment it is just a Label. Thanks Neil

    Read the article

  • Flex Mobile : How to skin view?

    - by Anthony
    I would like to know if it's possible to skin view for my Flex mobile application : My ActivityView.as public class ActivityView extends View My ActivityViewSkin.mxml (It skin associated) <?xml version="1.0" encoding="utf-8"?> <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <fx:Metadata> [HostComponent("com.corp.views.activity.ActivityView")] ... It's a good way for mobile development ? And how can I use this in this skin : <s:navigationContent> Thank you very much ! Anthony

    Read the article

  • FLEX: sequence of puppets... 3 requirements

    - by Patrick
    hi, I'm implementing this sequence of puppets in flex: http://dl.dropbox.com/u/72686/itemsSequence.png I want to show the caption when the mouse rolls over the puppet I want the user being able to click on the buttons of the caption (so the caption doesn't have to disappear when I move the mouse out from the user over the caption). I don't want the puppet component to become bigger when the caption is added (it becomes visible), because the puppets have to stay nearby each other, I cannot resize the objects. So.. I need some guidelines to do it. More precisely: 1) Should I add the components in MXML or pure actionscript ? 2) If I use MXML, should I add also the caption to the flex model, and make it invisible and then change the value with actionscript ? What's the common way to implement it ? thanks

    Read the article

  • FLEX, Actionscript: how can I invoke a CustomEvent ?

    - by Patrick
    hi, I've created a custom MouseEvent in Flex: package { import flash.events.MouseEvent; public class CustomMouseEvent extends MouseEvent { public var tags:Array = new Array(); public function CustomMouseEvent(type:String, tags:Array) { super(type, true); this.tags = tags; } } } Now I would like to understand how to pass the parameter tags from both Actionscript and MXML: From actionscript I'm trying something like this, but it doesn't work: newTag.addEventListener(MouseEvent.MOUSE_UP, dispatchEvent(new CustomMouseEvent(MouseEvent.MOUSE_UP,[newTag.name]))); From MXML i'm doing this and it doesn't work as well: <mx:LinkButton click="dispatchEvent(new CustomMouseEvent(MouseEvent.MOUSE_UP, bookmarksRepeater.currentItem.tags))" /> thanks

    Read the article

  • Actionscript 3: Monitoring the activity level for multiple Microphones doesn't seem to work.

    - by Dave
    For a project I want to show all available webcams and microphones, so that the user can easily select whichever webcam/microphone combination they prefer. I run into an issue with the microphones listing though. Each microphone is listed with an activity animation and it's name. I am able to list all Microphones just fine (using the Microphone.names Array), but it seems like I can only get the activity viewer to work for one microphone. The other microphones show up with '-1' activity, which (as far as I know) is Flex for 'present, but not in use'. When unplugging the microphone that does show activity, the next one (in my case, the mic-in line on my motherboard) shows up with '0' activity (it's not connected, so that makes sense). During my testing I have a total of 3 microphones available, the not-connected onboard mic-in port, and two connected microphones. For testing purposes I use a timer that traces the current microphone activity each 100ms and the graph is also shown. It does not seem to matter what default microphone I set via flash' settings panel. The code I've only attached the revelant code snippets below to make it easier for you to read through them. Please let me know if you prefer the entire code. Main application.mxml Note: cont is a VBox. i is defined before this code snippet. var mics:Array = Microphone.names; for(i=0; i < mics.length; i++){ var mic:settingsMicEntry = new assets.settingsMicEntry; mic.d = {name: mics[i], index: i}; cont.addChild(mic); } assets/settingsMicEntry.mxml timer is defined before this code snippet. the SoundTransform is added to silence local microphone playback. Excluding this code does not solve the problem, sadly (I've tried). display is an MXML Canvas object. mic = Microphone.getMicrophone(d.index); if(mic){ // Temporary: The Microphones' visualizer var bar:Box = new Box(); bar.y = 50; bar.height = 0; bar.width = 66; bar.setStyle("backgroundColor", 0x003300); display.addChild(bar); var tf:SoundTransform = new SoundTransform(0); mic.setLoopBack(true); mic.soundTransform = tf; timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void{ var h:int = Math.floor((display.height/100)*mic.activityLevel); bar.height = (h>-1) ? h : 0; bar.y = (h>-1) ? display.height-h : display.height; trace('TIMER: '+h+' from '+d.name); }); timer.start(); } I'm pulling my hear out here, so any help is much appreciated! Thanks, -Dave Ps.: Pardon the messiness of the code!

    Read the article

  • pass data from popup to parent

    - by user522962
    I have a parent w/ a popup child. When parent loads, I have to call a function within the popup without showing the popup (thus, I load "pupLove" but don't include it in layout)....I then pass this data to the parent. When the user manually clicks another button to open the popup, the same function is called & data passed to the parent. However, I am not able to pass dg.length to the parent. I believe the root problem is that I am loading "pupLove" & thus the parents are getting confused.....I'm guessing if I get rid of "pupLove" I can pass the data correctly but will need to call the child's function at creationComplete of the parent....how do I do that? Here's my parent: <?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" backgroundColor="green" width="50%" height="100%" xmlns:local="*" > <fx:Script> <![CDATA[ import pup; import mx.managers.PopUpManager; public function showPup(evt:MouseEvent):void { var ttlWndw:pup = PopUpManager.createPopUp(this, pup, true) as pup; PopUpManager.centerPopUp(ttlWndw); } ]]> </fx:Script> <mx:VBox> <local:pup id="pupLove" visible="false" includeInLayout="false" /> <s:Button click="showPup(event);" label="launch Pup" /> <mx:Text id="Ptest" color="black" text="from Parent:{pupLove.dg.length}" /> </mx:VBox> </s:Application> And a popup child called 'pup.mxml': <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"> <fx:Script> <![CDATA[ public function init():void{ // send php call } import mx.events.CloseEvent; import mx.managers.PopUpManager; private function removePup(evt:Event):void { PopUpManager.removePopUp(this); } ]]> </fx:Script> <fx:Declarations> <s:ArrayCollection id="dg"> </s:ArrayCollection> </fx:Declarations> <s:TitleWindow width="100%" height="100%" close="removePup(event)"> <mx:VBox> <mx:Text id="test" color="red" text="from Child:{dg.length}" /> <s:Button label="add Items" click="dg.addItem({id:'cat'})" /> </mx:VBox> </s:TitleWindow> </s:Group> UPDATE: I guess my question can be more easily stated as: "is there a way to call a child's function from the parent without actually loading the child?"

    Read the article

  • customizing into a reusable component in flex

    - by Fresher4Flex
    need to make a reusable custom component from the existing code here. So that I can use this code to make this effect(view stack) to work in any direction. In the code it has user specified height and works from downside. I need to make this component customizable, something like user is able do it in any direction.I need it urgently. I appreciate your help. 1)main Application: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:sh="windowShade.*"> <sh:Shade id="i1" height="15" headerHeight="14" thisHeight="215" alwaysOnTop="false" y="{this.height - 14}"/> </mx:WindowedApplication> 2)Custom Comp: Shade.mxml <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="300" creationComplete="init()" verticalScrollPolicy="off" verticalGap="0" > <mx:Script> <![CDATA[ import mx.core.Container; import mx.core.Application; import mx.controls.Alert; import mx.effects.easing.*; import mx.binding.utils.BindingUtils; /** * Need host to adjust this object to Top */ public var alwaysOnTop:Boolean = false; /** * User can custom the height of this component */ public var thisHeight:int = 0; /** * User can custom the header height of this component */ [Bindable] public var headerHeight:int = 14; /** * The bindable value of this height */ [Bindable] public var tHeight:int = 0; /** * The bindable value of parent height */ [Bindable] public var pHeight:int = 0; /** * Initialize method */ private function init():void { if (this.thisHeight > 0 ) this.height = this.thisHeight; BindingUtils.bindProperty(this, "tHeight",this,"height" ); BindingUtils.bindProperty(this, "pHeight",this.parent,"height" ); } /** * Toggle button */ private function toggleBtn(e:MouseEvent):void { if (this.alwaysOnTop) { var container:Container = Application.application as Container; container.setChildIndex(this.parent, container.numChildren - 1 ); } if ( vs.selectedIndex == 0 ) panelOut.play(); else panelIn.play(); } ]]> </mx:Script> <mx:Move id="panelOut" target="{this}" yTo="{ pHeight - this.tHeight }" effectEnd="vs.selectedIndex = 1" duration="600" easingFunction="Back.easeOut"/> <mx:Move id="panelIn" target="{this}" yTo="{ this.pHeight - headerHeight }" effectEnd="vs.selectedIndex = 0" duration="600" easingFunction="Back.easeIn"/> <mx:VBox horizontalAlign="center" width="100%"> <mx:ViewStack id="vs" width="100%"> <mx:VBox horizontalAlign="center" > <mx:Label text="VBox 1"/> <mx:Image source="@Embed('/windowShade/add.png')" click="toggleBtn(event)"/> </mx:VBox> <mx:VBox horizontalAlign="center"> <mx:Label text="2nd VBox"/> <mx:Image source="@Embed('/windowShade/back.png')" click="toggleBtn(event)"/> </mx:VBox> </mx:ViewStack> </mx:VBox> <mx:VBox id="drawer" height="100%" width="100%" backgroundColor="#000000"> </mx:VBox> </mx:VBox>

    Read the article

  • FLEX: videoDisplay.addEventListener(VideoEvent.PLAYHEAD_UPDATE) doesn't work

    - by Patrick
    hi, the PLAYHEAD_UPDATE event is not triggered by my videoDisplay component in Flex. If I add the attribute playheadUpdate="playUpdate()" everything works fine. But in the following code, the method "playUpdate()" is not triggered... thanks <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()"> <mx:Script><![CDATA[ import mx.events.VideoEvent private function init():void { ... videoD.addEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate); } private function thumbPressed():void { videoD.removeEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate); } private function thumbReleased():void { videoD.addEventListener(VideoEvent.PLAYHEAD_UPDATE, playUpdate); } private function playUpdate():void { debugF.text = "OK"; slider.value = videoD.playheadTime; } ]]></mx:Script> <mx:VideoDisplay id="videoD" autoPlay="{autoPlayOption}" source="{videoPath}" click="togglePlay()" /> The text OK is not displayed, and the slider is not updated. As I mentioned before, adding the attribute in MXML, works, instead.

    Read the article

  • Flex 3 Value aware combo box error

    - by user1057094
    I am using a value aware combobox, it was working fine, but recently i started getting the below error, when I try to click on combobox, and the error is random. I am not sure of it is because of any changes i have done in the coding, or some changes in data provider etc any help is appreciated... TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::ComboBox/destroyDropdown() at mx.controls::ComboBox/styleChanged() at mx.core::UIComponent/setBorderColorForErrorString() at mx.core::UIComponent/commitProperties() at mx.controls::ComboBase/commitProperties() at mx.controls::ComboBox/commitProperties() at custom.controls::ComboBox/commitProperties()[D:\workspace\eclipse\indigo\ams\flex_src\custom\controls\ComboBox.mxml:13] at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() Debugger throws TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::ComboBox/destroyDropdown() at mx.controls::ComboBox/styleChanged() at mx.core::UIComponent/setBorderColorForErrorString() at mx.core::UIComponent/commitProperties() at mx.controls::ComboBase/commitProperties() at mx.controls::ComboBox/commitProperties() at custom.controls::ComboBox/commitProperties()[D:\workspace\eclipse\indigo\ams\flex_src\custom\controls\ComboBox.mxml:13] at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at mx.managers::LayoutManager/validateNow() at mx.controls::ComboBox/displayDropdown() at mx.controls::ComboBox/downArrowButton_buttonDownHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::buttonPressed() at mx.controls::Button/mouseDownHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls::ComboBase/textInput_mouseEventHandler()

    Read the article

  • FLEX: how to dynamically add LineSeries to CartesianChart

    - by Patrick
    hi, the LineSeries is not dynamically added to my CartesianChart... What's wrong in this code: ... private function chartComplete():void { var ls:LineSeries = new LineSeries(); ls.styleName = 'timeline'; ls.dataProvider = "{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}"; ls.yField = 'popularity'; //ls.s = "{new Stroke(0xCC33CC, 2)}"; AllChart.series[0] = ls; } ... <mx:CartesianChart id="AllChart" width="100%" height="100" creationComplete="chartComplete();"> <mx:horizontalAxis><mx:CategoryAxis id="horiz1" dataProvider="['1','2','3','4','5','6','7','8','9','10','11','23','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']"/></mx:horizontalAxis> <mx:horizontalAxisRenderers><mx:AxisRenderer axis="{horiz1}"/></mx:horizontalAxisRenderers> <mx:verticalAxis><mx:LinearAxis id="vert1" /></mx:verticalAxis> <mx:verticalAxisRenderers><mx:AxisRenderer axis="{vert1}"/></mx:verticalAxisRenderers> <mx:series> <mx:AreaSeries id="timeArea" styleName="timeArea" name="A" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(2).yearPopularity}" areaStroke="{new Stroke(0x0033CC, 2)}" areaFill="{new SolidColor(0x0033CC, 0.5)}" /> </mx:series> </mx:CartesianChart> I can only see the TimeLine if I added it with MXML: <mx:LineSeries styleName="timeLine" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}" yField="popularity" stroke="{new Stroke(0xCC33CC, 2)}" /> But I need to update the view, and add N lines so I cannot do it with MXML. thanks

    Read the article

  • Unable to display Google Map through API in Flex SDK

    - by Spero.ShiroPetto
    Hello, I am using the mxmlc to compile the examples from google to get started in using Google Maps API in Flex 4. But after compiling the swf file the map does not load. I've registered for an API key Downloaded and included the Maps SDK in the xml config file used at compile time C:\sdk\flex4\frameworks\flex-config.xml <external-library-path> <path-element>libs/google/maps/lib/map_flex_1_18.swc</path-element> </external-library-path> Foo.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%" key="{KEY}"/> <mx:Script> <![CDATA[ import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; private function onMapReady(event:Event):void { this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE); } ]]> </mx:Script> </mx:Application> Any tips on where to go from here? I can compile a basic flex project without problem and displays the components I put in so i'd imagine it's something to do with the API Key? Thanks for the help

    Read the article

  • Initialize webservice WSDL at runtime using Flex and Mate framework

    - by GroovyB
    I am developing a Flex application on top of Mate framework. In this application, I am using a webservice to retrieve data. As this webservice as not a fix location URL (depending on where customers installed it), I define this URL in a config file. When the Flex application starts, it first reads this config file, then I would like to use the value I found to initialize the webservice. But currently, I have no idea how to this. Here is my EventMap.mxml <EventMap> <services:Services id="services" /> <EventHandlers type="{FlexEvent.PREINITIALIZE}"> <HTTPServiceInvoker instance="{services.configService}"> <resultHandlers> <MethodInvoker generator="{ConfigManager}" method="loadFromXml" arguments="{resultObject}" /> </resultHandlers> <faultHandlers> <InlineInvoker method="Alert.show" arguments="ERROR: Unable to load config.xml !" /> </faultHandlers> </HTTPServiceInvoker> In this part, the ConfigManager parse the config file and intitialize a bindable property called webServiceWsdl Here is my Services.mxml <mx:Object> <mx:Script> <![CDATA[ [Bindable] public var webservice:String; ]]> </mx:Script> <mx:HTTPService id="configService" url="config.xml" useProxy="false" /> <mx:WebService id="dataService" wsdl="{webservice}" useProxy="false"/> </mx:Object> How can I initialize this webservice property ?

    Read the article

  • embedded SWF isn't shown (SWFLoader)

    - by Trantec
    I embed a swf as ByteArray and load it at runtime with the SWFLoader. Here is the internal swf that I want to load: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Label id="rLabel" text="From InternalSWF"/> </mx:Application> The embeding swf loads it with the following code: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="main();"> <mx:Script> <![CDATA[ import mx.managers.SystemManager; import mx.events.FlexEvent; [Embed(source="../../InternalSWF/bin-release/InternalSWF.swf", mimeType="application/octet-stream")] mimeType="application/octet-stream")] private const internalSWF:Class; public function main(): void { var binary:ByteArray = new internalSWF() as ByteArray; // setup swfloader rSwfLoader.trustContent = true; rSwfLoader.addEventListener( Event.COMPLETE, onSWFLoaded ); rSwfLoader.load(binary); } public function onSWFLoaded( event:Event ): void { } ]]> </mx:Script> <mx:Box> <mx:SWFLoader id="rSwfLoader" height="100%" width="100%" scaleContent="true"/> <mx:Text id="rText" text="from EmbedingSWF"/> </mx:Box> The label "from EmbedingSWF" is shown on both, local and on the webserver. But the label with "From InternalSWF" isn't shown on the webserver, just on the local machine. With some tests I found out that the internal swf is loaded correctly, because it's later added applicationComplete-Function is called. Is this a bug in Adobe-Flash-Player or am I missunderstanding something ? Update: Internet Explorer is fine. Firefox and Chrome not...

    Read the article

  • Flex: Menubar, menu click

    - by javanes
    I do not know why but I see that itemclick event on a menubar do not fired unless you click a sub item. What is the clean way to handle clicks on menuitems which are on the top level and do not have sub menu items. For example I want to fire an event whenever MenuItem B is clicked. <?xml version="1.0"?> <!-- menus/MenuBarControl.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:MenuBar id="myMenuBar" labelField="@label" itemClick="{itemClick(event)}" > <mx:XMLList> <menuitem label="MenuItem A"> <menuitem label="SubMenuItem A-1"/> <menuitem label="SubMenuItem A-2"/> </menuitem> <menuitem label="MenuItem B"/> </mx:XMLList> </mx:MenuBar> </mx:Application>

    Read the article

  • Components inside a repeater not resizing as expected

    - by VoidPointer
    I have an mxml panel in which I'm using a repeater. The panel can be resized horizontally and I would like for the repeated components to resize together with panel. Here is a simplified example of how things look like: <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" ...> <!-- scripts and some controls --> <mx:VBox width="100%"> <core:Repeater width="100%" dataProvider="model"> <ns1:MyItemRenderer width="100%" /> </core:Repeater> </mx:VBox> </mx:TitleWindow> When I resize the component, the width of the repeated items does not change. There also buttons and event handlers, which add and remove items from the model. When this is done, the repeater updates to display the correct number of items and all the items are resized correctly. I have not been able to get the items to resize when the root panel is resized. I can see, that the VBOx around the repeater is getting a resize event. However, the repeated items are not getting the event. I tried to dispatch a resize event to the repeated items manually from a resize handler I hooked up to the VBox but that didn't help. I also tried adding and removing a dummy-item from the ArrayCollection which is the dataProvider (because that triggers a correct resize otherwise as mentioned above) However, doing this in the resize handler of the VBox just leads to the repeater not showing any items at all. Is there any way to get items in a repeater to resize with their enclosing container?

    Read the article

  • Obtain reference to View in ActionScript class within ViewNavigatorApplication

    - by chb
    I've got a very simple project in FlashBuilder 4.5. It's a mobile application of type ViewNavigatorApplication with a single view, MapView. In the MapView.mxml file, I've got a Flex component of type Map declared in xml. <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" name="CatBusMapView"> <fx:Script> <![CDATA[ import com.esri.ags.Map; .... ]]> </fx:Script> <fx:Declarations> .... </fx:Declarations> <esri:Map id="cbm"> ... </esri:Map> </s:View> In this same project, I've an actionscript class called UserGeolocation. In this class, I'm attempting to get a reference to this map component. So far, I can get a reference to the top-level application, its ViewNavigator and the NavigationStack of said ViewNavigator. However, I cannot find a way to access the MapView, much less the map I've declared within it. I'm aware of methods like firstView() and activeView(), but I want an absolute solution, one that retrieves the view regardless of whether or not it's first or active. I've tried navigator.getChildByName("MapView") with no luck.

    Read the article

  • Web and Flex developer career question [closed]

    - by abhilashm86
    Possible Duplicate: should i concentrate on logical and puzzles part in programming, i want to be a web (flex)developer? I'm a computer science student and have been learning Flex and Actionscript 3.0 for 4 months. I know it's easy to program in MXML, and Actionscript 3.0 is pretty easy with bunch of classes, but when I try to code in C++ or C, I struggle, I feel I'm being inefficient and it scares me. Since I'm a student, I've no experience in developing algorithms and tough program solving? I'd like to be a web developer. Does a web developer need strong fundamentals when it comes to things such as complex algorithms and high end coding?

    Read the article

  • Attaching .swf assets to Flex3 by calling getDefinitionByName()

    - by Alexander Farber
    Hello! Does anybody please know, how could you attach symbols from an .swf file in the Actionscript part of your Flex3 file? I've prepared a simple test case demonstrating my problem. Everything works (there are icons at the 4 buttons, there is a red circle) - except the getDefinitionByName() part. My target is to attach a symbol from library "dynamically" - i.e. depending at the value of the suit variable at the runtime. Thank you, Alex Symbols.as: package { public class Symbols { [Embed('../assets/symbols.swf', symbol='spades')] public static const SPADES:Class; [Embed('../assets/symbols.swf', symbol='clubs')] public static const CLUBS:Class; [Embed('../assets/symbols.swf', symbol='diamonds')] public static const DIAMONDS:Class; [Embed('../assets/symbols.swf', symbol='hearts')] public static const HEARTS:Class; } } TestCase.mxml: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete();"> <mx:Script> <![CDATA[ private function onCreationComplete():void { var sprite:Sprite = new Sprite(); var g:Graphics = sprite.graphics; g.lineStyle(1, 0xFF0000); g.beginFill(0xFF0000); g.drawCircle(100, 100, 20); g.endFill(); spriteHolder.addChild(sprite); // XXX stuff below not working, can it be fixed? var suit:String = "SPADES"; var mc:MovieClip = new (getDefinitionByName("Symbols.SPADES") as Class); spriteHolder.addChild(mc); } ]]> </mx:Script> <mx:VBox width="100%"> <mx:Button label="1" icon="{Symbols.SPADES}" /> <mx:Button label="2" icon="{Symbols.CLUBS}" /> <mx:Button label="3" icon="{Symbols.DIAMONDS}" /> <mx:Button label="4" icon="{Symbols.HEARTS}" /> <mx:UIComponent id="spriteHolder" width="200" height="200"/> </mx:VBox> </mx:Application>

    Read the article

  • Including configuration files while compiling a Flex application with MXMLC

    - by Daniel
    Hello there, I'm using: - Flex SDK 3.5.0 - Parsley 2.2.2. - Flash Builder 4 Down in my src folder (which is configured as part of the source path in the Flash Builder), I have a logging.xml which I configure via Parsley: FlexLoggingXmlSupport.initialize(); XmlContextBuilder.build("com/company/product/util/log/logging.xml"); When I run my application through Flash Builder, the XmlContentBuilder seems to locate the logging.xml (the implementation is a regular URLLoader one). When I compile my application using MXMLC (whether in Ant or command-line), and then run the swf, I get the following error: Cause(0): Error loading com/company/product/util/log/logging.xml: Error in URLLoader - cause: Error #2032: Stream Error. URL: file:///C|/workspace/folder01/product/target/com/company/product/util/log/logging.xml - cause: Error #2032: Stream Error. URL: file:///C|/workspace/folder01/product/target/com/company/product/util/log/logging.xml Here is the MXMLC tag in Ant: <mxmlc file="${product.src.dir}/com/company/product/view/Main.mxml" output="${product.target.dir}/${product.release.filename}" keep-generated-actionscript="false"> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> <!-- source paths --> <source-path path-element="${FLEX_HOME}/frameworks" /> <compiler.source-path path-element="${product.src.dir}" /> <compiler.source-path path-element="${product.locale.dir}/{locale}" /> <compiler.library-path dir="${product.basedir}" append="true"> <include name="libs" /> </compiler.library-path> <warnings>false</warnings> <debug>false</debug> </mxmlc> And here is the command line: \mxmlc.exe -output "C:\temp\Rap.swf" -load-config "C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\3.5.0\frameworks\flex-config.xml" -source-path "C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in\sdks\3.5.0\frameworks" C:\workspace\folder01\product\src C:\workspace\folder01\product\locale\en_US -library-path+=C:\workspace\folder01\product\libs -file-specs C:\workspace\folder01\product\src\com\company\product\view\main.mxml Now perhaps I don't get this correctly, but as far as I understand the SWF should be compiled with all of the resources in the paths I give MXMLC as source-paths. For some reason it seems that the XML file is not compiled into the SWF, hence the relative path of the XmlContentBuilder isn't located successfully. I could not find any argument to provide the MXMLC with that might solve this. I tried using the -dump-config option with the Flash Builder's compiler, then giving that configuration to MXMLC, but it didn't work either. I tried providing the XmlContentBuilder with an absolute path. That worked fine when I compiled with MXMLC via Ant, but still didn't work when I used MXMLC in the command-line... I'd be happy to be enlightened here, regarding all subjects - using MXMLC, accessing resources with relative paths, configuring logging in Parsley, etc. Many thanks in advance, Daniel

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >