Jump to content
Search Community

Applauz

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Applauz

  1. perfect.. I was able to adapt for my needs. Thanks!
  2. Very close but not quite what I was talking about..... In your example .. the movie clip follows along the path of the line. I'm talking more about making a graph, the line connects to each movie clip... when the Y value of any of the movie clips change.. the line always stays connected to them. Hard to explain verbally... Take a look at http://www.chartjs.org .. The example under "Simple and Flexible" is exactly what I want to achieve.
  3. I think it would be fine if it would capture it even in 2 parts (2 frames) ... can you elaborate on this idea ?
  4. Thanks.. this helps a lot! I'm just running out of ideas to try with this.... I hate Apple for introducing these retina screens Is there anything you can think of to combat this issue I am having? I basically have a strip of movie clips that I am dynamically creating into a strip of joined movie clips ... these are high quality images.. total width of this created interface is approx 25,000 pixels. There is interactive elements inside each of the tiled movie clips. When the blitMask captures the bitmapData.. its is a HUGE CPU hog to do it because its 25,000 pixels of information. I tried only creating tiles as I needed them .. ( always keeping 1 to the left of the visible window and 1 to the right.. so that there was only 3 tiles ever active at a given time ) .. This didn't work well .. because the movie clip is using throwProps to make it swipe enabled. .. if the user swiped quickly through it .. the adding and removing of movie clips and blitMask.update calls that would happen made the swiping very choppy during the updating. So the BEST possible performance I can get right now is by just dealing with the huge CPU processing on capturing the whole movie clip in its entirety... in Xcode Instruments.. when this process runs .. the CPU hits 128% and issues some Low Memory Warnings in the interment panel. Do you have any ideas at all at how I can reduce the CPU memory hit ?
  5. OK I did a test with your above code... and myFunction(); gets called way before the blitMask update is finished. The reDrawing of the bitmap takes long. I even tried putting a delay on the call of myFunction of 3 seconds... and it still gets called before the blitMask update is complete
  6. So I'm at a point in my app now where I am testing memory, etc I am noticing something interesting. Any movieclip I remove from the stage and null that contains a blitMask in it.. once removed is taking exactly 13 seconds to actually clear from memory. Any movie clip without the blitMasking technique is clearing from memory in 1 to 2 seconds. Any idea why these are taking so much longer to clear ? Even if I try to force clear with System.gc(); I see the same issue.
  7. Not really. .. I am running tools to monitor for memory leaks... When the app first opens... none of the sections of the app have been added to the stage via addChild yet. So the app is using almost nothing in regards to CPU. Once I addChild of a section .. it does what I expect and CPU usage increases. What I do not understand is why altering compression on graphical items that have not even been added to the stage yet is affecting performance. The CPU should not be seeing a hit from any elements not on the stage. ... and based on the Memory Management tools .. its not seeing a hit because when the app first opens the CPU isn't being hit at all. ... yet somehow the compression on the library items plays a role in this. Hard to explain it......
  8. What about when it's a delayed call though ? TweenLite.delayedCall(.5, blitMask.update, [null, true]); myFunction(); // Doesn't this run before the delayedCall is fired?
  9. Is it possible to detect the moment the blitmask has captured the bitmapData ? ie/ is it possible to use an onComplete on a delayed call ? TweenLite.delayedCall(.5, blitMask.update, [null, true]); I would like to know when the blitMask.update has completed.
  10. I'm wondering why altering compression settings on images that haven't even been called to the stage yet affects this ? Is there a limit on the overall IPA file size that somehow plays into the available RAM ? Seems odd if that is the case ? strange.
  11. So .... putting compression at 90% works. Still only being set to lossless makes it crash. Wish there was a way to change those settings on the fly..... is there ?
  12. Interesting... Just for testing I changed every image asset in my library to have "photo" compression and be compressed to 20% and the crash went away. Going to try increasing the compression now and see what happens. Apparently the blitMask isn't liking the huge "lossless" png's
  13. Unfortunately I can't send the project itself over as it's confidential right now At best I could record a video of each scenario to show you.
  14. The only thing I don't understand is why when I use blitMask does it crash when capturing the bitmap. Yet if I just grab a snapshot of the bitmap without blitMask it doesn't crash ? ie/ using bitmapData
  15. The strange thing about this is that on earlier AIR (2.7, 3.1, 3.2, 3.3) the problem was that iPad3 was having memory issues and iPad2 was near impossible to crash. Now running AIR 3.4 Public .. the problem has reversed. I am getting a "Received memory warning" in the XCode Instruments panel. This happens at the exact moment I use the blitMask to capture a fairly large bitmap. var blitMask:BlitMask = new BlitMask(allChapters_mc, 0, 0, 1024, 706, false); TweenLite.delayedCall(1, blitMask.update, [null, true]); The crash occurs right when this blitMask.update is called. on Android, PlayBook and iPad3 there is no problems. Any ideas around this ?
  16. ok ... I got it working. I only needed to do this to toggle the bitmapMode .. not to toggle dragging... .. This is what I came up with. Does all of this look right to you? Do I need to call blitMask.update(); every time I toggle bitmapMode ? Any suggestions are appreciated. function onMouseMove(e:MouseEvent):void { but1X = this.mouseX; if (but1X - but2X < 3 && but1X - but2X > -3){ blitMask.bitmapMode = false; trace("CLICKED"); } else { blitMask.bitmapMode = true; trace("DRAGGED"); } e.updateAfterEvent(); } function _mouseDownHandler(event:MouseEvent):void { trace("Mouse Down"); stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); TweenMax.killTweensOf(allChapters_mc); _x1 = _x2 = this.mouseX; _t1 = _t2 = getTimer(); curX = this.mouseX; but1X = this.mouseX; but2X = this.mouseX; allChapters_mc.startDrag(false, new Rectangle(_panelBounds.x - 999999, _panelBounds.y, 99999999, 0)); blitMask.addEventListener(MouseEvent.MOUSE_UP, _mouseUpHandler, false, 0, true); this.addEventListener(Event.ENTER_FRAME, _enterFrameHandler, false, 0, true); } function _enterFrameHandler(event:Event):void { _x2 = _x1; _t2 = _t1; _x1 = this.mouseX; _t1 = getTimer(); blitMask.update(); startTouch = curX; endTouch = stage.mouseX; trace("THE PANEL X is: " + allChapters_mc.x); GetHorizontalDirection(); } function _mouseUpHandler(event:MouseEvent):void { //Remove new mouse move option stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); trace("Mouse Up"); prevX = 0; curX = 0; hDirection = "null"; allChapters_mc.stopDrag(); this.removeEventListener(Event.ENTER_FRAME, _enterFrameHandler); blitMask.removeEventListener(MouseEvent.MOUSE_UP, _mouseUpHandler); var elapsedTime:Number = (getTimer() - _t2) / 1000; var xVelocity:Number = (this.mouseX - _x2) / elapsedTime; //we make sure that the velocity is at least 20 pixels per second in either direction in order to advance. Otherwise, look at the position of the allChapters_mc and if it's more than halfway into the next/previous panel, tween there. if (_currentPanelIndex > 0 && (xVelocity > 500 || allChapters_mc.x > (_currentPanelIndex - 0.5) * -_panelBounds.width + _panelBounds.x)) { _currentPanelIndex--; } else if (_currentPanelIndex < _panelCount - 1 && (xVelocity < -500 || allChapters_mc.x < (_currentPanelIndex + 0.5) * -_panelBounds.width + _panelBounds.x)) { _currentPanelIndex++; } if (allChapters_mc == null) { trace("---ERROR! Null target"); return; } trace("CURRENT PANEL INDEX START = " + _currentPanelIndex); TweenMax.to(allChapters_mc, 0.5, {x:_currentPanelIndex * -_panelBounds.width + _panelBounds.x, ease:Strong.easeOut, onStart:blitMask.enableBitmapMode, onUpdate:blitMask.update,onComplete:setTitle}); //TweenMax.to(allChapters_mc, 0.7, {x:_currentPanelIndex * -_panelBounds.width + _panelBounds.x, ease:Strong.easeOut,onComplete:setTitle}); }
  17. I can confirm that blitMask works better on the iPad2 than the iPad3. The iPad3 is almost as bad as having to work against the iPad1. Keep in mind there hasn't been an iOS update since the iPad3 came out. It seems like the iPad3 has less available memory to work with than the iPad2. Lets hope that iOS6 announced on Monday and available for developers fixes some of these annoyances.
  18. Yes ... but when listening for MOUSE_MOVE .. it will work and I can see the x coordinates tracing... but at that moment when you press the mouse down... the MOUSE_MOVE mouseX is always the same value as the mouseX of the button press.
  19. I don't get how I could calculate that in a single mouseDown handler though. Its easy using MouseDown and MouseUp .. I can capture mouseX on mouseDown and mouseX again on mouseUP to compare the 2 values and make a plan from there. But how can I do that all inside of my MouseDown function ?
  20. Thats not the issue. The issue is that when the user intends to touch the button... since that button is inside of the movie clip that is blitMasked... when they touch the button it triggers enabledBitmap .. which then voids the MouseUp on the button.
  21. So I'm using blitMask on a large movie clip that contains clickable buttons inside of it. Everything works as expected... however I have just discovered that setting the bitmapMode of my blitmask to true when I begin the startDrag on the movie clip offers up better performance. The problem with this is that now my clickable elements inside of the movie clip don't work because bitmapmode is set to true. Im setting bitmapMode to TRUE on my MOUSE_DOWN and setting it to FALSE on MOUSE_UP ... Here is what I am doing.. any help with this issue is appreciated! var blitMask:BlitMask = new BlitMask(allChapters_mc, 0, 0, 1024, 706, false); TweenLite.delayedCall(1.5, blitMask.update, [null, true]); function _mouseDownHandler(event:MouseEvent):void { trace("Mouse Down"); // THIS IS WHAT HAS IMPROVED PERFORMANCE BUT KILLED MY BUTTONS blitMask.enableBitmapMode(); TweenMax.killTweensOf(allChapters_mc); _x1 = _x2 = this.mouseX; _t1 = _t2 = getTimer(); curX = this.mouseX; allChapters_mc.startDrag(false, new Rectangle(_panelBounds.x - 999999, _panelBounds.y, 99999999, 0)); blitMask.addEventListener(MouseEvent.MOUSE_UP, _mouseUpHandler, false, 0, true); this.addEventListener(Event.ENTER_FRAME, _enterFrameHandler, false, 0, true); } function _enterFrameHandler(event:Event):void { _x2 = _x1; _t2 = _t1; _x1 = this.mouseX; _t1 = getTimer(); blitMask.update(); trace("THE PANEL X is: " + allChapters_mc.x); GetHorizontalDirection(); } function _mouseUpHandler(event:MouseEvent):void { trace("Mouse Up"); prevX = 0; curX = 0; hDirection = "null"; allChapters_mc.stopDrag(); this.removeEventListener(Event.ENTER_FRAME, _enterFrameHandler); blitMask.removeEventListener(MouseEvent.MOUSE_UP, _mouseUpHandler); var elapsedTime:Number = (getTimer() - _t2) / 1000; var xVelocity:Number = (this.mouseX - _x2) / elapsedTime; //we make sure that the velocity is at least 20 pixels per second in either direction in order to advance. Otherwise, look at the position of the allChapters_mc and if it's more than halfway into the next/previous panel, tween there. if (_currentPanelIndex > 0 && (xVelocity > 500 || allChapters_mc.x > (_currentPanelIndex - 0.5) * -_panelBounds.width + _panelBounds.x)) { _currentPanelIndex--; } else if (_currentPanelIndex < _panelCount - 1 && (xVelocity < -500 || allChapters_mc.x < (_currentPanelIndex + 0.5) * -_panelBounds.width + _panelBounds.x)) { _currentPanelIndex++; } if (allChapters_mc == null) { trace("---ERROR! Null target"); return; } trace("CURRENT PANEL INDEX START = " + _currentPanelIndex); TweenMax.to(allChapters_mc, 0.5, {x:_currentPanelIndex * -_panelBounds.width + _panelBounds.x, ease:Strong.easeOut, onStart:blitMask.enableBitmapMode, onUpdate:blitMask.update,onComplete:setTitle}); // bitmapMode is disabled in the setTitle function called above. }
  22. This is the exact issue I've been having with iOS. Tested on Android, PlayBook and BB10 and can confirm that those 3 work fine. I really am crossing my fingers that iOS six is announced next week and developers get it right away so we can see an improvement.
  23. Would I see any benefits in using the v12 Beta ?
  24. I wouldn't have a problem with it if it was just "once". But its a section that loads in... when you close that section it removed the movie clip ... so when you go back to that section again .. it has to capture it all over again. I don't get why it halts every single thing though during that process. I have a simple spinning preloader and the animation appears frozen during the capture.
  25. So after a few weeks of troubleshooting I have finally narrowed down my problem of every animation, etc coming to a halt for a few seconds is due to the capturing of the bitmap when setting up the blitMask. My blitMask is quite large... .. is there anything you can offer or suggest to help with the capturing to make it more lightweight ? or am I screwed and have to deal with my whole app freeing for 3 seconds ? Any help is appreciated. Cheers! Jonathon
×
×
  • Create New...