Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411722 Posts in 69402 Topics- by 58450 Members - Latest Member: FezzikTheGiant

May 22, 2024, 02:37:47 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Embedded SWF and currentFrame
Pages: [1]
Print
Author Topic: Embedded SWF and currentFrame  (Read 1733 times)
mirosurabu
Guest
« on: April 15, 2010, 07:53:23 PM »

I am embedding SWF into my Flash Develop class.

I create an instance of it and add it to stage. It appears.

I try to check currentFrame but the trace reveals 0 at all times.

Code:
		[Embed(source = '../../../gameshed/logo_integration/_flash/logo.swf')]
private var GSMainTimeline:Class;

public var gslogo:MovieClip;

public function GSSplash()
{
gslogo = new GSMainTimeline();
gslogo.scaleX = 0.65;
gslogo.scaleY = 0.65;
gslogo.y = 60;

gslogo.addEventListener(Event.ENTER_FRAME, onLogoEnterFrame);
gslogo.play();

addChild(gslogo);
}

private function onLogoEnterFrame(e:Event):void
{
if (e.target.currentFrame >= e.target.totalFrames)
{
FlxG.switchState(JWSplash);
gslogo.removeEventListener(Event.ENTER_FRAME, onLogoEnterFrame);
}
}

What am I doing wrong?

I recurrently have this issue with SWF preloaders.
Logged
grapefrukt
Level 1
*



View Profile WWW
« Reply #1 on: April 15, 2010, 09:58:09 PM »

can you see the clip playing at all?
Logged
st33d
Guest
« Reply #2 on: April 16, 2010, 05:02:24 AM »

Not sure what it could be but I do know for one that any embedded swf will have all actionscript scrubbed from it. There might be additional damage.

Consider loading the swf perhaps?
Logged
mirosurabu
Guest
« Reply #3 on: April 16, 2010, 11:17:12 AM »

The clip is playing and all it's just I can't control its playing. I don't know why.
Logged
agj
Level 10
*****



View Profile WWW
« Reply #4 on: April 16, 2010, 04:57:34 PM »

Could be that it was written in AS2. I know it becomes more difficult to do stuff that way.
Logged

mirosurabu
Guest
« Reply #5 on: April 16, 2010, 11:13:16 PM »

It's AS3 ):

The workaround was LocalConnection, of course, but I really don't understand why I can't control embedded SFW from within the class I embed it into.
Logged
st33d
Guest
« Reply #6 on: April 17, 2010, 03:54:59 AM »

That's pretty odd behaviour. I'm able to do it myself.

All of the characters in the game I'm currently making have been put together as MovieClips in the Flash IDE and are then embedded as separate classes.

Is is the swf as a whole you're trying to manipulate? If you were importing it as a class, maybe it would play ball (which is what I'm doing with my clips).
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic