0 Replies Latest reply on Nov 28, 2010 11:50 AM by Zombiecook KochtVorWut

    how to call a function that is in an swf file from flex ?

    Zombiecook KochtVorWut

      Hi,
      I want to call a function that is in an swf that was made in flash.
      So no oop or something like that.

       

      function customfunction(imageURL:String):void {
         PicVar = imageURL;
      }
      

       

      That was the function that i want to call from my Application ,that looks like this:

       

      <?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">
      
           <fx:Script>
              <![CDATA[
                  import mx.events.FlexEvent;
      
                     protected function SWF_creationCompleteHandler(event:FlexEvent):void  {
                           SWF.content.customfunction("'image.jpg'");
                     }
              ]]>
          </fx:Script>
      
           <mx:SWFLoader id="SWF" source="File.swf" creationComplete="CrCompleteHandler(event)" />
      </s:Application>
      

       

      It would be alos nice to know if its possible to simply edit some vars.

       

      Iam happy about any suggestions.

       

      Greetings
      ZombCook