Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Posts posted by Dcoo

  1. Its closer, but not at all perfect. Unfortunately I spent a good hour looking over this and really can't do much more. I would have to trace out every variable to see where the failure is and probably resize things. Right now your strip of images is 4000 pixels wide and its very difficult to see exactly what is happening at each stage.


    Wow, Carl..that's amazing! THANK YOU SO MUCH! you fine folks at greensock go way, way above and beyond! 



    • Like 2
  2. This is a continuation of an older question I had, based on easy infinite scroll part 2 on snorkl.tv
    Im trying add my own files with an xml loader and play them back at a high rate giving the pictures an animated look. but so far it will only scroll one picture then resets, any Ideas on what I'm doing wrong would be Would be greatly appreciated 
    import com.greensock.*;
    import com.greensock.loading.*;
    import com.greensock.events.LoaderEvent;
    import com.greensock.loading.display.*;
    import com.greensock.plugins.*;
    import com.greensock.easing.*;
    import com.greensock.TweenMax;
    import com.greensock.data.TweenMaxVars;
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.events.*;
    import flash.display.LoaderInfo;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    //LoaderMax that will be based upon loaders in the xml
    var galleryLoader:LoaderMax;
    var queue:XMLLoader = new XMLLoader("http://www.dwcstuff.com/mynameis2_myfile.xml",{name:"xmlDoc",
    function xmlCompleteHandler1(event:LoaderEvent):void
    function buildLoaderMax1()
    galleryLoader = LoaderMax.getLoader("gallery");
    galleryLoader.addEventListener(LoaderEvent.COMPLETE, onGalleryLoaded );
    galleryLoader.maxConnections = 24;
    galleryLoader.addEventListener(LoaderEvent.CHILD_COMPLETE, imageCompleteHandler);
    function imageCompleteHandler(event:LoaderEvent):void
    var loadedImage:ContentDisplay = event.target.content as ContentDisplay;
    loadedImage.alpha = 0;
    TweenLite.to(loadedImage, .25, {alpha:1});
    const PADDING_X:int = 0;
    const PADDING_Y:int = 0;
    var galleryArr:Array = [];
    var parent_mc:Sprite = new Sprite();
    parent_mc.y = 112;
    parent_mc.x = 300;
    function onGalleryLoaded(e:Event):void
    var imageX:int = 0;
    var imageY:int = 0;
    for each (var image:Sprite in galleryArr)
    var my_mc:MovieClip = new MovieClip();
    var myWidth:Number = galleryArr.length * 400;
    my_mc.width = 400;
    my_mc.height = 400;
    my_mc.x -= parent_mc.width;
    my_mc.y = imageY;
    imageX -=  my_mc.width + PADDING_X;
    if ( (imageX+my_mc.width) > stage.stageWidth )
    imageX = parent_mc.width;
    imageY = 0;
    var startX:Number = parent_mc.x;
    var distanceToScroll:Number = mask_mc.width;
    var lastItemX:Number = parent_mc.width;
    function scrollIt()
    TweenMax.to(parent_mc, .5, {x:String(distanceToScroll), onComplete:reset});
    function reset()
    //move all clips over to the right
    for each (var my_mc in parent_mc)
    my_mc.x +=  distanceToScroll;
    if (my_mc.x >= lastItemX)
    //this clip is way too far over... send it back
    my_mc.x -=  lastItemX;
    //shift the parent so it looks like nothing moved
    parent_mc.x = startX;
    //scroll it again after 1 second
    TweenLite.delayedCall(1, scrollIt);
    btn.addEventListener(MouseEvent.CLICK, toggleMask);
    function toggleMask(e:Event = null):void
    parent_mc.mask = (parent_mc.mask) ? null : mask_mc;
    TweenLite.delayedCall(0, scrollIt);



  3. Thanks Jack,
    So I'm trying to see if I could tween the Alpha of bookl so I could possiblytoggle it off and on.
    function bookon():void is called from inside shoeHorn.swf

    var parentMovie:MovieClip = this.parent.root as MovieClip;
    I gave the code a try
    TweenLite.to(LoaderMax.getContent("book1"), 1, {x:0,y:0,autoAlpha:1});
    doesn't seem to do the trick, bummer


    Trying to tween a swf loader


    var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,oncomplete:completeHandler,onError:errorHandler,maxConnections:5});


    queue.append( new SWFLoader("shoeHorn.swf", {name:"start", estimatedBytes:1363148.8, container:this,  autoPlay:true,visible:false,onComplete:completeHandler}) );

    queue.append( new SWFLoader("yourvids.swf", {name:"yv", estimatedBytes:1080, container:this,  autoPlay:false,visible:false}) );

    queue.append( new SWFLoader("book_Luanch.swf", {name:"bookl", estimatedBytes:10670, container:this,  autoPlay:false,visible:false,x:0,y:0,width:1000,height:600}) );









    function progressHandler(event:LoaderEvent):void


    trace("progress: " + event.target.progress);






    function errorHandler(event:LoaderEvent):void


    trace("error occured with " + event.target + ": " + event.text);








    function completeHandler(event:LoaderEvent):void


    TweenLite.from(event.target.content, 0, {x:0,y:0,autoAlpha:1})



    setChildIndex(Object(root).spauseBtn,numChildren - 1);

    TweenLite.to(splayBtn, 1, {autoAlpha:1 });

    TweenLite.to(Object(root).fullScreenBtn, 2, {autoAlpha:1})



    trace("it worked!");



    function bookon():void




    TweenLite.to(bookl.content, 1, {autoAlpha:1});





  5. Cool!  what I've been tying to do is modify Easy Infinite Scroll Part 2 and add images using LoaderMax xml loader and the idea is that you can add pics to the folder and reload and bingo, but no matter what I do I get a 0 when trace, parent_mc.length

    I made a variable var myWidth:Number = galleryArr.length * 400;  (400 is the with of each mc)

    and can trace that but tying to  and set parent_mc to = myWidth i still get a 0

  6. Since you are pushing each loadedImage into an array, you could just get the length of that array, right?


    yes this works well! thank you!

    what Im trying to do it calculate the width of the parent mc after I pushed the my images into it. and I'm loading from dynamic folder so the number of images changes

    I used trace(galleryArr.length ); it gives me a number of images loaded and each image is 400px wide so now I will try and figure out how to do math in flash :) 

    parent_mc.width = galleryArr.length * 400 ( i know thats not correct but thats the idea)
  7. I need the number of images loaded so I can calculate the length of the parent imageholder holder the will be pushed to. I have tried all kinds of ways of tracing.

    trace(event.target.content as XML )
    race((event.target.content as XML).data.LoaderMax.ImageLoader.length())
    trace((event.target.content as XML).data.LoaderMax.children().length())

    his gave me a series of "null"s, but they do match the correct number of images loaded.

    how can I get a number ? and can I pass that number  ?


    function imageCompleteHandler(event:LoaderEvent):void
    var loadedImage:ContentDisplay = event.target.content as ContentDisplay;
    loadedImage.alpha = 0;
    trace(event.target.content  as XML )
    TweenLite.to(loadedImage, 5, {alpha:1});