Harvid
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Harvid
-
-
Ok now its working
just for the help of other beginners her is the code
subloaded swf
var video:VideoLoader = new VideoLoader("SWFS/videos/1.f4v", {name:"Contactvideo", repeat:-1, autoPlay:true, container:con1, width:1024, height:428, scaleMode:"proportionalInside", requireWithRoot:this.root}); video.load(); function destroy():void { video.dispose(true); }
main .swf
var con1:ContentDisplay = LoaderMax.getContent("menymainClip1"); con1.rawContent.destroy()
and thank you for explaining it for me
-
I think i understand.
i have no idea how to duit,
the button ther stop the loadet video is in the main swf and the video is in a subloaded swf.
do you know wher i can find a example how to du it, Sorry i'm not good to coding, i am a designer
and this is the last thing before i can uploade my side.
-
My crestion is how do i clean up the loaders for videos,
the videos is loaded in whit loadermax inbetted insight .swf
i have tryed to .empty(true,true) and removeChild. so the dispose(true) was just another trat
// CLEAN UP queuemeny2 FOR OLDE VIDEOS switcher = 1; queuemeny1.append( new SWFLoader("SWFS/MAIN/"+event.target.name+".swf", {name:"menymainClip1",onInit:initHandler, alpha:0, container:this, y:86, autoPlay:false})); queuemeny1.load(); trace("første") } else { // CLEAN UP queuemeny1 FOR OLDE VIDEOS switcher = 0; queuemeny2.append( new SWFLoader("SWFS/MAIN/"+event.target.name+".swf", {name:"menymainClip2",onInit:initHandler, alpha:0, container:this, y:86, autoPlay:false})); queuemeny2.load(); trace("anden")
-
Hey
it works in the start loader,
when i add it to the loader sequins, it seems like it kill the loader max totaly.
have repaired the test file so it shouldn't make any errors now when testing, and sorry for that :-S
-
i cannot figure out how to stop the video insight the loadet .swf
i have tryed to .empty(true) and removeChild.
but the video seems to be running in the background,and dragging my olde test computer down in graphic performance.
please help me. i almost can't take anymore code problems
-
i trying to incorporate the code in my project
a22.swf don't seems to be a part of the queue1 in loader.swf
my traces:
found SWFLoader 'childLoader' (a22.swf)childLoader took 0.003 seconds to load 20000 bytes.
completeHandler don
SWFLoader 'childLoader' (a22.swf) is complete!
-
its dreving me crasy
i found this post
Once your SWFLoader fires its INIT event, that means it has loaded enough to look for loaders in the swf and begin loading them (if any are found). You can get any loader by name or url using LoaderMax.getLoader(). The latest version of LoaderMax (updated today) has a new "loadTime" property for all loaders which tells you how many seconds it took to load. So let's say you have a loader named "childLoader" inside your child swf that the SWFLoader is loading - you could get that like this:Code: Select all
var loader:SWFLoader = new SWFLoader("child.swf", {onInit:initHandler, onComplete:completeHandler});
function initHandler(event:LoaderEvent):void {
var childLoader:LoaderMax = LoaderMax.getLoader("childLoader") as LoaderMax;
trace("found " + childLoader);
}
function completeHandler(event:LoaderEvent):void {
var childLoader:LoaderMax = LoaderMax.getLoader("childLoader") as LoaderMax;
trace("childLoader took " + childLoader.loadTime + " seconds to load " + childLoader.bytesTotal + " bytes.");
}
loader.load();
Does that answer your question?
and its don't seems to work
in my loader the code is
import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var loader:SWFLoader = new SWFLoader("a33.swf", {onInit:initHandler, onComplete:completeHandler}); addChild(loader.content) function initHandler(event:LoaderEvent):void { var childLoader:LoaderMax = LoaderMax.getLoader("childLoader") as LoaderMax; // trace("found " + childLoader); } function completeHandler(event:LoaderEvent):void { var childLoader:LoaderMax = LoaderMax.getLoader("childLoader") as LoaderMax; // trace("childLoader took " + childLoader.loadTime + " seconds to load " + childLoader.bytesTotal + " bytes."); trace("completeHandler complete"); } loader.load();
in my childe loader the code is
import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var childLoader:SWFLoader = new SWFLoader("a22.swf",{onComplete:completeHandler}); addChild(childLoader.content) function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("a22.swf"); TweenLite.to(image, 1, {alpha:1}); trace(event.target + " is complete!"); } childLoader.load();
if i trace the
trace("childLoader took " + childLoader.loadTime + " seconds to load " + childLoader.bytesTotal + " bytes.");
trace("found " + childLoader);
i get a error
TypeError: Error #1009: Cannot access a property or method of a null object reference.at loader_fla::MainTimeline/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_completeHandler()
at com.greensock.loading::SWFLoader/_completeHandler()
SWFLoader 'loader1' (a22.swf) is complete!
and if skipping errors traces
completeHandler completeSWFLoader 'loader1' (a22.swf) is complete!
its seems to load the child's afterwards !
please help me
-
Hey
have a loader then ends in a loader, so people will see 2 loader sequence in a road. not goot at all.
I'm Looking For a solution for it wet loadermax. like the preloader.swf loads - startmeny.swf and its first childe About.swf
i have seen the requireWithRoot. bot i don't understand it, and i cannot finde any (copy /paste) examples to figure it out
cut you please show me a loader wits has it incorporated, or maby you hav a better idea how to do it ?
agen sorry for my bad english
-
its works now
this.stage.addEventListener(Event.FULLSCREEN, fullScrHandler3); function fullScrHandler3(event:FullScreenEvent):void { if (stage.displayState == StageDisplayState.NORMAL) { this.stage.removeEventListener(Event.FULLSCREEN, fullScrHandler3); queuepp1.empty(true, true); queuepp2.empty(true, true); gotoAndStop(4); }}
i detent understand the addEventListener wasn't remove what the .empty(true, true);
Thank you so mutch
-
hey
why I believed empty detent works is
firste time i using the "fullScrHandler3()" all works
if loading a new .swf like (g1.swf) then its crash
if I have empty the previous loaded shut is be like first time every time
the code is the same in all loadet (g1 to g8)
function k9CLICK(event:MouseEvent):void { imageNumber = 9; gotoAndStop(5); stage.displayState = StageDisplayState.FULL_SCREEN; } function k9Over(event:MouseEvent):void { TweenMax.to(k9, 0.7, {dropShadowFilter:{color:0xffffff, alpha:0.1, blurX:2, blurY:2, strength:100}}); TweenMax.to(k9, 0.7,{colorMatrixFilter:{saturation:1}}); } function k9Out(event:MouseEvent):void{ TweenMax.to(k9, 0.7, {dropShadowFilter:{color:0xffffff, alpha:0, blurX:0, blurY:0, strength:0}}); TweenMax.to(k9, 0.7,{colorMatrixFilter:{saturation:0.35}}); }
this.stage.addEventListener(Event.FULLSCREEN, fullScrHandler3); function fullScrHandler3(event:FullScreenEvent):void { if (stage.displayState == StageDisplayState.NORMAL) { queue1.empty(true, true); queue2.empty(true, true); gotoAndStop(4); }}
sorry for all my stupid christians but im really new in coding
could you please show me what you mean because i don't understand what i must do
-
Hey
i dont think the queue1/queue2 is ben empty of its contents
what am i doing wrong
function completeHandler2OK():void { queue1.empty(true, true); var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 1.5 , {alpha:1, onComplete:image2.rawContent.play}); switcher2 = 1; }
g2 is loaded into queue1
TypeError: Error #1009: Cannot access a property or method of a null object reference.at g2_fla::MainTimeline/fullScrHandler3()
at flash.display::Stage/set_displayState()
at flash.display::Stage/set displayState()
at g1_fla::MainTimeline/k9CLICK()
all code
import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; import flash.display.StageDisplayState; var ShowArray:Array = [g1, g2, g3, g4 ,g5, g6, g7, g8]; //////////////////////////////////////////////////////////// g1.addEventListener(MouseEvent.CLICK,Showclick) g2.addEventListener(MouseEvent.CLICK,Showclick) g3.addEventListener(MouseEvent.CLICK,Showclick) g4.addEventListener(MouseEvent.CLICK,Showclick) g5.addEventListener(MouseEvent.CLICK,Showclick) g6.addEventListener(MouseEvent.CLICK,Showclick) g7.addEventListener(MouseEvent.CLICK,Showclick) g8.addEventListener(MouseEvent.CLICK,Showclick) //////////////////////////////////////////////////////////// var switcher = 0; var switcher2 = 0; var queue1:LoaderMax = new LoaderMax({name:"mainQueue1", onProgress:progressHandler1, onComplete:completeHandler1/*, onError:errorHandler*/}); var queue2:LoaderMax = new LoaderMax({name:"mainQueue2", onProgress:progressHandler2, onComplete:completeHandler2/*, onError:errorHandler*/}); TweenLite.to(preloadText, 0 , {alpha:0}); function Showclick(event:MouseEvent):void{ trace(event.target.name + " load"); if (switcher == 0){ queue1.empty(true, true); queue1.append( new SWFLoader("SWFS/SHOWCASES/"+event.target.name+".swf", {name:"mainClip1", alpha:0, container:this, y:86, autoPlay:false})); queue1.load(); switcher = 1; trace("første") } else { queue2.empty(true, true); queue2.append( new SWFLoader("SWFS/SHOWCASES/"+event.target.name+".swf", {name:"mainClip2", alpha:0, container:this, y:86, autoPlay:false})); queue2.load(); switcher = 0; trace("anden") } } ////////////////loader queue 1////////////////////////////////////////// function progressHandler1(event:LoaderEvent):void { preloadText.text = ("Loading " + Math.round(event.target.progress*100).toString() + "%"); TweenLite.to(preloadText, 1.0 , {alpha:1}); if (switcher2 == 1){ //clip exists var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 1.5 , {alpha:0}); } } /*--------------------------------------------------------------*/ function completeHandler1(event:LoaderEvent):void { TweenLite.to(preloadText, 1.5 , {alpha:0}); if (switcher2 == 1){ var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 0.5 , {alpha:0, onComplete:completeHandler1OK}) } else { completeHandler1OK() }} /*--------------------------------------------------------------*/ function completeHandler1OK():void { queue2.empty(true, true); var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 1.5 , {alpha:1, onComplete:image1.rawContent.play}); } /////////////////loader queue 2////////////////////////////////////////////// function progressHandler2(event:LoaderEvent):void { preloadText.text = ("Loading " + Math.round(event.target.progress*100).toString() + "%"); TweenLite.to(preloadText, 1.0 , {alpha:1}); var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 1.5 , {alpha:0}); } /*--------------------------------------------------------------*/ function completeHandler2(event:LoaderEvent):void { TweenLite.to(preloadText, 1.5 , {alpha:0}); var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 0.5 , {alpha:0, onComplete:completeHandler2OK}) } /*--------------------------------------------------------------*/ function completeHandler2OK():void { queue1.empty(true, true); var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 1.5 , {alpha:1, onComplete:image2.rawContent.play}); switcher2 = 1; } ////////////////////////////////////////////////////////////
-
have found a solution
in the loadet .swf i moved the action key frame to frame 2
I do not understand it but it works
Thank you for the help
-
Hey
I can not get it to work with LoaderMax.
for some reason I can not get it to wait for the onComplete, it immediately start to play ?
queue1.append( new SWFLoader("test/"+event.target.name+".swf", {name:"mainClip1", alpha:0, container:this, y:86, autoPlay:false}))
TweenLite.to(image1, 1.5 , {alpha:1, onComplete:image1.rawContent.play});
import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; import flash.display.StageDisplayState; var ShowArray:Array = [g1, g2, g3, g4 ,g5, g6, g7, g8]; //////////////////////////////////////////////////////////// g1.addEventListener(MouseEvent.CLICK,Showclick) g2.addEventListener(MouseEvent.CLICK,Showclick) g3.addEventListener(MouseEvent.CLICK,Showclick) g4.addEventListener(MouseEvent.CLICK,Showclick) g5.addEventListener(MouseEvent.CLICK,Showclick) g6.addEventListener(MouseEvent.CLICK,Showclick) g7.addEventListener(MouseEvent.CLICK,Showclick) g8.addEventListener(MouseEvent.CLICK,Showclick) //////////////////////////////////////////////////////////// var switcher = 0; var switcher2 = 0; var queue1:LoaderMax = new LoaderMax({name:"mainQueue1", onProgress:progressHandler1, onComplete:completeHandler1/*, onError:errorHandler*/}); var queue2:LoaderMax = new LoaderMax({name:"mainQueue2", onProgress:progressHandler2, onComplete:completeHandler2/*, onError:errorHandler*/}); TweenLite.to(preloadText, 0 , {alpha:0}); function Showclick(event:MouseEvent):void{ trace(event.target.name + " load"); if (switcher == 0){ queue1.empty(true, true); queue1.append( new SWFLoader("test/"+event.target.name+".swf", {name:"mainClip1", alpha:0, container:this, y:86, autoPlay:false})); queue1.load(); switcher = 1; trace("første") } else { queue2.empty(true, true); queue2.append( new SWFLoader("test/"+event.target.name+".swf", {name:"mainClip2", alpha:0, container:this, y:86, autoPlay:false})); queue2.load(); switcher = 0; trace("anden") } } ////////////////loader queue 1////////////////////////////////////////// function progressHandler1(event:LoaderEvent):void { preloadText.text = ("Loading " + Math.round(event.target.progress*100).toString() + "%"); TweenLite.to(preloadText, 1.0 , {alpha:1}); if (switcher2 == 1){ //clip exists var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 1.5 , {alpha:0}); } } /*--------------------------------------------------------------*/ function completeHandler1(event:LoaderEvent):void { TweenLite.to(preloadText, 1.5 , {alpha:0}); if (switcher2 == 1){ var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 0.5 , {alpha:0, onComplete:completeHandler1OK}) } else { completeHandler1OK() }} /*--------------------------------------------------------------*/ function completeHandler1OK():void { var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 1.5 , {alpha:1, onComplete:image1.rawContent.play()}); queue2.empty(true, true); } /////////////////loader queue 2////////////////////////////////////////////// function progressHandler2(event:LoaderEvent):void { preloadText.text = ("Loading " + Math.round(event.target.progress*100).toString() + "%"); TweenLite.to(preloadText, 1.0 , {alpha:1}); var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 1.5 , {alpha:0}); } /*--------------------------------------------------------------*/ function completeHandler2(event:LoaderEvent):void { TweenLite.to(preloadText, 1.5 , {alpha:0}); var image1:ContentDisplay = LoaderMax.getContent("mainClip1"); TweenLite.to(image1, 0.5 , {alpha:0, onComplete:completeHandler2OK}) } /*--------------------------------------------------------------*/ function completeHandler2OK():void { var image2:ContentDisplay = LoaderMax.getContent("mainClip2"); TweenLite.to(image2, 1.5 , {alpha:1, onComplete:image2.rawContent.play}); switcher2 = 1; queue1.empty(true, true); } ////////////////////////////////////////////////////////////
-
I do not understand why it does not work
I get this error message
Scene 1, Layer 'action', Frame 1, Line 86 1119: Access of possibly undefined property play through a reference with static type flash.display:Loader.Scene 1, Layer 'action', Frame 1, Line 116 1119: Access of possibly undefined property play through a reference with static type flash.display:Loader.
what am I not doing right ?
-
hey
I can not figure out what I'm doing wrong
i just want the loaded swf to play after tweening is don
TweenLite.to(loader2, 2.5 , {alpha:1, onComplete:play});
there is a stop at frame 1 in the .swf
pleas help me i am really trying to learn, As you can see, not very nice looking code... :-s
sorry for my english
var ShowArray:Array = [g1, g2, g3, g4 ,g5, g6, g7, g8]; /////////////////////////////////////////////////////////////////////////////// TweenLite.to(preloader, 0 , {alpha:0}); g1.addEventListener(MouseEvent.CLICK,Showclick) g2.addEventListener(MouseEvent.CLICK,Showclick) g3.addEventListener(MouseEvent.CLICK,Showclick) g4.addEventListener(MouseEvent.CLICK,Showclick) g5.addEventListener(MouseEvent.CLICK,Showclick) g6.addEventListener(MouseEvent.CLICK,Showclick) g7.addEventListener(MouseEvent.CLICK,Showclick) g8.addEventListener(MouseEvent.CLICK,Showclick) var loader1:Loader = new Loader(); var loader2:Loader = new Loader(); var switcher = 0; function Showclick(event:MouseEvent):void{ if (switcher == 0) { loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded1); //loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress2); loader1.load(new URLRequest("test/"+event.target.name+".swf")); loader1.x = 0; loader1.y = 86; switcher = 1; trace("første") } else { loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded2); //loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress2); loader2.load(new URLRequest("test/"+event.target.name+".swf")); loader2.x = 0; loader2.y = 86; switcher = 0; trace("anden") } } ///////////////////////////////////// loader 1 ///////////////////////////////////// function loadMainx1():void { TweenLite.from(preloader.preloadText, 0.5 , {alpha:0}); } /*---------------------------------------------------------------------------------*/ function onProgress1(e:ProgressEvent):void { TweenLite.to(preloader, 0.5 , {alpha:1, onComplete:loadMainx1}); TweenLite.to(loader2, 1.5 , {alpha:0}); var percentage:Number = e.bytesLoaded / e.bytesTotal; preloader.preloadText.text = Math.ceil(percentage * 100).toString() + "%"; } /*---------------------------------------------------------------------------------*/ function onLoaded1(e:Event):void { TweenLite.to(preloader, 1 , {alpha:0, onComplete:loadMain1}); TweenLite.to(loader2, 1 , {alpha:0}); } /*---------------------------------------------------------------------------------*/ function loadMain1():void { TweenLite.to(loader1, 0 , {alpha:0}); addChild(loader1); TweenLite.to(loader1, 2.5 , {alpha:1, onComplete:play()}); removeChild(loader2); } ///////////////////////////////////// loader 2 ///////////////////////////////////// function loadMainx2():void { TweenLite.from(preloader.preloadText, 0.5 , {alpha:0}); } /*---------------------------------------------------------------------------------*/ function onProgress2(e:ProgressEvent):void { TweenLite.to(preloader, 0.5 , {alpha:1, onComplete:loadMainx2}); TweenLite.to(loader1, 1.5 , {alpha:0}); var percentage:Number = e.bytesLoaded / e.bytesTotal; preloader.preloadText.text = Math.ceil(percentage * 100).toString() + "%"; } /*---------------------------------------------------------------------------------*/ function onLoaded2(e:Event):void { TweenLite.to(preloader, 1 , {alpha:0, onComplete:loadMain2}); TweenLite.to(loader1, 1 , {alpha:0}); } /*---------------------------------------------------------------------------------*/ function loadMain2():void { TweenLite.to(loader2, 0 , {alpha:0}); addChild(loader2); TweenLite.to(loader2, 2.5 , {alpha:1, onComplete:play}); removeChild(loader1); }
loading count twice first time loading
in Loading (Flash)
Posted
loading count twice first time loading.
first time the site is loaded my preloader count twice
if im closing the browser and trying again it's only count onetime ?
see
www.harvid.dk/beta