3 Replies Latest reply on May 13, 2010 10:00 AM by Flex harUI

    What i am doing wrong, SWF file

    djh88ukwb Level 1

      Hello all,


      This is driving me crazy!


      I have made a flex app, that imports a swf file, converts it to a movie clip, and then pulls which frame to display from a XML file, that is checked every second.  This works fine when using the following SWF file - http://davidtest.webcastglobal.com/swf/flash.swf


      Although when i tried re-creating my own example - http://davidtest.webcastglobal.com/swf/flash2.swf
      my flex app fails to respond correctly.  THe swf file just loops thru all the frames in one go, and fails to take into account the XML file pointing at what frame to look at, and fails to look at the HTTPS service.


      Ok so here is an example of the app with both examples embeded.


      http://davidtest.webcastglobal.com/swfwork/Main.html - This is using the working swf file,


      http://davidtest.webcastglobal.com/swfbroke/Main.html - This is using the swf file that i have created.


      THe code that i am using to achieve this is as follows -


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="load()">   
                  import mx.rpc.events.ResultEvent;
                  [Bindable] public var dataDump:String = "datadump";
                  [Bindable] private var myText:String
                  private var flashMovie:MovieClip;
                  private function initMovie():void{
                      flashMovie = loader.content as MovieClip;
                  private function load():void{
                  private function handleImage(event:ResultEvent):void
                      myText = event.result.framelocation;
          <mx:SWFLoader id="loader" source="flash2.swf" complete="initMovie()" x="-9" y="-3"/>
          <mx:Button label="Next" click="flashMovie.nextFrame()" x="78" y="405"/>
          <mx:Button label="Previous" click="flashMovie.prevFrame()" x="0" y="405"/>
          <mx:Button label="4" click="flashMovie.gotoAndPlay(7)" x="156" y="405"/>
          <mx:HTTPService id="getImage" result="handleImage(event)" url="http://davidtest.webcastglobal.com/change.xml" method="POST">
              <mx:request xmlns="">
          <mx:Text x="817" y="10" text="Total: {myText}" width="157"/>


      My question is when creating my own swf file, what am i doing wrong?  Flex clearly isnt interacting with it in the same way as the original swf,  by the way, this swf was taken from a tutorial.


      If anyone could point me in a direction or offer help on this i would be thankful.  Im sure i am just missing something out when i create my swf in flash