en en en en en en en en en en en en en en en en fa en en fr hbs_lat en en en es en en en de en en fr en en ca en en en en en en vi vi en en fr en en en en en en en fr en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en ru en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en vi en en en es en de en en en en en en en en en pl en de en en en en en en en fr cv es tr es en en en en ms en en en en en en fr en hbs_lat en en en en en en en fr cv es tr es en en en en de en en en ca en en en en en
Yes I can try to get some sample files to you. (I will email them) No reason in particular (but that may be my problem) just that I saw that code on a post somewhere and used it... Would you recommend I do this? _videoLoader.addEventListener(VideoLoader.VIDEO_BUFFER_EMPTY, videoBufferEmpty); _videoLoader.addEventListener(VideoLoader.VIDEO_BUFFER_FULL, videoBufferFull); protected function videoBufferEmpty(event:LoaderEvent):void { trace('videoBufferEmpty'); } protected function videoBufferFull(event:LoaderEvent):void { trace('videoBufferFull'); }
Display a buffering icon if the video gets to buffered...
jguthrie replied to jguthrie's topic in Loading (Flash)
Loading appears to happen twice in preloader?
Ya that's what I meant. As in the best way to preload the vid & main.swf in the preloader.swf but have the video play from within the main.swf. Could also target a movieclip in the main.swf by using the container param in vidloader. thanks!
jguthrie replied to Gabums's topic in GSAP (Flash)
Greensock and game dev?
jguthrie replied to Gabums's topic in GSAP (Flash)
import flash.display.MovieClip; import com.greensock.*; import com.greensock.easing.*; //declares variables var mousePositionX:Number = 0; var mousePositionY:Number = 0; //adds the event listener stage.addEventListener(MouseEvent.CLICK, onClickHandler, false, 0, true); //assigns variables and moves the object function onClickHandler(event:MouseEvent):void { mousePositionX = event.target.mouseX; mousePositionY = event.target.mouseY; var mc:MovieClip = createBullet(); TweenMax.to(mc, .5, {x:mousePositionX, y:mousePositionY}); } function createBullet():MovieClip { var bullet:Bullet = new Bullet(); // define bullet start point and speed //bullet.speed = 3; bullet.x = 275; //based on a stage width of 550, having it start in middle bullet.y = 400; addChild(bullet); return bullet; } I swapped the capitalization of Bullet compared to your code but this should work. As far as having it carry through the point where you click, that may need to involve some trig and I am too far out of school to remember how to do that... ?
Loading appears to happen twice in preloader?
jguthrie replied to jguthrie's topic in Loading (Flash)
I actually dont mind it in that I 'know' when the main.swf has finished loading and when loading the video has started. Except I am finding out in an odd way. Since preloader.swf is using loadermax to only load in main.swf, I 'discover' when main.swf has loaded when a netstatus event of the video fires "NetStream.Play.Start" ... It may be handy to have the preloader load the main.swf and the video but the video needs to play 'within' main.swf and I wasn't sure how to hand off the video loader to main.swf... Any ideas for that?
jguthrie replied to jjdelv's topic in GSAP (Flash)
you will want to set the ease to: ease:Linear.easeNone as this will make sure that it rotates smoothly...
MP3Loader with Library Sounds
jguthrie replied to UbiquityGames's topic in Loading (Flash)
How would you use MP3Loader for sounds that are in your library anyway? (Not publishing to iphone/android etc...)
Loading appears to happen twice in preloader?
jguthrie replied to jguthrie's topic in Loading (Flash)
The reason I see the progress bar go up twice is: PreloaderSwf (using LoaderMax) loads in MainSwf which in turn loads a video (using LoaderMax). I had requireWithRoot set to true for the video. So what I was seeing was the loadermax class in the preloader swf, loading the Main swf, and then the video.
Display a buffering icon if the video gets to buffered...
jguthrie replied to jguthrie's topic in Loading (Flash)
great! well I will just let VideoLoader do its thing
Display a buffering icon if the video gets to buffered...
jguthrie replied to jguthrie's topic in Loading (Flash)
Yes. Is it possible to have it set for 20 seconds initially and then only need 5 sec of video to buffer past that? And I should just be showing/hiding the buffering icon in the bufferfull/bufferempty events?
Display a buffering icon if the video gets to buffered...
jguthrie replied to jguthrie's topic in Loading (Flash)
Sorry I should have wrote: But the video would resume playing before the buffer became full correct? I have the initial buffering amount set at 20 secs so would that mean it would wait to buffer another 20 secs before playing? I just want to know when to show/hide my 'buffering animation'. Thanks!
Loading appears to happen twice in preloader?
jguthrie posted a topic in Loading (Flash)
It seems that when my preloader loads the main swf, it loads it twice. The textfield that is used to report the progress starts at a random percentage, then goes up to 99, then resets to 0 and goes back up... Any ideas on why this would occur? I was wondering if the initial call that LoaderMax makes to determine the size would cause this... package { import com.greensock.TimelineLite; import com.greensock.TweenLite; import com.greensock.easing.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.SWFLoader; import flash.display.DisplayObjectContainer; import flash.display.Loader; import flash.display.MovieClip; import flash.display.SimpleButton; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.MouseEvent; import flash.events.ProgressEvent; import flash.events.SecurityErrorEvent; import flash.events.StatusEvent; import flash.media.Sound; import flash.net.URLRequest; import flash.system.Security; import flash.text.TextField; import flash.utils.getTimer; import flash.external.ExternalInterface; public class ChristmasPreLoader extends MovieClip { //public var _queue:LoaderMax; private var _swfLoader:SWFLoader; //public var _sSponsorButton:SimpleButton; public var _sSponsorText:TextField; public var _sLoading_txt:TextField; public var _sPattern_mc:MovieClip; public var _sStitches:MovieClip; public var _sDrop_mc:MovieClip; public var _sBrownBucket:MovieClip; public var _sMaskBucket:MovieClip; private var _preLoaderTL:TimelineLite = new TimelineLite(); private var _bucketTL:TimelineLite = new TimelineLite(); public function ChristmasPreLoader():void { addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true); //init(); } private function init(e:Event):void { stage.showDefaultContextMenu = false; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; //, estimatedBytes:900200 _swfLoader = new SWFLoader( "ChristmasCampaignVideo.swf", {container:this, alpha:0, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); _preLoaderTL.append(TweenLite.to(_sDrop_mc, 1, {y: 370, ease:Expo.easeIn})); _preLoaderTL.append(TweenLite.to(_sDrop_mc, .01, {y: -70, onComplete:dropWater })); _bucketTL.append(TweenLite.to(_sPattern_mc, 1, {rotation: 15})); _bucketTL.append(TweenLite.to(_sPattern_mc, 1, {rotation: -15})); _bucketTL.append(TweenLite.to(_sPattern_mc, .5, {rotation: 0, onComplete:rotateBucket})); _swfLoader.load(); //_sSponsorButton.addEventListener(MouseEvent.CLICK, sponsorClick, false, 0, true); removeEventListener(Event.ADDED_TO_STAGE, init); } private function rotateBucket():void { _bucketTL.restart(); } private function dropWater():void { _preLoaderTL.restart(); } protected function errorHandler(event:Event):void { trace("ChristmasPreLoader SWFLoader.errorHandler"); } private function progressHandler(e:LoaderEvent):void { var perc:Number = e.target.progress; //trace("progress: " + e.target.progress); _sLoading_txt.text = 'Loading ' + Math.ceil(perc*100).toString() + '%'; _sPattern_mc.y = 466 - (80 * perc); } private function completeHandler(event:LoaderEvent):void { _preLoaderTL.stop(); _sLoading_txt.text = "Loaded!"; //TweenLite.to(_sSponsorButton, 1,{alpha:0}); TweenLite.to(_sSponsorText, 1,{alpha:0}); TweenLite.to(_sPattern_mc, 1,{alpha:0}); TweenLite.to(_sStitches, 1,{alpha:0}); TweenLite.to(_sDrop_mc, 1,{alpha:0}); TweenLite.to(_sLoading_txt, 1,{alpha:0}); TweenLite.to(_sBrownBucket, 1,{alpha:0, onComplete: cleanUp}); } /* protected function sponsorClick(event:MouseEvent):void { try { ExternalInterface.call("OpenSponWindow","_preloader"); } catch (e:Error) { trace('ChristmasPreLoader.sponsorClick error ' + e); } } */ private function cleanUp():void { //Cleanup //removeChild(_sSponsorButton); //_sSponsorButton = null; removeChild(_sSponsorText); _sSponsorText = null; removeChild(_sPattern_mc); _sPattern_mc = null; removeChild(_sStitches); _sStitches = null; removeChild(_sDrop_mc); _sDrop_mc = null; removeChild(_sLoading_txt); _sLoading_txt = null; removeChild(_sMaskBucket); _sMaskBucket = null; removeChild(_sBrownBucket); _sBrownBucket = null; //Fade in main swf TweenLite.to(_swfLoader.content, 1, {alpha:1, onComplete: callOnComplete}); } private function callOnComplete():void { //_swfLoader.rawContent.animatePlayButtonIn(null); try { ExternalInterface.call("removeSponsorButton"); } catch (e:Error) { trace('ChristmasPreLoader.sponsorClick error ' + e); } } private function onLocalConnectionStatus(event:StatusEvent):void { switch (event.level) { case "status": trace("SiteLoadingTimeTracking - LocalConnection.send() succeeded"); break; case "error": trace("SiteLoadingTimeTracking - LocalConnection.send() failed"); break; } } } }
“I am more and more amazed every day, and very glad that I decided to get a business license.”
“With the incredible functionality, and the mind-blowing customer service, the price of Club GreenSock admission is well worth it!”
“@greensock it’s a great library that many people love, and I know you care deeply about performance :)”
“GSAP was a revelation for me to be compared with the introduction of jQuery”
“GSAP and CSS Transitions: I've done both, and its like comparing an F16 to a horse. Take like 10 minutes to try.”
“The GreenSock animation platform is one of the most useful sets of tools in existence when it comes to web animation.”
“GreenSock has encouraged me to play with the code, to dream up new and exciting things to do.”
“GSAP is just miles and miles ahead of any animation library out there. Great work!”
“This stuff is so incredibly amazing I can't believe it. The level of details and options put into these things and the natural instinct GreenSock has for solving everyday problems is impressive.”
Sign Up For Our Newsletter
Get the latest updates on GreenSock products, exclusive offers, and more right in your inbox.
Your information will always be kept confidential.
Thanks for signing up!
Now you'll begin receiving the latest GreenSock updates, exclusive offers, and more right in your inbox. Welcome aboard.