Web Design Forum: Need a hand with some unload of an swf - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Need a hand with some unload of an swf Rate Topic: -----

#1 User is offline   trager 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-June 11
  • Reputation: 0

Posted 13 June 2011 - 08:52 PM

I have a video background wherefrom I load another swf through a build in pop up. I have a button in the loaded swf from where I need the popup to unload and go back to the video background. Im not very experienced in flash and haven't build this myself so im a little lost. underneath is first the code which is in my video background and then the code in my loaded swf. hope someone can help. The highlighted bits is the ones where i have attempted to have the loaded swf to unload


Video Background:

Quote

import VideoBg;

var videos:Array=new Array('videos/bird_short.f4v','videos/kanin.f4v');
var num:uint=1;

var vid:VideoBg=new VideoBg(videos[index]);
var index:int = videos[Math.floor(Math.random()*videos.length)];

addChild(vid);
setChildIndex(vid,0);

videobtn.buttonMode = true;
pictures.visible=true;

videobtn.addEventListener(MouseEvent.CLICK,toggleVideoF);
function toggleVideoF(e:MouseEvent):void{
index=(index+1)%videos.length;
vid.playF=videos[index];
videobtn.gotoAndStop(index+1);
}


stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, position);
stage.addEventListener(MouseEvent.CLICK, startIgen);
position(null);
function position(Event=null):void {
var SH=stage.stageHeight;
var SW=stage.stageWidth;

}
MinKnap.addEventListener(MouseEvent.CLICK, MinFunktion);
function MinFunktion(e:Event):void {
e.stopImmediatePropagation();
vid.ns.pause();
MinKnap.visible=false;
videobtn.visible=false;
popUp('start2.swf','swf',null,900,700,0);
}

pictures.addEventListener(MouseEvent.CLICK, picturesFunktion);
function picturesFunktion(e:Event):void {
e.stopImmediatePropagation();
vid.ns.pause();
MinKnap.visible=false;
videobtn.visible=false;
pictures.visible=false;
popUp('gallery_rabbit_picture.swf','swf',null,900,700,0);
}

function startIgen(Event):void {
MinKnap.visible=true;
videobtn.visible=true;
pictures.visible=true;
vid.ns.resume();
}
function popUp(con,typ,tit=null,wid=550,hei=400,alp=0.7):void {
ExternalInterface.call("Shadowbox.open",{content: con, player: typ, title: tit, width: wid, height: hei, options: {overlayOpacity:alp}});
}


function unloadFunction_rabit_gallery(event:Event):void {
popUp.unload();
MinKnap.visible=true;
videobtn.visible=true;
pictures.visible=true;
vid.ns.resume();
}

popUp.addEventListener("UnloadMe", unloadFunction_rabit_gallery);



Loaded swf:

Quote

back03_btn.addEventListener(MouseEvent.CLICK,back_rabit)
function back_rabit(event:MouseEvent):void
{

//MovieClip(parent.parent).gotoAndStop("frontpage2")
parent.dispatchEvent(new Event("UnloadMe", true));

}


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users