Advertisement

08.13.2008 at 02:10AM PDT, ID: 23643966
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4

flex3/air calling functions in embedded swf problem

Asked by ben_ek in Adobe Flex, ActionScript

Tags: , ,

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 so i'm rewarding the maximum number of points to the solution provider.

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.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
//this works	
 
<mx:Panel  backgroundColor="#FFFFFF" width="280" height="130" layout="vertical" id="mp3PreviewPanel" title="Track preview (drag track to play)" dragDrop="audioDragDrop(event);" dragEnter="audioDragEnter(event);" >
 
	<mx:SWFLoader id="myMP3player" source="mp3player.swf" />
        
	</mx:Panel>
 
 
 
var mc:MovieClip = MovieClip(myMP3player.content);
mc.loadMP3Player("file:///"+path, artist, title);
 
 
//--------------------------------
 
//this doesn't work (exactly the same as above except swf is embedded). swf appears in app ok.
 
	<mx:Panel  backgroundColor="#FFFFFF" width="280" height="130" layout="vertical" id="mp3PreviewPanel" title="Track preview (drag track to play)" dragDrop="audioDragDrop(event);" dragEnter="audioDragEnter(event);" >
 
          <mx:SWFLoader id="myMP3player"  source="[Embed(source='mp3player.swf')]" />
        
	</mx:Panel>
 
var mc:MovieClip = MovieClip(myMP3player.content);
 mc.loadMP3Player("file:///"+path, artist, title);
 
//ReferenceError:Error #1069 Property loadMP3Player not found
 
 
//-------
 
//this doesn't work either (swf appears in app ok)
 
[Embed(source=".mp3player.swf")]
[Bindable] 
public var mp3PlayerClass:Class;
 
[Bindable] 
public var myMP3playerClip:MovieClip= new mp3PlayerClass();
 
 
 
     <mx:SWFLoader id="myMP3player"  trustContent="true" source="{myMP3playerClip}"  />
 
 
 
var mc:MovieClip = MovieClip(myMP3player.content);
//this call doesn't work 
mc.loadMP3Player("file:///"+path, artist, title);
//this call doesn't work either
myMP3playerClip.loadMP3Player("file:///"+path, artist, title);
//this call doesn't work either
myMP3playerClip.content.loadMP3Player("file:///"+path, artist, title);
 
//ReferenceError:Error #1069 Property loadMP3Player not found
 
 
[+][-]08.20.2008 at 08:31AM PDT, ID: 22270739

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Adobe Flex, ActionScript
Tags: as3 / flex 3 / air, flex3 air, ReferenceError:Error #1069 Property loadMP3Player not found
Sign Up Now!
Solution Provided By: ben_ek
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628