Search Results

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

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

  • How to access Actionscript from Javascript in Adobe AIR

    - by David Robinson
    I have an AIR application written in html/javascript and I want to use the Actionscript print functions but I have no experience in Actionscript for AIR. Where do I put the Actionscript code ? Does it go into an mxml file or does it need to be compiled into a Flash application. Where do I put it and how do I include it into the html document ? Finally, how do I call the AS function from Javascript ? =====update===== I know I have to compile either an .mxml or .as file into .swf using mxmlc and I have the following in my .as file: package { import mx.controls.Alert; public class HelloWorld { public function HelloWorld():void { trace("Hello, world!"); } } } Or alternately, this in a .mxml file: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.controls.Alert; public function HelloWorld():void { Alert.show("hello world!"); trace("Hello, world!"); } ]]> </mx:Script> </mx:Application> This compiles OK, but when I include it in a html file with: <script src="actionscript.swf" type="application/x-shockwave-flash"></script> I get the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.managers::FocusManager/activate() at mx.managers::SystemManager/activateForm() at mx.managers::SystemManager/activate() at mx.core::Application/initManagers() at mx.core::Application/initialize() at actionscript/initialize() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded() at mx.managers::SystemManager/initializeTopLevelWindow() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler() at mx.managers::SystemManager/docFrameListener() Any ideas what that means ?

    Read the article

  • How to add namespaces to a flex AIR project in Flash Builder 4?

    - by milkplus
    In my ant build.xml script I have... <namespace uri="http://ns.foo.com/mxml/2011" manifest="src/manifest.xml"/> <namespace uri="library://ns.adobe.com/flex/spark" manifest="flex_src/spark-manifest.xml"/> <namespace uri="http://www.adobe.com/2006/mxml" manifest="flex_src/mx-manifest.xml"/> That works! But... I'm not sure how to add these namespaces to my project properties in Flash Builder 4 so I can debug. When I try, it changes this line in my .actionScriptProperties <compiler additionalCompilerArguments="-namespace http://ns.foo.com/mxml/2011 src/manifest.xml -namespace=library://ns.adobe.com/flex/spark flex_src/spark-manifest.xml -namespace http://www.adobe.com/2006/mxml flex_src/mx-manifest.xml" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> but gives me a "no default arguments are expected" error. What is the reason for this error? The error location is "Unknown" and seems to refer to these compiler arguments.

    Read the article

  • Could not resolve <fx:Script> to a component implementation.

    - by seref
    Hi, i created project with flexmojos maven archtype..i used flexmojos:flexbuilder and compile/run with FlashBuilder 4 everything is okay but when i try to compile project with flexmojos i got following error: [ERROR] Z:....\src\main\flex\Main.mxml:[6,-1] Could not resolve < fx:Script to a component implementation. [INFO] BUILD FAILURE my mxml: <?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" width="100%" height="100%" creationComplete="application1_creationCompleteHandler(event)"> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.FlexEvent; protected function application1_creationCompleteHandler(event:FlexEvent):void { Alert.show("success!!!!") } ]]></fx:Script> </s:Application> pom.xml like: ...... <packaging>swf</packaging> ...... <properties> <flex-sdk.version>4.1.0.16076</flex-sdk.version> <flexmojos.version>3.8</flexmojos.version> </properties> ...... <build> <sourceDirectory>src/main/flex</sourceDirectory> <testSourceDirectory>src/test/flex</testSourceDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex-sdk.version}</version> <type>pom</type> </dependency> </dependencies> <configuration> <compiledLocales> <locale>en_US</locale> </compiledLocales> <mergeResourceBundle>true</mergeResourceBundle> <accessible>true</accessible> <optimize>true</optimize> <targetPlayer>10.0.0</targetPlayer> <showWarnings>true</showWarnings> <linkReport>true</linkReport> </configuration> </plugin> </plugins> </build> <dependencies> <!-- Flex framework resource bundles --> <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>flex-framework</artifactId> <version>${flex-sdk.version}</version> <type>pom</type> </dependency> <!-- Include unit test dependencies. --> <dependency> <groupId>com.adobe.flexunit</groupId> <artifactId>flexunit</artifactId> <version>4.0-rc-1</version> <type>swc</type> <scope>test</scope> </dependency> </dependencies> ....... maven output compiler config : INFO] Flex compiler configurations: -compiler.external-library-path C:\...\.m2\repository\com\adobe\flex \framework\playerglobal\4.1.0.16076\10.0\playerglobal.swc -compiler.include-libraries= -compiler.library-path C:\...\.m2\repository\com\adobe\flex\framework \datavisualization\4.1.0.16076\datavisualization-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\flash-integration \4.1.0.16076\flash-integration-4.1.0.16076.swc C:\...\.m2\repository \com\adobe\flex\framework\flex\4.1.0.16076\flex-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\framework \4.1.0.16076\framework-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\rpc \4.1.0.16076\rpc-4.1.0.16076.swc C:\...\.m2\repository\com\adobe\flex \framework\spark\4.1.0.16076\spark-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\sparkskins \4.1.0.16076\sparkskins-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\textLayout\4.1.0.16076\textLayout-4.1.0.16076.swc C: \...\.m2\repository\com\adobe\flex\framework\utilities \4.1.0.16076\utilities-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\datavisualization \4.1.0.16076\datavisualization-4.1.0.16076-en_US.rb.swc C:\... \.m2\repository\com\adobe\flex\framework\framework \4.1.0.16076\framework-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository \com\adobe\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076- en_US.rb.swc C:\...\.m2\repository\com\adobe\flex\framework\rpc \4.1.0.16076\rpc-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com \adobe\flex\framework\spark\4.1.0.16076\spark-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com\adobe\flex\framework\textLayout \4.1.0.16076\textLayout-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository \com\adobe\flex\framework\flash-integration\4.1.0.16076\flash- integration-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com\adobe \flex\framework\playerglobal\4.1.0.16076\playerglobal-4.1.0.16076- en_US.rb.swc -compiler.theme Z:\.....\target\classes\configs\themes\Spark \spark.css -compiler.accessible=true -compiler.allow-source-path-overlap=false -compiler.as3=true -compiler.debug=false -compiler.es=false -compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.BatikFontManager flash.fonts.AFEFontManager flash.fonts.CFFFontManager -compiler.fonts.local-fonts-snapshot Z:\.....\target\classes \fonts.ser -compiler.keep-generated-actionscript=false -licenses.license flashbuilder4 952309948800588759250406 -licenses.license flexbuilder4.displayedStartPageAtLeastOneTime true -compiler.locale en_US -compiler.optimize=true -compiler.source-path Z:\.....\src\main\flex -compiler.strict=true -use-network=true -compiler.verbose-stacktraces=false -compiler.actionscript-file-encoding UTF-8 -target-player 10.0.0 -default-background-color 8821927 -default-frame-rate 24 -default-script-limits 1000 60 -default-size 500 375 -compiler.headless-server=false -compiler.keep-all-type-selectors=false -compiler.use-resource-bundle-metadata=true -metadata.date Fri Mar 04 14:04:37 EET 2011 -metadata.localized-title Main x-default -verify-digests=true -compiler.namespaces.namespace+=http://ns.adobe.com/mxml/2009,Z:\..... \target\classes\config-4.1.0.16076\mxml-2009-manifest.xml -compiler.namespaces.namespace+=library://ns.adobe.com/flex/spark,Z: \.....\target\classes\config-4.1.0.16076\spark-manifest.xml -compiler.namespaces.namespace+=library://ns.adobe.com/flex/mx,Z:\..... \target\classes\config-4.1.0.16076\mx-manifest.xml -compiler.namespaces.namespace+=http://www.adobe.com/2006/mxml,Z:\..... \PozitronUI\target\classes\config-4.1.0.16076\mxml-manifest.xml - static-link-runtime-shared-libraries=false -load-config= -metadata.language+=en_US any help... regards,

    Read the article

  • Flex Import Class from a Module within a sub directory

    - by Tom
    I put some modules in a module folder. How do I import classes with the import statement when I'm in a sub folder? This won't work, not like classes which are in packages. modules/SomeModule.mxml <?xml version="1.0"?> <mx:Module> <mx:Script> <![CDATA[ import Fruit.Apple; ]]> </mx:Script> </mx:Module> Directory: . |-- Fruit |-- Apple.as |-- Modules |-- SomeModule.mxml `-- application.mxml

    Read the article

  • [Flash Builder Profiler] Why some function have been called

    - by HarryWang
    1 Create a project use flex sdk 3.4 2 Create a new mxml app Testadd.mxml 3 Add a source jpg Any.jpg content of Testadd.mxml just two line. [Embed(source="Any.jpg")] public var NotUsedSource:Class; I think this just defined a class which represent some data. And I never use it or initialize any instance of it in this app. 4 Profile this app, when it is profiling I click the resize button of IE servral times. 5 From the profiled data a function named Testadd_NotUsedSource.flash.events:IEventDispatcher:dispatchEvent is been called 6 My question is why this function has been called. I have the screenshot but can't add to this post.

    Read the article

  • What is the best practice to develop a visual component in Flex Hero?

    - by gavri
    What is the best practice to develop a visual component in Flex Hero? I do it like this: I consider a component has 2 "parts", the declarative part (the visual sub-components) which I define in the skin (just mxml) and the code part (event handlers...) which I define in an action script class. I load the skin in the ctor of the action script class. I also define skin parts, states, and I bind event handlers in the partAdded function. I am having an argument about this; that I should define the component purely in an .mxml, with listeners in the script tag, and maybe attach a skin (but the skin should be loose - maybe for reuse :-?) I come from .NET and maybe I am biased with the code behind pattern, and I am wondering from your experience and Adobe's intent, what is the best practice to usually implement a visual component?

    Read the article

  • [Flex] What is new functionality 'Sparks' that appears in the Flash Builder 4 ?

    - by ignatius
    Hello, i just checking Flash Builder 4 ( i come from Flex builder 3 ), and it was painfull to see that old CSS visual editor, that it was very convenient for skinning components, has dissapear when select version 4. Also creating new project appear option between Mxml and 'Mxml+Spark'. What is this spark? Do you recommend using this? What are the strong point over tradicional CSS editing? i am a little bit confused with this. Br.

    Read the article

  • Flex - Problem with auto resizing datagrid

    - by Marty Pitt
    Hi All I'm trying to create a datagrid which will resize vertically to ensure all the renderers are displayed in full. Additionally, Renderers are of variable height Renderers can resize themselves Generally speaking, the flow of events is as follows : One of the item renderers resizes itself (normally in response to a user click etc) It dispatches a bubbling event which the parent datagrid picks up The DataGrid attempts to resize to ensure that all renderers remain visible in full. I'm currently using this code within the datagrid to calculate the height: height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; This appears to get an incorrect height. I've tried a number of variations including callLater ( to ensure the resize has completed so measure can work correctly), and overriding meausre() and calling invalidateSize() / validateSize(), but neither works. Below are 3 classes which will illustrate the problem. Clicking the button in the item renderers resizes the renderer. The grid should also expand so that all of the 3 renderers are shown in their entirety. Any suggestions would be greatly appreciated. Regards Marty DataGridProblem.mxml (Application file) <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:view="view.*"> <mx:ArrayCollection id="dataProvider"> <mx:String>Item A</mx:String> <mx:String>Item B</mx:String> <mx:String>Item C</mx:String> </mx:ArrayCollection> <view:TestDataGrid id="dg" dataProvider="{ dataProvider }" width="400"> <view:columns> <mx:DataGridColumn dataField="text" /> <mx:DataGridColumn itemRenderer="view.RendererButton" /> </view:columns> </view:TestDataGrid> </mx:Application> view.TestDataGrid.as package view { import flash.events.Event; import mx.controls.DataGrid; import mx.core.ScrollPolicy; public class TestDataGrid extends DataGrid { public function TestDataGrid() { this.verticalScrollPolicy = ScrollPolicy.OFF; this.variableRowHeight = true; this.addEventListener( RendererButton.RENDERER_RESIZE , onRendererResize ); } private function onRendererResize( event : Event ) : void { resizeDatagrid(); } private function resizeDatagrid():void { height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; } } } view.RendererButton.mxml <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Button width="50" height="50" click="onClick()" /> <mx:Script> <![CDATA[ public static const RENDERER_RESIZE : String = "resizeRenderer"; private function onClick() : void { this.height += 20; dispatchEvent( new Event( RENDERER_RESIZE , true ) ); } ]]> </mx:Script> </mx:HBox>

    Read the article

  • Flex unit testing with ANT vs Flash Builder 4

    - by peterlindstrom21
    I have just tried setup unit testing in Flash Builder 4, and it working nicely. A setup of a parallel test source structure and using Flash Builder 4:s new TestCase and new TestSuite I was up and running with some testcases within minutes. But now I want to compile them from a ant flex task, the Flash Builder generates FlexUnitApplication.mxml and FlexUnitCompilerApplication.mxml. Is there a nice way to build the unit tests with ant using these? I cant find any sample where this is done.

    Read the article

  • How do I use data from the main window in a sub-window?

    - by eagle
    I've just started working on a photo viewer type desktop AIR app with Flex. From the main window I can launch sub-windows, but in these sub-windows I can't seem to access the data I collected in the main window. How can I access this data? Or, how can I send this data to the sub-window on creation? It doesn't need to be dynamically linked. myMain.mxml <?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/mx" width="260" height="200" title="myMain"> <fx:Declarations> </fx:Declarations> <fx:Script> <![CDATA[ public function openWin():void { new myWindow().open(); } public var myData:Array = new Array('The Eiffel Tower','Paris','John Doe'); ]]> </fx:Script> <s:Button x="10" y="10" width="240" label="open a sub-window" click="openWin();"/> </s:WindowedApplication> myWindow.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Window name="myWindow" title="myWindow" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="640" height="360"> <mx:Script> <![CDATA[ ]]> </mx:Script> <mx:Label id="comment" x="10" y="10" text=""/> <mx:Label id="location" x="10" y="30" text=""/> <mx:Label id="author" x="10" y="50" text=""/> </mx:Window> I realize this might be a very easy question but I have searched the web, read and watched tutorials on random AIR subjects for a few days and couldn't find it. The risk of looking like a fool is worth it now, I want to get on with my first app!

    Read the article

  • Flex - Why is my custom event not being registered with the following event listener?

    - by flexfanatic
    printableInvoice.addEventListener(batchGenerated, printableInvoice_batchGeneratedHandler); Results in this error: 1120: Access of undefined property batchGenerated. I have tried it as FlexEvent.batchGenerated and FlashEvent.batchGenerated. The MetaData and function that dispatches the even in the component printableInvoice is all right. It I instantiate printableInvoice as an mxml component instead of via action-script it well let put a tag into the mxml line: batchGenerated="someFunction()" Thanks.

    Read the article

  • ArgumentError: Error #2004: One of the parameters is invalid.

    - by Florian
    I got the following stack trace while running a piece of code in my flex application: ArgumentError: Error #2004: One of the parameters is invalid. at ObjectOutput/writeObject() at mx.collections::ArrayList/writeExternal()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\collections\ArrayList.as:470] at mx.collections::ArrayCollection/writeExternal()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\collections\ArrayCollection.as:144] at flash.utils::ByteArray/writeObject() at mx.utils::ObjectUtil$/copy()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\utils\ObjectUtil.as:100] at components::SettingsHandler/saveOpenNodes()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\SettingsHandler.as:153] at components::soapjira/getIssuesByFilters()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\soapjira.as:295] at components.tabs::JiraAllActions/loadData()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\tabs\JiraAllActions.mxml:193] at components::SettingsHandler/settingsClosed()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\SettingsHandler.as:114] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:9408] at components.general::JiraSettings/closeSettings()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\general\JiraSettings.mxml:58] at components.general::JiraSettings/__save_click()[C:\workspaces\Intranets\UniqueInbox\flex_src\components\general\JiraSettings.mxml:107] That stack comes up when running the following line (SettingsHandler.as:153): var tmp:Object = parentComponent.dataGrid.dataProvider.openNodes; I am actually copying the open nodes of a datagrid's provider. Has been working until now and just started going wrong, no idea what I have changed that could interfere with this. On debug mode, I see that openNodes is accessible and contains the open nodes, as expected. Doing tmp:Object = parentComponent.dataGrid.dataProvider.openNodes works, but not with ObjectUtil. (parentComponent is the reference to the component which contains the DG).

    Read the article

  • Prefix for element not bound

    - by Tim
    Hello! I am a newbie in Flex development and using Flash Builder 4 with SDK 4. Now I get the error that "the prefix "fx" for element "fx:Style" is not bound" in line number 4. I searched for it, and it has sth. to do with namespaces, but I can not solve it by myelf. I have the file called "UserStory.mxml" in the directory "components" to place it via the main.mxml onto the screen: <fx:Script> <![CDATA[ import components.UserStory; private function init():void { var userStory1:UserStory = new UserStory(); userStory1.x = 100; userStory1.y = 100; userStory1.userStoryText = "test"; this.addChild(userStory1); } ]]> </fx:Script> The file in which the error occurs in line no. 4: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="300" height="150" styleName="userstory"> <fx:Style source="styles/styles.css"/> <fx:Text x="5" y="5" width="275" height="135" text="{userStoryText}" fontFamily="notes" fontSize="18"/> <mx:Script> ... </mx:Script> </mx:Canvas> Can someone tell me what's wrong? Thanks a lot in advance & Best Regards.

    Read the article

  • Get "term is undefined” error when trying to assign arrayList to List component dataSource

    - by user1814467
    I'm creating an online game where people log in and then have the list of current players displayed. When the user enters a "room" it dispatches an SFSEvent which includes a Room object with the list of users as User objects in that room. As that event's callback function, I get the list of current users which is an Array, switch the View Stack child index, and then I wrap the user list array in an ArrayList before I assign it to the MXML Spark List component's dataSource. Here's my code: My Actionscript Code Section (PreGame.as): private function onRoomJoin(event:SFSEvent):void { const room:Room = this._sfs.getRoomByName(PREGAME_ROOM); this.selectedChild = waitingRoom; /** I know I should be using event listeners * but this is a temporary fix, otherwise * I keep getting null object errors * do to the li_users list not being * created in time for the dataProvider assignment **/ setTimeout(function ():void { const userList:ArrayList = new ArrayList(room.userList); this.li_users.dataProvider = userList; // This is where the error gets thrown },1000); } My MXML Code: <?xml version="1.0" encoding="utf-8"?> <mx:ViewStack xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="preGame_initializeHandler(event)" > <fx:Script source="PreGame.as"/> <s:NavigatorContent id="nc_loginScreen"> /** Login Screen Code **/ </s:NavigatorContent> /** Start of Waiting Room code **/ <s:NavigatorContent id="waitingRoom"> <s:Panel id="pn_users" width="400" height="400" title="Users"> /** This is the List in question **/ <s:List id="li_users" width="100%" height="100%"/> </s:Panel> </s:NavigatorContent> </mx:ViewStack> However, I keep getting this error: TypeError: Error #1010: A term is undefined and has no properties Any ideas what I'm doing wrong? The arrayList has data, so I know it's not empty/null.

    Read the article

  • loaderInfo null inside creationComplete handler function

    - by Thiago
    Hi, I've coded this small snippet to show what I'm not understanding: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> public function init():void { txtName.text = this.loaderInfo.toString(); } </mx:Script> <mx:TextInput x="50" y="10" id="txtName"/> </mx:Application> I'm getting the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at Teste/init()[C:\Lucas\flex\AppName\src\Teste.mxml:5] at Teste/___Teste_Application1_creationComplete()[C:\User\flex\CornetaRecorder\src\Teste.mxml:2] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] 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.

    Read the article

  • TextArea component is null on applicationComplete event

    - by Alan G.
    I have a weird issue (weird because it is specific to one component) with applicationComplete in a fairly simple application. All the UI components are declared in MXML. I can access them all in applicationComplete, but not a spark.components.TextArea component, named taStatus here; it is null in the handler. MXML looks sort of like this (there are lots of other components, but nothing special) <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="710" minHeight="640" applicationComplete="onApplicationComplete(event)" width="710" height="640"> <mx:TabNavigator left="15" right="15" top="15" bottom="340" paddingTop="0"> <s:NavigatorContent label="General" width="100%" height="100%"> <s:Label x="93" y="71" text="Label" id="lblTest"/> </s:NavigatorContent> <s:NavigatorContent label="Status" width="100%" height="100%"> <s:TextArea id="taStatus" width="100%" height="100%" text="Startup." editable="false"/> </s:NavigatorContent> </mx:TabNavigator> <fx:Script source="main.as" /> </s:Application> Here is the handler in main.as protected function onApplicationComplete(event: FlexEvent) : void { lblTest.text = 'abc789'; // OK taStatus.text = 'abc789'; // Fail } TypeError: Error #1009: Cannot access a property or method of a null object reference. So taStatus is null... What is so special about this TextArea?

    Read the article

  • Flex 3 (Action Script): How to access a function from a loaded swf-file ?

    - by Trantec
    Hi, i load in ActionScript a swf file. So far no Problem, but I didn't found a way to access one of it's functions, the best thing would be if I could access the main function in the mxml part of the swf. Here is the code of the main-mxml file that belongs to the swf that should load and access another swf: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="basket();"> <mx:Script> <![CDATA[ import mx.controls.SWFLoader; private function basket(): void { var swfLoader: SWFLoader = new SWFLoader(); swfLoader.addEventListener( Event.COMPLETE, handleSWFLoaded ); try { swfLoader.load( "../../data/InternalSWF.swf" ); } catch (error: Error) { trace( "Couldn't load file !" ); } } private function handleSWFLoaded( event: Event ): void { var swfApp:* = event.target.content; // This both ways don't work... //if (swfApp.hasOwnProperty("initApp")) { // var initApp:Function = (swfApp["initApp"] as Function); // initApp(); //} // swfApp.initApp(); } ]]> </mx:Script> <mx:Text id="output" width="100%" textAlign="center" /> </mx:Application> The if-Statement "if (swfApp.hasOwnProperty("initApp")) {" is never true and the call "swfApp.initApp()" says that this function does not exist. In the original version I added event listeners for HTTPStatusEvent.HTTP_STATUS, IOErrorEvent.IO_ERROR and SecurityErrorEvent.SECURITY_ERROR. But except for HTTP_STATUS = 0 none of them are called. Is the whole idea of how i try to do this wrong ?

    Read the article

  • How do I change the application background color at run-time in a Flex 3.5 application?

    - by Adam Tuttle
    I have a Flex 3.5 application that will serve multiple purposes, and as part of the visual changes that I'd like to make to indicate which mode the application is in, I want to change its background color. Currently, the application tag looks like this: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="ventures.view.component.*" xmlns:views="ventures.view.*" layout="absolute" preinitialize="onPreInitialize()" creationComplete="onCreationComplete()" applicationComplete="onApplicationComplete()" click="onClick(event)" enabled="{(!chainController.generalLocked)}" backgroundGradientColors="[0xFFFFFF, 0xFFFFFF]" > I've tried using a binding, for both the backgroundColor and backgroundGradientColors attributes: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ... backgroundColor="{app_background_color}" > —and— <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ... backgroundGradientColors="{app_background_color}" > but for the former binding is not allowed, and for the latter there is a warning that: Data binding will not be able to detect assignments to "app_background_color". I also ran across this page which seems to indicate that I could do it with the setStyle() method, but the documentation seems to indicate that this method is only available for components, not the main canvas. I suppose I could wrap everything in a <mx:Canvas></mx:Canvas> specificially for this purpose, but that seems wasteful—like Div-itis in HTML or something. What's the best way to change the main application background color at run-time?

    Read the article

  • AS3 OOP MVC with PHP

    - by Pepe Sanchez
    Im new to ActionScript and Flex 3... im trying to develop an MVC 100% OOP application with Flex 3 using MXML,AS3 and PHP. M (PHP) V (MXML) C (AS3) The 3 layers i choose for my development. I have 10 AS3 classes that are object related between them and some inherit or implement interfaces. The only problem here is how to interact 100% OOP with my model. In this case my model has to be a PHP Class that needs to be called from AS3 (the controller). For example the AS3 class : Patient have a method called Save: public function Save(data:Array) : void { /* PHP call - model layer */ } I want to create an instance of my PHP Patient Model class that connects to the DB and insert the data array into it. What should i use ? how can i also return a variable to AS3 ? What happen to as3 if there is a cached Exception in PHP ? Thanks in advanced :)

    Read the article

  • How can I define custom 'contentGroups' in a custom Flex 4 component?

    - by swidnikk
    The spark panel component for example can be written like this And its skin file will handle layout of the contentGroup, controlBarGroup, and titleDisplay. Notice, however that the contentGroup is doesn't appear in the code above and that the controlBarGroup accepts child mxml components. Now say I want to create a custom component that defines various required and non-required skinparts, such as 'headerGroup', 'navigationGroup', and 'accountPreferencesGroup'. I'd like to write this custom component like this The motivation here is that I can now create a couple different skin files to change the look and layout of those subgroups. Reading source of the spark panel, there are some calls within the mx_internal namespace such as getMXMLContent() which is a method of the spark group component, but which I have no access to. Does the description above make sense? How can I create custom 'contentGroups' in my custom Flex4 component that can use nested mxml child components? Should I approach this a different way?

    Read the article

  • adobe flash buider (flex4): addChild() is not available in this class.

    - by ufk
    Hi. I want to be able to load an swf into a flex 4 application in order to use it's classes. var ldr:Loader=new Loader(); ldr.load(new URLRequest("file://path/to/fileswf")); ldr.contentLoaderInfo. addEventListener(Event.INIT, loaded); function loaded(evt:Event):void { addChild(ldr); } i receive the error: Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one. at spark.components.supportClasses::SkinnableComponent/addChild()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:966] at main/private:init/loaded()[C:\Documents and Settings\ufk\Adobe Flash Builder Beta 2\xpogames-toolkit-test\src\main.mxml:22] if i change addChild() to addElement() i receive the following compilation error: 1067: Implicit coercion of a value of type flash.display:Loader to an unrelated type mx.core:IVisualElement. main.mxml path/dir line 22 Flex Problem any ideas how to resolve the issue ?

    Read the article

  • Pass HTML-DOM to Flex's actionscript.

    - by raj
    Hi, All i want is to pass a HTML-Form (DOM object) from javascript to Actionscript. i saw this article on the net and tried a similar code. But when i execute the code in IE, it alerts : "Out of memory at line 18". I'm stuck here from yesterday. i'll post the mxml and html here.. The MXML : <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> <![CDATA[ public function init() : void { if (ExternalInterface.available) { try { ExternalInterface.addCallback("populateFlashFile", populateFlashFile); } catch (error:SecurityError) { } catch (error:Error) { } } } public function populateFlashFile(window:*) : void { log.text = window.toString(); // just for checking if window has come to the function. window.document.write("Hello"); } ]]> </mx:Script> <mx:TextArea x="10" y="23" width="712" height="581" id="log"/> </mx:Application> The HTML : <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body scroll="no"> <input type="button" onclick="document.getElementById('Test').populateFlashFile(window);"/> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="Test" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="Test.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> </object> </body> </html> The problem occors only when i pass some DOM object, if i pass some String it works.!!! i.e : <input type="button" onclick="document.getElementById('Test').populateFlashFile('some text here');"/> works great!

    Read the article

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