Am a newbie to AS 3.0, am trying access the MainTimeLine from a movieClip instance added from Library.
Am able to remove the same instance, but am not able to navigate to MainTim
Code:
// Doesn't Work
wellPlayed(root).gotoAndStop(120);
// This removal works fine.
parent.removeChild(wellPlayed);
am sure am doing something silly here is the full code:
Code:
public class BallMc extends MovieClip
{
protected var originalPosition:Point;
public function BallMc()
{
originalPosition = new Point(x, y);
buttonMode = true;
addEventListener ( MouseEvent.MOUSE_DOWN, down );
}
protected function down (event:MouseEvent) :void
{
parent.addChild(this);
startDrag ();
stage.addEventListener ( MouseEvent.MOUSE_UP, stageUp );
}
protected function stageUp(event:MouseEvent ):void
{
stage.removeEventListener( MouseEvent.MOUSE_UP, stageUp );
stopDrag();
if( dropTarget )
{
if( dropTarget.parent.name == "basket")
{
scaleX = scaleY = 0.2;
alpha = 0.2;
y = stage.stageHeight - height - 10;
buttonMode = false;
removeEventListener( MouseEvent.MOUSE_DOWN, down );
var wellPlayed : WellPlayed = new WellPlayed();
parent.addChild(wellPlayed);
wellPlayed.x = stage.stageWidth / 2;
wellPlayed.y = stage.stageHeight / 2;
wellPlayed.addEventListener(MouseEvent.CLICK, wellClick);
function wellClick(event:MouseEvent):void
{
wellPlayed(root).gotoAndStop(120);
parent.removeChild(wellPlayed);
wellPlayed.removeEventListener(MouseEvent.CLICK, wellClick);
}
}else{
returnToOriginalPosition();
}
}else{
returnToOriginalPosition();
}
}
protected function returnToOriginalPosition():void
{
x = originalPosition.x;
y = originalPosition.y;
}
}
If you still have problems it would be easier to see your files, if you can attach them
Hi there,
Apparently the PHP code didn't help me.
I have attached my files for you, i would really appreciate if you have a loot at the files.
And point me in the right direction further.
With the new protected function, it does executes the removeEventListener part.
but still the following part is not executing, so that my MainTimeline stops at frame number 120:
I think after sending you the first version file, i have tested one more version with more redundant codes.
I think that was the issue. Now it works fine.
Really appreciate your help & Cheers!
I can't treat you as PayPal operations are limited in India