Jump to content
Search Community

droyde

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by droyde

  1. Is anybody here? Jack?

     

    Jack, I think you should include this guy's (http://wonderfl.net/c/hzfJ) math algorithm for a better motion guide and it's worth the investment for the way how your tolerance variable work. The less will have more of his effect which is more accurate and the bigger value it will have that elastic long curve. Because the problem with the standard curve of BezierPlugin is that it has real big tolerance to it so it doesn't really take the shortest direction but making a bigger curve then travel through the longer distance. Which is a big problem there.

     

    Here's what I edited:

    if (through) {
    for (p in props) {
    a = makeBezierArray (props[p]);
    all[p] = b = [];
    if (a.length > 3) {
    	b[b.length] = [a[0], a[1], (a[1] + a[2]) / 2];
    	for (i = 2; i < a.length - 2; i++) {
    		b[b.length] = [b[i - 2][2], a[i], (a[i] + a[i + 1]) / 2];
    	}
    	b[b.length] = [b[b.length - 1][2], a[a.length - 2], a[a.length - 1]];
    } else if (a.length == 3) {
    	b[b.length] = [a[0], a[1], a[2]];
    } else if (a.length == 2) {
    	b[b.length] = [a[0], (a[0] + a[1]) / 2, a[1]];
    }
    }
    }

     

    Add this function below:

    public static function makeBezierArray(p0:Array):Array {
    // make a copy you can mess with 1st
    var p:Array = p0.concat ();
    // extrapolate in some way
    if (p.length < 2) {
    p.unshift (p [0]);
    p.push (p [p.length -1]);
    } else {
    p.unshift (p [0] - 0.5 * (p [1] - p [0]));
    p.push (p [p.length -1] - 0.5 * (p [p.length -2] - p [p.length -1]));
    }
    
    var bezier:Array = [];
    // convert all points between p[0] and p[last]
    for (var i:int = 1; i < p.length -2; i++)
    {
    var b1:Number = -p[i -1]/6 +p[i] +p[i +1]/6;
    var b2:Number = +p[i]/6 +p[i +1] -p[i +2]/6;
    bezier.push (b1); bezier.push (b2);
    }
    return bezier;
    }
    

     

    You need to somehow integrate this with a new variable. I don't know what your tolerance variable really for there. Hope that helps. But if you still have the answer for my previous question - which is how to integrate this bezier curve to a library or stage object, that would be fantastic if possible. Cheers.

  2. G'Day all!

    This is a question for Jack or anyone here.

     

    Does anyone know how to animate object with a drawn line on stage (or library) using the tweenlite's bezier? I mean I can draw points on the stage and position them exactly, but the track that's invisible is basically the one that's uncontrollable. What I really want to achieve is basically an animation that's based around the track and I really want to be able to control where exactly the object is going. Because with using bezier tool, I get this funny animation of swirling in loop and again this is understandable because of the nature of bezier.

     

    So back to the question, has anyone done it with a drawn line on a stage and use tweenlite to basically use it as track? Is this possible? My understanding would be that we need to have an AS3 to understand or trace the line and redraw them in code so it sort of convert them to an array of X and Y and put it to the bezierThrough. Would be sweet if you can. Thanks in advance!

  3. Here's the attachment. What basically happened is the main images are without cacheBusterID and some of them are repeated and they have cacheBusterID. So what I did basically have XML data with 1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg and they're repeated for 5 times for example. As you can see in attachement from my firebug the last one without any auditSize and cacheBusterID. Please advice. Thanks.

  4. Here's basically the lines of code I have. I used the lastest greensock.swc. And I'm still geting this image.jpg?purpose=audit&cacheBusterID=1290246781514 at the back of image load.

     

    _loader = new LoaderMax({name:"mainQueue", onComplete:completeHandler});

    _loader.unload();

    _loader.empty(true, true);

    _loader.append(new ImageLoader(url, {name:"image", noCache:false}));

    _loader.load();

     

    Tested it on Chrome and Firefox. Please advice what I should do to just get rid of the cacheBusterID. It's quite annoying that it doesn't work. Thanks in advance.

  5. Hi Jack,

    I really do need your hand here just trying to remove cacheBuster as my project requires to use cache by special request. So I did try like this:

    new ImageLoader("path", {name:"name", noCache:false})

     

    That doesn't make any different at all. Any idea?

     

    Thanks in advance!

×
×
  • Create New...