topical media & game development

talk show tell print

flex-component-call-property.mx

flex-component-call-property.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[#ffffff, #ffffff]" width="400" height="200">
          <mx:Script>
                  <![CDATA[
                          import flx.external.FlashInterface;
                          import flx.events.FlashInterfaceEvent;
                          import mx.controls.Alert;
                          
                          private var sendToSwfId:String;
                          
                          [Embed(source="local/flex/assets/images/flex_icon.png")]
                          [Bindable]
                          public var logo:Class;
                          
                          private function exec():void
                          {
                                  var sendToSwfId:String = Application.application.parameters.sendToSwfId;
                                  FlashInterface.call(sendToSwfId + ".output.text", txtInput.text);
                          }
                          
                          private function clearOutput():void
                          {
                                  txtInput.text = "";
                                  exec();
                          }
                  ]]>
          </mx:Script>
          <mx:Canvas cornerRadius="8" borderStyle="solid" left="5" top="5" bottom="5" right="5">
                  <mx:Button y="156" label="Clear" click="clearOutput()" right="10"/>
                  <mx:TextArea x="10" y="97" width="368" height="51" id="txtInput" change="exec()"/>
                  <mx:Image x="330" y="10" width="48" height="48" source="{logo}" scaleContent="false"/>
                  <mx:Text x="10" y="70" fontSize="11" text="This call will tell the receiver to display the message." width="368"/>
          </mx:Canvas>
          <mx:Label x="14" y="6" text="Flash 9 - Call Property" fontWeight="bold" fontStyle="italic" fontSize="16" fontFamily="Arial" color="#cc0000"/>
          <mx:Label x="14" y="33" text="FlashInterface.call" fontWeight="bold" fontSize="12"/>
  </mx:Application>
  


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.