Loading external SWF - Sound no visual!!

By jhaddington | Jul 10, 2009

actionscript3

Hi Guys,

I’m having a little issue with a system I am trying to build….

On a button click the page loads and external swf using the add child function. Once loaded the user can close the "pop up" at any time by clicking the close button. The swf appears without a problem first time round, it is if they go back to click again that causes the problem. If they then try and click the button to view the external swf for another time then no visuals appear - you can hear sound but the videos never appear. I have tried to see if it is hiding behind something to no avail. Can anyone help?

Edited code is below!!

Cheers :D

ActionScript Code:
var multiPlayer:Loader = new Loader(); var playerRequest:URLRequest = new URLRequest(“vgallery_multi.swf”); function showQAMultiple(Event:MouseEvent) {         if (alreadyLoaded == 0) {         content_qa.addChild(greyBackground);         content_qa.addChild(btnClose);         btnClose.alpha = 0;         btnClose.x = 405;         btnClose.y = -183;         alreadyLoaded=1;     }     var bgZoomW:Tween = new Tween(greyBackground, “scaleX”, Strong.easeOut, 0, 1, 20, false);     var bgZoomY:Tween = new Tween(greyBackground, “scaleY”, Strong.easeOut, 0, 1, 20, false);     var bgAlpha:Tween = new Tween(greyBackground, “alpha”, Strong.easeOut, 0, 1, 20, false);     bgAlpha.addEventListener(TweenEvent.MOTION_STOP, onMotionStopped);         function onMotionStopped(event:TweenEvent):void {         multiPlayer.load(playerRequest);         multiPlayer.x = -395;         multiPlayer.y = -200;         content_qa.addChild(multiPlayer);                 var closeAlpha:Tween = new Tween(btnClose, “alpha”, Strong.easeOut, 0, 1, 20, false);         btnClose.addEventListener(MouseEvent.MOUSE_UP,hideQAMultiple);         btnClose.mouseEnabled = true;         MovieClip(parent).btn_next4.mouseEnabled = false;         MovieClip(parent).btn_back3.mouseEnabled = false;     }         function hideQAMultiple(Event:MouseEvent) {         trace(“Removing all children…”);         var bgZoomW:Tween = new Tween(greyBackground, “scaleX”, Strong.easeOut, 1, 0, 10, false);         var bgZoomY:Tween = new Tween(greyBackground, “scaleY”, Strong.easeOut, 1, 0, 10, false);         var bgAlpha:Tween = new Tween(greyBackground, “alpha”, Strong.easeOut, 1, 0, 10, false);                 var closeAlpha:Tween = new Tween(btnClose, “alpha”, Strong.easeOut, 1, 0, 10, false);         btnClose.removeEventListener(MouseEvent.MOUSE_UP,hideQAMultiple);         btnClose.mouseEnabled = false;                 MovieClip(parent).btn_next4.mouseEnabled = true;         MovieClip(parent).btn_back3.mouseEnabled = true;         content_qa.removeChild(multiPlayer);         multiPlayer.unload();     }

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0