spot on Alex! that did the job!
On 12 Jun 2008, at 06:23, Alex Harui wrote:
I would try meter.content.meter_mc.gotoAndStop(), but meter.swf
must be an ActionScript 3 swf published for player 9. Any player 8
or earlier content cannot be directly talked to.
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Mario Vieira
Sent: Wednesday, June 11, 2008 3:15 PM
To: [email protected]
Subject: [flexcoders] controlling a swf from SWFLoader
I'm working in a ISP Costumer Service page that allows the users to
upgrade/downgrade their bandwidth.
I have a swf that is a meter display, and this has a movie clip
whose timeline changes this meter pointer (like a speddedometer) in
accordance with the bandwidth value
I kinda got Flex controlling this loaded swf movie clip, but only
if the user clicks on it. Like an event that catches the movie clip.
but that still doesn't do the job :o
any thoughts would be well appreciated:
<mx:SWFLoader x="235" y="375" source ="@Embed('assets/swf/
meter.swf')" id="meter"/>
//it's called when its respective state is reached
private function getMeter():void
{
meter.addEventListener(MouseEvent.MOUSE_DOWN, updateMeter);
}
/*
it finds the movie clip, and assigns it an object
*/
private function updateMeter(e:MouseEvent):void
{
//this works, but I needed it to be reachable without a click!
var swfMovieClicked:Object = e.target;
swfMovieClicked.gotoAndStop(_meterValue);
//the loaded swf movie clip is not found through the
SWFLoader object at all:
//meter.meter_mc.gotoAndStop(_meterValue);
}