Jump to content
GreenSock

mrEmpty

Members
  • Posts

    140
  • Joined

  • Last visited

Posts posted by mrEmpty

  1. The items at the end going up and down?

     

    What frame rate is your FLA set to? If that's low, and you are doing slow movements, that'll be jerky. If I get time later today I'll try writing something, it would be useful for me to have some generic reusable tweens so I'll have a go at writing some.

  2. Knowing I may get hammered by the OP here, but I tested my latest research piece in FP11, it to is built almost entirely with Greensock products. It's tons of LoaderMax and TweenMax and TimeLineMax, and it runs smooth as silk.

     

    However, I have to compile it away from Flash CS5.5.

  3. Sweet, purchased. :)

     

    Flash is great, the only thing I'm lacking is a decent IDE. I miss Xcode. FlashBuilder is slow and won't let me do anything without creating a complex project first. FlashDevelop seems great, but I don't have any Windows systems. Flash CS5.5 is terrible on Lion.

     

    You know it's bad when you code in TextEdit and change the extension!

  4. Hello.

     

    Thanks for the reply. I had tried isTweening in almost the exact what you wrote out, and it did nothing (and threw no errors). I decided to try compiling the code on a second system with CS5 (not 5.5) and 10.6 (instead of 10.7) and it worked fine. So it appears the issues with Flash CS5.5 on OS X Lion are deeper than I originally thought. Sadly I can't roll back, so I'll be using Flashbuilder for the time being.

     

    Or installing bootcamp!

     

    I'm really concerned though as to why AS3 compiles differently between the two systems and why I get no errors on Lion when Sow Leopard threw up some things I needed to fix. I though Flashbuilder and Flash would compile in the same way, but evidently they don't.

     

    Which is worrying.

     

    But anyway, thanks again. :)

  5. Hello.

     

    Can I have a new call to tween ignored if a tween is already happening?

     

    If I have a movie clip I want to move by 100 pixels each time I click on it for example, but I double click on it, it'll move 100 pixels plus the pixels it moved when I first clicked on it. That's as expected of course.

     

    Now I could remove the event listener then run an onComplete to add it again, but that seems ugly and I'm sure there must be a nicer way. I tried grabbing the currentProgress to see if it's value was above 0, if it was ignore the call to tween, otherwise go ahead. But again, it seemed wrong so I thought I'd ask.

     

    Cheers.

  6. Hello.

     

    With the scaleModes, if your container is square but your loaded images are not, is there a simple way to crop them? I have tried all the scaling modes and all behave as expected, so I'm guessing not. I was thinking of loading each image into a sprite with a mask before placing it on the stage to act as a cropping method, but wanted to ask before I committed the time.

     

    Thanks :)

  7. Ye, I'm loving the Schoof. His style suits me too.

     

    Maybe you two should combine forces, or how about you decide to code something insanely cool for no real reason, screen capture in super HD the entire thing, and the two of you sit there and talk about it all the way through.

     

    Now I'd pay for that. A glimpse inside the heads of two people who understand Flash would be great, because coming from iOS it makes no sense at all :)

  8. No way, many many thanks.

     

    I'm going to sit here and study the differences and figure out what's happening there.

     

    You ever thought about writing a book? You have a nice non-nonsense way of writing stuff out, kinda like you are speaking it rather than typing it. It's a good style for a book, mainly because most people stubble to learn from reading stuff, unless the style resonates with a spoken for style of learning. Anyway, off topic.

     

    Thank you once again.

  9. Sorry. Yes, I can create a super simple FLA.

     

    The error is in fact not an error reports in Output, but the switching of the sprites inside ppMaster doesn't take place. I can trace ppCurSegment and PicNumber and they change as expected, but the line:

     

    ppMaster.setChildIndex(ppArray[ppCurSegment], ppMaster.numChildren -1);

     

    Does nothing at all.

     

    The folder 'Non working thing" here contains a simplified version.

     

    https://skydrive.live.com/redir.aspx?cid=d96ee0343f940893&resid=D96EE0343F940893!406&parid=D96EE0343F940893!116

     

    But please don't spend ages on it, I'll get it in the end. Most likely re-write the thing. :)

  10. I think you meant "== null" not "!= null" That explains why it reported that all your stuff was null.

     

    That made me giggle. :)

     

    However, still no good.

     

    private function onMove(event:MouseEvent):void {
       		var picNumber:int = int((ppMaster.mouseX) / ppSegmentWidth);
     			if (picNumber < 0)
    		{
           		picNumber = 0;
       		} else if (picNumber >= ppArray.length)
    		{
           		picNumber = ppArray.length - 1;
       		}
       		if (picNumber != ppCurSegment)
    		{
           		ppCurSegment = picNumber;
           		ppMaster.setChildIndex(ppArray[ppCurSegment], ppMaster.numChildren -1);
    			trace("Current section is " + ppCurSegment);
      			}
    	}

     

    I've tried everything I can think of on this today.

  11. One other thing, the array length is 10. The array has 10 items in it, but shouldn't it start at 0?

     

    And also, if I try this:

     

    if (ppArray[ppCurSegment] != null)
    		{
    			trace("item null");
    		}

     

    It traces back that everything I'm calling is null.

     

    But if I:

     

    trace(ppArray[0]);

     

    I get what I'd expect. I can grab the sprites width, height etc. So the sprite is in the array and I can get at it.

  12. Hello.

     

    I'm now trying to take the reason for this code and move it into a re-useable class. I'm using LoaderMax to load a series of images, they are placed into a master MovieClip and added to an array. I then wish to use the following code to move the image that corresponds to the segment to the top of the display stack:

     

    private function onMove(event:MouseEvent):void
    	{
    		var picNumber:int = int((this.mouseX - ppMaster.x) / ppSegmentWidth);
    		if (picNumber != ppCurSegment)
    		{
    			ppCurSegment = picNumber;
    			event.currentTarget.setChildIndex(ppArray[picNumber], numChildren -1);
    		}
    	}

     

    Which kinda sometimes works, but then other times doesn't at all.

     

    I get Error of type 2007: Parameter child must be non-null when moving over the right edge of ppMaster (guessing a number mis-match here?) and also, the images only sometimes move to the top.

     

    The project is here, grab the 'Thing' link:

     

    https://skydrive.live.com/redir.aspx?cid=d96ee0343f940893&resid=D96EE0343F940893!405&parid=D96EE0343F940893!116&authkey=!AO6RV0-g9SeY5W4

     

    In the last line, it makes no difference if I swap out ppCurSegment for picNumber.

  13. Hmm, did you call the helper function? Try either simply calling it with:

     

    go();

     

    or use an event listener to grab it:

     

    addEventListener(MouseEvent.MOUSE_DOWN, go);

     

    It works fine here.

     

    Let me try to make a legacy file format for you. Can't promise though, 5.5 on Lion is behaving really bad. Buggy as hell, you never not what it's going to do.

  14. No problem.

     

    I'm using 5.5 - I always forget I'm a knife edge software user and most other aren't.

     

    Anyway, the code:

     

    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.MouseEvent;
    
    addEventListener(MouseEvent.MOUSE_DOWN, go);
    
    function go(event:MouseEvent):void
    {
    up();
    }
    
    function up():void
    {
    TweenMax.fromTo(myMC, 1, {y:450}, {y:50, onComplete:up, ease:Linear.easeNone});
    }

  15. Here's an FLA :)

     

    Second onComplete removed, interaction came back :oops:

     

    Each tween moves the movie clip vertically by one pixel. Also, I guess I don't understand normalise, but the items only return to the first state after all of them have been off the edge of the mask.

     

    Thanks for your help :)

  16. Hmm, ok, not sure if I'm doing this correctly but I'm getting odd results.

     

    I have this target movie clip:

     

    public var master:MovieClip = new MovieClip();

     

    Into which I shove some Sprites:

     

    private function setupMain(event:LoaderEvent):void
    	{
    		var panels:XMLList = event.target.content.panel;
    
    		for (var i:int = 0; i < panels.length(); i++)
    		{
    			var box:GSquare = new GSquare();
    			box.rotation = 90;
    			box.x = (box.width - 2) * (i+1);
    			master.addChild(box);
    			trace(box.x);
    		}		
    		confMaster();
    	}

     

    I then configure that master movie clip along with my blit mask:

     

    private function confMaster():void
    	{
    		addChild(master);
    		master.y = 100;
    		master.x = 100;
    
    		bMask = new BlitMask(master, master.x, master.y, master.width, master.height, true, false, 0, true);
    		bMask.bitmapMode = false;
    	}

     

    Then I run a tween:

     

    private function testBlit(event:MouseEvent):void
    	{
    		TweenMax.to(master, 1, {x:master.x - 160, onUpdate:bMask.update, onStart:bMask.enableBitmapMode, onComplete:bMask.normalizePosition, onComplete:bMask.disableBitmapMode});
    	}

     

    Once the tween ends, I have no ability to interact with my nested sprites (I do before calling that tween). But also each time that tween runs the master movie clip moves up (down) 1 pixel. I traced out the position of everything and only the master movie clip is moving.

     

    I'm not sure if normalisePosition() is working due to the other things. :)

×