Jump to content
Search Community

mhulse

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by mhulse

  1. Hello,

     

    Just curious if anyone know of, or feels like sharing, an example of how to display a simple loader graphic using LoaderMax?

     

    I built a simple pre-loader using LoaderMax, but I am just using a looping image that fades in/out... I would love to show the percentage and maybe a bar loader... Something cooler than a looping graphic would be nice.

     

    I have never really built my own loader before... I learn best by example. If anyone has links and/or feels like sharing some code samples (using LoaderMax), I would greatly appreciate it. :)

     

    Thanks in advance!

     

    Have an awesome day!

    Cheers,

    Micky

  2. Hello,

     

    Long story short:

     

    I built and app that loads two SWFs and my app controls the timelines of these loaded SWFs.

     

    Yesterday, a client sent me two SWFs that would not load. After a couple hours of investigation, I narrowed the problem down to TLF text fields.

     

    I asked for some help on a Flash listserv, and a very nice fellow (Henrik) filled me in on what deal is:

     

    Long story short, the TLF library is implemented in actionscript. Said library is hosted on adobe's servers.

     

    In order to use the library, the player must have loaded it. The default solution to this used by Flash is to wrap the main movie in a separate preloader movie.

     

    This system is called RSL, or runtime shared libraries.

     

    The preloader will load the embedded swf file (it uses the DefineBinaryData swf tag for that) and the swz file. This is done because otherwise you would get some nasty verify errors when the movie tries to refer to a class that isn't defined at that point.

     

    The effect is that your "main movie" is no longer the main movie, removing luxuries like being able to use the stage before the constructor finishes.

     

    It also complicates the code for loading such a movie into another movie. You have to get thru the preloader movie in order to access the main movie.

     

    Luckily, this mess is solved for you by Adobe, use the SafeLoader class that they have written. It will pretend to be a normal Loader that loads a normal movie, letting you ignore the RSL preloader stuff.

     

    When I removed the TLF text from the client's FLA, the SWF's loaded without any problems.

     

    Questions:

     


    1. [*:2v89pd6t]Does loaderMax have a method for loading SWFs that use TLF/RSL?
      [*:2v89pd6t]Should I just tell our clients not to use TLF?
      [*:2v89pd6t]Is it just me, or does TLF text seem like more trouble than what it's worth!!! My app needs to control the timeline of the loaded SWFs... So even if I find a solution, I still need the ability to control the child SWFs (weather they are TLF or not); the problem is that I have not idea, and don't care, if the loaded SWFs are TLF or not... I just want things to work! :D

     

    Sorry for my long-winded message. Also, sorry for going off there at the end. TLF text has been driving me up the wall for the last 24 hours.

     

    Any tips you could provide would be spectacular!

     

    I would much prefer to continue using LoaderMax for my app (vs. SafeLoader)... That's why I was wondering if I should just tell clients to stop using TLF text for text fields?

     

    Thanks so much for your help!!!!!

     

    Have a great weekend.

     

    Cheers,

    Micky

  3. Whoa! Carl! That rocks too! :D

     

    Thanks!!!!

     

    That's a nice little RegExp! Great article too!

     

    Not only will it help me for the situation you describe, I think I can utilize it on the other end of the spectrum:

     

    // Note: "assets" is array of two files to load.
    // Now parse all of the urls, creating a LoaderMax that contains the correct type of loaders (an ImageLoader, XMLLoader, SWFLoader, and MP3Loader respectively)
    _loaders = LoaderMax.parse(assets, { name:'mainQueue', onComplete:completeHandler }) as LoaderMax;
    // Begin loading:
    _loaders.load();
    ...
    ...
    private function completeHandler(e:LoaderEvent):void {
    var validImageRegExp:RegExp =/(?i)\.(jpg|png|gif|jpeg)$/
    var loaders:Array = _loaders.getChildren();
    trace(validImageRegExp.test(loaders[1].rawContent))
    }
    ...
    ...

     

    Do you think that would be a decent way to test if I loaded an SWF and/or bitmap?

     

    In my case, I just need to test if a couple of loaded files are bitmaps (gif/jpg/png) and/or swf... If it is a bitmap, I can skip all the timeline AS that I would normally use on controlling the timeline of loaded swf asset.

     

    Either way, I will definitely be using your code to make sure the incoming flashvars are legit file types! Thanks so much for sharing your code, I really appreciate it! :)

     

    Have an awesome day!

     

    Cheers,

    Micky

  4. Hi,

     

    My latest project loads images (jpg/png/gif) and/or swfs... In other words, the file type will be unknown until the time of the load.

     

    Just curious what ya'll think would be the best way to handle the above situation when it comes to using LoaderMax?

     

    I have no probs getting the variables from the flashvars, I am just wondering what the best way to handle calling the necessary loaders.

     

    How would you handle this?

     

    Thanks!

    Micky

  5. Excellent tips Greensock! Thank you!!!

     

    I actually was planning on adding more loaders to my project, but currently I just have one video to load. I will be sure to nuke the queue. :)

     

    I was under the assumption that onComplete was for when the video was fully loaded? Looking at the docs, I don't see anything that would let me know when a video has reached the end of its video play (i.e. finishes playing). Not a huge deal, because "VideoLoader.VIDEO_COMPLETE" does the trick. Basically, I just want to change my navigational buttons (change play icon to a replay icon) when the video finishes playing. :)

     

    "_video.gotoVideoTime(0, true);" is perfect! Exactly what I was looking for. I missed this bit in the docs... Sorry about that, I should have read more closely.

     

    THanks again Greensock! You have been so helpful. I owe you one. :)

     

    Cheers,

    Micky

  6. Hello,

     

    I hate to ask another question, but...

     

    I am using the VideoLoader(). LOVE IT!

     

    Quick question... Using this code:

     

    _video = new VideoLoader('video.flv', { name: 'video', container: _videoContainer, alpha: 0, autoPlay: true, width: stage.stageWidth, height: stage.stageHeight, scaleMode: 'proportionalInside', volume: 0, bgColor: 0x000000, onInit: onMetaData, onComplete: onVideoLoaded });
    _video.addEventListener(VideoLoader.VIDEO_COMPLETE, onVideoComplete, false, 0, true);
    ...
    _queue = new LoaderMax({ name: 'mainQueue', onProgress: progressHandler, onComplete: completeHandler, onError: errorHandler });
    _queue.append(_video);
    _queue.load();

     

    As you can see above, I am using "VideoLoader.VIDEO_COMPLETE"; Is there a better way to determine if the video has ended?

     

    Also, this is what I am using for a replay button:

     

    _video.gotoVideoTime(0)
    _video.playVideo();

     

    Is there a better way to do that? :)

     

    Sorry if noob questions.

     

    Thanks so much!

     

    Cheers,

    Micky

  7. Thanks to your suggestion greensock, this works:

     

    private function onResizeInit($e:Event):void {
    
    trace('onResizeInit()');
    
    // Kill the initial resize event listener:
    stage.removeEventListener(Event.RESIZE, onResizeInit);
    
    // Remove tweens:
    TweenLite.killTweensOf(_btnB);
    TweenLite.killTweensOf(_btnA);
    
    // Setup a new resize listener:
    stage.addEventListener(Event.RESIZE, onResize, false, 0, true);
    
    };

     

    I am going to have to use the above solution until I can afford to purchase a membership for the extra goodies! :)

     

    Thanks again!

     

    Have an excellent day!

     

    Cheers,

    Micky

  8. Ahhhh, that's a great idea!

     

    I actually need the resize for after the tweens too, so I could add another resize listener when the tweens complete.

     

    Nice!

     

    I was just looking at LiquidStage yesterday afternoon... Awesome stuff! As soon as I have the extra cash (prob next paycheck) I am going to pay the 100$ for a Shockingly Green membership!

     

    I can't thank you enough for sharing your amazing code with the rest of the world!

     

    Thanks!

     

    Cheers,

    Micky

  9. Thank you Greensock!!!!!

     

    Very helpful information. I really appreciate it!

     

    If I create anything worth sharing, I will post my code back here. :)

     

    [ot]

     

    As soon as I have the extra cash I plan on buying the Shockingly Green membership. Your code is just amazing!

     

    I was thinking this morning... And this might sound completely silly, but you should nickname your framework "fQuery" because its like jQuery for Flash!

     

    [/ot]

     

    Thanks a billion!

     

    Cheers,

    Micky

  10. Hello,

     

    This is kinda a tweener question, but I am using the VideoLoader/LoaderMax class, so hopefully this is the right forum to ask this question...

     

    Just curious if someone could give me a kick in the right direction here.

     

    Basically, I have a mute/un-mute button which fades in/out the video audio upon toggle/click. This works great!

     

    Now, I would like to have a volume slider where folks can control the level of audio when it is un-muted.

     

    Can anyone share some code and/or kick me in the right direction here? I am just not sure of the best way to tie my graphics to the video volume level (in fact, this would be a new experience for me, so any tips ya'll could provide would be great!)

     

    Many thanks in advance!

     

    Cheers,

    Micky

  11. Hello,

     

    I LOVE GreenSock framework!!!!! Amazing! Purely genius!

     

    With that said, here is my (abbreviated) code:

     

    private function init($e:Event):void {
    ...
    _video.addEventListener(VideoLoader.VIDEO_BUFFER_FULL, onReady);
    ...
    stage.addEventListener(Event.RESIZE, onResize, false, 0, true);
    ...
    };
    private function onReady($e:Event):void {
    showButtons();
    };
    private function showButtons():void {
    //These tweens only happen once, when the movie first loads:
    TweenLite.to(_btnA, 2, { delay: .75, x: 10, alpha: .5, ease: Elastic.easeOut, easeParams: [.25, .9] });
    TweenLite.to(_btnB, 2, { delay: .75, x: (stage.stageWidth - _btnB.width - 10), alpha: .5, ease: Elastic.easeOut, easeParams: [.25, .9] });
    };
    private function onResize($e:Event):void {
    TweenLite.killTweensOf(_btnB);
    TweenLite.killTweensOf(_btnA);
    ...
    };

     

    My concern:

     

    See where I am kiling the tweens? Is this a bad spot to put a kill for a tween (i.e. every time the stage is resized)?

     

    If I do not kill the tweens, then the tween, and the movieclip, gets funky if the stage is resized before the tween is finished.

     

    My question:

     

    Is there a better way to kill the tweens only IF the tween is happening?

     

    I only need these tweens the first time they appear, and then I am done with them. It kinda seems overkill to "kill" the tweens upon every stage resize... I am just not sure of a better way to avoid animation oddities when movie is scaled before the buttons have finished tweening. :(

     

    Any tips ya'll could provide would be spectacular!

     

    Many thanks in advance!

     

    Cheers,

    Micky

×
×
  • Create New...