Hi i am currently designing a site inwhich all the sections are loaded into an empty movieclip, all the code to control the button within each loaded movieclip and the loading of all movieclips is on the main SWF file, the code is below:
[AS]stop();
var blank:Sprite = new Sprite();
holder.addChildAt(blank, 1);
homeBut.addEventListener(MouseEvent.CLICK, loadWeb);
function loadWeb(evt:Event):void {
trace(“web 1 loaded”);
var pageLoader:Loader = new Loader();
var pageURLReq:URLRequest = new URLRequest ( “pages/AS3 Portfolio Main.swf”);
var swf:MovieClip;
pageLoader.load(pageURLReq);
pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(evt:Event):void {
//removeChild(homeBut);
holder.addChildAt(pageLoader.content, 1 );
holder.removeChildAt(2);
swf = evt.target.content;
var button:MovieClip = swf.paper2.websiteBttn;
var button2:MovieClip = swf.paper3.vidBttn;
var button3:MovieClip = swf.homeBttn;
button.addEventListener(MouseEvent.CLICK, openWeb);
button2.addEventListener(MouseEvent.CLICK, openVids);
button3.addEventListener(MouseEvent.CLICK, loadWeb);
}
function openWeb(e:Event):void {
var pageLoader:Loader = new Loader();
var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Web.swf");
var swf:MovieClip;
pageLoader.load(pageURLReq);
pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(evt:Event):void {
holder.addChildAt(pageLoader.content, 1 );
holder.removeChildAt(2);
swf = evt.target.content;
var button:MovieClip = swf.web2.pacBttn;
var button3:MovieClip = swf.homeBttn;
button.addEventListener(MouseEvent.CLICK, openPac);
button3.addEventListener(MouseEvent.CLICK, loadWeb);
}
function openPac(evt:MouseEvent):void {
var pageLoader:Loader = new Loader();
var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Pac Images.swf");
var swf:MovieClip;
pageLoader.load(pageURLReq);
pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(evt:Event):void {
holder.addChildAt(pageLoader.content, 1 );
holder.removeChildAt(2);
}
}
}
function openVids(e:Event):void {
removeChild(homeBut);
var pageLoader:Loader = new Loader();
var pageURLReq:URLRequest = new URLRequest ( “pages/AS3 Portfolio Vids.swf”);
pageLoader.load(pageURLReq);
var swf:MovieClip;
pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
function imageLoaded(evt:Event):void {
holder.addChildAt(pageLoader.content, 1 );
holder.removeChildAt(2);
swf = evt.target.content;
var button4:MovieClip = swf.homeBttn;
button4.addEventListener(MouseEvent.CLICK, loadWeb2);
function loadWeb2(evt:Event):void {
swf.R8Vid.ns.pause();
loadWeb();
}
}
}
}[/AS]
As you can see in the last function “loadWeb2” which is activated via the ideo section i want the video to stop playing and then the top function of “loadWeb();” to be re-inizialized, but some some reson i cannot run that “loadWeb();” function again i just get this error:
[AS]ArgumentError: Error #1063: Argument count mismatch on FlashAS3Portfolio4_fla::MainTimeline/loadWeb(). Expected 1, got 0.
at MethodInfo-14() [/AS]
I have been trying to solve the stopping of this video for quite some time now with no success and its really doing my head in now so i would really appreciate any help that can be given thanks.