10 Replies Latest reply on Aug 15, 2008 9:04 AM by info_ek

    flex3/air calling functions in embedded swf problem

      i'm a newbie to flex 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. see the code snippet for my details.

      any help will be really appreciated.

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

      -------------------------------------------------code excerpt--------------------------------------------------