0 Replies Latest reply on Aug 13, 2008 10:05 AM by info_ek

    trouble comunicating from flex to swf, when the swf is embedded

    info_ek
      i'm a newbie to flex/air so i'm hoping there is going to be a simple answer to this problem. it's caused a massive headache!

      i have been using a swfLoader to load a swf, then triggering function calls within the swf from flex by using the following in the script tag of my mxml

      var mc:MovieClip = MovieClip(myMP3player.content);
      mc.loadMP3Player("file:///"+path, artist, title);

      where loadMP3Player is the function in the linked swf and myMP3player is the id of the swfLoader.

      this works great, no problems... but when i change the code so that the swf is embedded, rather than loaded at runtime the code above gives a

      "ReferenceError:Error #1069 Property loadMP3Player not found" error

      when i try to trigger the function.

      i have tried many different ways of referencing and embedding the swf, all have the same result. i.e. swf loads fine and the flex project compiles without errors, but i am unable to call the function.

      how do i reference the function in the swf when the swf is embedded?

      any help will be really appreciated.

      btw: i need to embed the swf as i am distributing the finished article as an air app.