Jump to content
Search Community

retropunk last won the day on April 16 2015

retropunk had the most liked content!

retropunk

Members
  • Posts

    181
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by retropunk

  1. Thanks Carl.

     

    Using copyPixels is great but the Memory thing is baffling. I can destroy the bitmaps from memory but the memory seems to increase even after I destroy the bitmaps.

    For example:

    1. Flash starts and memory is at 80

    2. I load 10 bitmaps and use copyPixels. the memory is at 200

    3. I destroy all 10 bitmaps and the memory is 90

    4. I load 10 bitmaps again and use copyPixels. the memory is at 220

    etc

     

    Not sure how to pin pint the leak. Might be a garbage collection thing

     

    Thanks for the insight though

     

    rock on

  2. Hey there, I am wondering if I can use BlitMask for this idea.

     

    I have a series of PNG files that when played in sequence is a 360 rotation of an engine. I have code that lets the user click and drag which plays the sequence forward/backward. It's basically a poor mans QTVR. So it doesn't scroll as much as it updates the rect with a new bitmap

     

    I am creating another version for the iPad that uses copyPixels and cloning. It works great on the desktop but I was curious if BlitMask will do what I've described.

     

    I am having memory issues so I am exploring alternatives to my own copyPixels and cloning solutions.

     

    Thanks!

    - Patrick

  3. Hey guys, I have 4 separately built SWF projects that I need to load from one UI.

    What I need help with is how do I unload a SWF after it is loaded?

    Now of course there is the unload method, but the problem is once the SWF is loaded I need to hide the UI.

    So I need to call the unload from inside one of the other loaded SWFs.

    So my question is:

    Can I dispatch an event from a loaded SWF out to the UI that loaded the SWF so the UI can perform the unload method?

     

    Am I looking at a Local Connection solution? SWF talking to SWF?

     

    I hope that makes sense.

     

    Thanks guys!

  4. Hey guys, I was wondering if I could do something like this:

     

    TweenMax.allFromTo(contentArray, .3, {alpha:0, x:0}, {alpha:1, x:[0, 20, 50]}, 0.2);
    

     

    Where the x value in the "from" vars would be 0 and the "to" vars would be an array of positions?

     

    Now I know that this code doesn't work but my question is can I get that to work another way?

    Normally I would use a for loop and loop through the array using TweenLite.

     

    But I was just messing around with allFromTo and it seems so close! :)

     

    Thanks

    - Patrick

  5. Jamie:

    It seems that warning is a separate issue not related to my initial question. So thanks for making me look twice! I'll need to set aside time to look at these assets I've been given and see whats up. There might be som funky Illustrator stuff going on. Thank you!

     

    Carl:

    Thanks for the multiple solutions #2 is EXACTLY what I was looking for. I was originally using Object but I knew it was wrong.

    Thanks a million!

  6. Yeah I'm not sure why I'm getting that warning.

     

    What I'm trying to do is just to have a global variable with a tween type

    private var tweenStyle:Object = Quad.easeInOut;

     

    Because in this particular file there are about 60 animations all using the same tween type.

    So instead of find and replace every time, I could use a variable.

     

    I just don't know what to set as the type.

    Make sense?

  7. Hi guys, check it out.

    I am working on an animation and I need to declare the animation style in a global variable like this:

    private var tweenStyle:Object = Quad.easeInOut;

     

    setting tweenStyle as an Object doesn't seem right. It works but I get this warning in Flash:

    "Warning: Filter will not render. The DisplayObject's filtered dimensions (53687120, 20132662) are too large to be drawn."

     

    I tried setting it as a String, but that doesn't work.

    private var tweenStyle:String = "Quad.easeInOut";

     

    Any ideas?

    Thanks!

    - Patrick

  8. oh nice! I didn't even think of that! Thanks!

    The reason I did it the reverse way is because in the example I have there are panels with info on them. So when someone rolls over the flash the animation will pause so they can read the slide.

    Then when the roll out the animation will continue. Check out my file, you'll see what I mean. Either way your solution seems perfect.

     

    Check out my solution so far.

    http://retropunk.com/files/Carousel-Microsite.zip

     

    This is still a prototype but I am trying to get the scroller to be as dynamic as possible but fairly easy to update (xml, external files etc).

    I also need to figure out how to use a small nav (4 little white boxes) to be able to jump gracefully from slide to slide....tricky!

    I've done this in the past plenty of times but not using Greensock. I've been wanting to use TimelineMax and I'll make any excuse to learn the Greensock libraries more!

    You're infinite scroller gave me the idea to give it a try so thanks!

     

    Let me know what you think.

  9. Hey Carl , yeah I tried exactly what you suggested already but the reset goes crazy if you roll off an on a couple of times.

    It's fine that the tween finishes if it has already started but I need to interrupt the delays inbetween.

     

    I'm gonna try and implement TimelineMax into this scenario. I think thats my best bet.

    If I run into a problem with that I'll post again

     

    I'll post my solution later. I think this rotator I am working on will be useful for other people. I am also building a nav so you can skip to any slide in the array of movieclips.

     

    Thanks for responding so fast!

  10. Hey guys, been a while!

     

    I am using a snippet of code from SnorklTV's infinite scroller along with Greensock of course and I am trying to implement a pause function when the user rolls their mouse in and out of focus of the Flash.

    I have the detection working but I am not sure how to pause the Tweens.

     

    Do I need to wrap this into a Timeline?

     

    Any ideas? Thanks!

     

    var isPaused:Boolean;
    
    this.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
    this.stage.addEventListener(Event.MOUSE_LEAVE, mouseOff);
    
    function mouseOn(evt:MouseEvent):void {
    this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
    traceText.text = "mouse on the stage";
    isPaused = true;
    }
    function mouseOff(evt:Event):void {
    this.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
    traceText.text = "mouse off the stage";
    isPaused = false;
    }
    
    function scrollIt() {
    TweenMax.to(parent_mc, 1, {x:String(distanceToScroll), onComplete:resetDelay});
    for each (var mc in parent_mc) {
    	if (mc.x <= -395) {
    		mc.x +=  lastItemX;
    	}
    }
    }
    
    function resetDelay() {
    TweenLite.delayedCall( 1, reset );
    }
    
    function reset() {
    for each (var mc in parent_mc) {
    	mc.x +=  distanceToScroll;
    }
    parent_mc.x = startX;
    TweenLite.delayedCall(1, scrollIt);
    }
    
    TweenLite.delayedCall( 1, scrollIt );

  11. I tripled checked to make sure my AS files were ok but then I went back and checked my SWFLoader code...since I'm new at using it

     

    I added the container and now it's working!

     

    so this

    var _swfLoader = new SWFLoader("main.swf", {noCache:true, estimatedBytes:900000, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});

    became this

    var _swfLoader = new SWFLoader("main.swf", {container:this, noCache:true, estimatedBytes:900000, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});

     

    I'm still learning your classes...thanks for the fast help. My bad!

  12. I just started getting this error when I used LoaderMax for the first time.

    I have a base.swf with the LoaderMax code that loads a main.swf. main.swf works fine on it's own but when I use the base.swf to load it I get the Error #1069: Property cachedOrphan not found.

     

    This is my first time using SWFLoader...any thoughts?

     

    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.events.LoaderEvent;
    import com.greensock.loading.*;
    import com.greensock.loading.display.*;
    import com.greensock.plugins.*;
    
    // SWF goes here
    var _swfLoader = new SWFLoader("main.swf", {noCache:true, estimatedBytes:900000, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
    var _progressDisplay = new ProgressCircleLite({radius:25, thickness:4, color:0x000000, textColor:0x000000, trackColor:0xFFFFFF, trackAlpha:0.9, trackThickness:4, autoTransition:true, smoothProgress:0});
    
    addChild (_progressDisplay);
    
    _progressDisplay.mouseEnabled = false;
    _progressDisplay.x = stage.stageWidth / 2;
    _progressDisplay.y = stage.stageHeight / 2;
    _progressDisplay.addLoader ( _swfLoader );
    
    _swfLoader.load( true );
    
    function progressHandler (event:LoaderEvent):void {
    //trace ("progress: " + event.target.progress);
    }
    function completeHandler (event:LoaderEvent):void {
    removeChild ( _progressDisplay );
    addChild ( event.target.content );
    }
    function errorHandler (event:LoaderEvent):void {
    trace ("error occured with " + event.target + ": " + event.text);
    }

  13. Hey guys, I am stuck on a small bit of code and I'm hoping to get some help.

    I am using the Transform Manager to create a Virtual Post card creator.

    The problem happens when I try to create a screen shot of the postcard using draw()

    I am able to snap the screenshot just fine but I am unable to remove the previous screen shot when a new one is created. Check the link below.

    Maybe there is a better way to do it?

     

    1. Add just one image to the stage from the right nav and click NEXT to see the screen shot

    2. Then go back and move the image to another spot and click NEXT again

    3. You'll see the updated screen shot but you'll also see the previous one. This is where the problem is. I need to remove the previous one.

    You'll see how I am trying to use removeChild but maybe I am using it wrong?

     

    http://www.z100.com/common/patrick/combos/combos-v1.0.html

     

    var bmd:BitmapData;
    bmd = new BitmapData( 800, 600, true, 0xF5780E );
    var bitmap:Bitmap = new Bitmap( bmd );
    var resetTheScreenShot = false;
    
    function screenGrab():void {
    
    if(resetTheScreenShot){
    	// this isn't working properly -- need to fix the screen shot grab
    	MovieClip(parent).mcSelectFlavor.screengrab.removeChild( bitmap );
    }
    resetTheScreenShot = true;
    MovieClip(parent).mcSelectFlavor.screengrab.addChild( bitmap );
    
    dropArea.managerObj.deselectAll();
    bmd.draw(dropArea);
    
    }

     

    btw - I realize that this problem has nothing to do with the Transform Manager... :)

    Hopefully someone can still point me in the right direction.

    Thanks guys

    - Patrick

  14. Hey guys - Sorry for the lame post but I need to turn this redundant code:

    timeline.append( new TweenMax(clip1.clip, speedIn, {y:"-130", ease:easeInType}) );

    timeline.append( new TweenMax(clip1.clip, speedOut, {y:"130", delay:.6}) );

     

    timeline.append( new TweenMax(clip2.clip, speedIn, {y:"-130", ease:easeInType}) );

    timeline.append( new TweenMax(clip2.clip, speedOut, {y:"130", delay:.6}) );

     

    timeline.append( new TweenMax(clip2.clip, speedIn, {y:"-130", ease:easeInType}) );

    timeline.append( new TweenMax(clip2.clip, speedOut, {y:"130", delay:.6}) );

     

    etc...

     

    into something like this:

    var targetClip = ["clip1"].clip; // I know this line is wrong but you see where I'm going?

    timeline.append( new TweenMax(targetClip, speedIn, {y:"-130", ease:easeInType}) );

    timeline.append( new TweenMax(targetClip, speedOut, {y:"130", delay:.6}) );

     

    I have a dozen or so animations happening the way I want but I need to be able to control the targetClip value.

    The targetClip value will be constantly changing.

     

    Thanks in advance for the help!

    - P

  15. Definitely - remove listeners yourself. You can still use weak references in many situations, though, but still remove the listeners when you're done with them.

     

    Yes, since working with AS3 I've been keeping with that best practice of removing listeners.

    Thanks Jack

  16. so would you say that the preferred practice is to always just remove listeners yourself? From what I understand in other languages you need to keep track of memory management yourself. Flash is unique in that it has a Garbage Collector doing it for you.

  17. interesting, I haven't had much experience with the weak reference. I'm gonna do some hard core testing and see what comes back.

    I'll repost with my results, they could prove helpful. I've read and seen tutorials that say you should ALWAYS do false, 0, true for the 3rd, 4th and 5th parameters in an addEventListener. Especially the weak reference, it should ALWAYS be set to true. Maybe its not so black and white?

     

    stay tuned.

×
×
  • Create New...