Fitchett Developments last won the day on April 18 2013

Fitchett Developments had the most liked content!

Fitchett Developments

Members
  • Content Count

    22
  • Joined

  • Last visited

  • Days Won

    1

Fitchett Developments last won the day on April 18 2013

Fitchett Developments had the most liked content!

Community Reputation

2 Newbie

About Fitchett Developments

  • Rank
    Member
  1. Hey everyone so I am moving a Movie Clip across the stage using Animate CC/AS3 and I was wondering which way is faster or if it even matters? The initial method I would use was straight forward using an ENTER_FRAME Event Listener like so addEventListener(Event.ENTER_FRAME, platformLoop); private function platformLoop(e:Event):void { this.x -= 8.0; } the Second Method which i am currently using now is like so: private function init():void { TweenLite.delayedCall(0.001, moveChar); } private function moveChar():void { TweenLite.delayedCall(0.001, moveChar); this.x -= 8.5; } This method using Greensock works just fine and moves the player across the screen pretty smooth. But I was thinking does it even matter is one faster or more efficient than the other?
  2. Hmm I cant seem to get the function to work correctly on the delayed call. When i trace the trace("doing something " + count); as you provided it brings back 0 and stop there it never goes to the else function. ANy reason why this would happen?
  3. Great explanation. I completely understand. That question had be going all night because ive been working on my game for awhile now and I had so many timer events going on at the same time around 8 or 10 Timers I read a lot and understand that Timers cause lag and can decrease performance on Mobile devices etc.. So I removed them all and instead added TweenLite.delayedCall to all my used to be timer functions and have them loop I hope I did that correct. It seems to be working properly just like a timer. I hope I read enough to understand that by removing all the timers and using Tweenlite delayedCall was a intelligent move.
  4. Awesome thanks so much Carl Ill give it try today and let you know how it turned out. I hope this is not going against the forum rules but maybe you can help me answer this quick question. I was wondering if replacing ENTER_FRAME events in my Movie Clip objects main class to TweenLite would increase performance? RIght now in the Movie Clip Object classes I have the ENTER_FRAME event moving the Objects across the screen in a linear line with "this.x += 10" etc... Would it increase performance to just remove that and instead replace it with the Tweenlite? I ask because I am publishing the game to Android and the better perfromance the easier on the CPU ya know? I would appreciate any feedback thank you again!
  5. Hey everyone so I know that tweenMax has a onComplete function but I was wondering is there anyway that I can setup a tweenMax or tweenLite function to only run 30 intervals of my stages frames per second then once finished call on the onComplete function? I have a movie clip object that is added to the stage every 0.8 seconds and what i wanted to do was when my character picks up a powerup I wanted to have the movie clip object added to the stage every 0.1 seconds but only for a couple intervals or like say 5 seconds then I wanted to put it back to its original time. Is there anything that the tween engine offers to call on a onComplete function for this?
  6. Hey everyone so maybe you can help I have created a game using Flash CS6 and Flash Develop. I have objects that are added to the stage by a timer Event named "_Obstacles". These _Obstacles are all added Randomly to the stage. Now they get pushed onto the stage like so: private function addObstacle(e:TimerEvent):void { _Obstacles = new mcObstacles(); stage.addChild(_Obstacles); aObstacleArray.push(_Obstacles); trace(aObstacleArray.length); //TweenLite.to(_Obstacles, 2.7, {x: - 300}); } In my _obstacle class I removed this: if (sDirection == "R") { //Move obstacle left this.x -= nSpeed; } and added the line as shown above to my Main Engine class instead but its still be controlled by the timer: TweenLite.to(_Obstacles, 2.7, {x: - 300}); Now this works fine and they move across the stage correctly. But I am still experiencing major lag. I dont understand why. So I was thinking maybe it could be the TIMER_EVENT that is causing the lag and if i figure out how to push out the random array of objects every 2.7 seconds and remove the TIMER_EVENT someo how it will stop the lag. My game is simple and i dont understand why its lagging this is the only thing i can think of. Its a basic player jumping over the obstacles added to the stage by the timer. So I'm sure that the timer is the corporate. Please help.
  7. Fitchett Developments

    Tweenlite onComplete Function not firing

    Hey everyone so In my Movie Clip class I have the Object move to the Right side of the stage using TweenLite and after the tween is finished I want the function "OnComplete" to remove the object but its not doing anything and the object is still on stage. Here is how I am using it: TweenLite.to(this, 3.0, { x: 900, y: 300, onComplete:removeTween } ); Then the Function: private function removeTween():void { if (this.parent) { parent.removeChild(this); } } Does anyone know why its not removing the object from the stage?
  8. Fitchett Developments

    hitTestObject not working when Tween added

    Amazing. GreenSock is just amazing haha. Thanks so much it worked perfect! You were a great help!
  9. Fitchett Developments

    hitTestObject not working when Tween added

    Thanks for the information it helped i think it has something to do with the object it runs into, because like i stated above whenever i change its position closer to the mcPlayer the hit test works. But while i have you hear i have another quick question. In one of my Object Classes i wan it to alpha ease in whenever its added to the stage. So i want it to be invisible then ease in after 1 second. I have this: TweenLite.to(this, 1, {autoAlpha:0}); But it eases out. I tried to mess with it but couldnt really get it to work.
  10. Fitchett Developments

    hitTestObject not working when Tween added

    This is weird whenever i change one of my objects position to a different value it works.
  11. Fitchett Developments

    hitTestObject not working when Tween added

    Hey guys quick question. Do you know of any reason to why my hitTestObject wont initiate when i add this line to my mcPlayer Class: TweenMax.to(this, 1.5, { x:120, ease:Power0.easeInOut } ); My hitTest function works perfectly fine but once i add this code to it, my player just goes straight through the object this is how my mcPlayer class is setup public class mcPlayer extends MovieClip { public function mcPlayer() { addEventListener(Event.ADDED_TO_STAGE, onAdd); } private function onAdd(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, onAdd); init(); } private function init():void { TweenMax.to(this, 1.5, { x:120, ease:Power0.easeInOut } ); }
  12. Fitchett Developments

    Removing Tween and re-adding Tween.

    Interesting. Yeah i figured it out last night by setting it to 0 then 1 in the next function. But im confused what does set(); or fromto(); do?
  13. Fitchett Developments

    Removing Tween and re-adding Tween.

    Hey guys so im having a little trouble here. So i have a textField that updates after each hitTest which is called levelText. So what im trying to accomplish is the levelText field to fade out after 1 second at the start of each new level. It works fine for the first level but when i go to level 2 or 3 the text field doesnt appear at all. I believe i have to destroy it and re add somehow? Here is the code im using. private function startNextLevel():void { TweenLite.to(levelText, 1, {autoAlpha:0}); } Please any information would help. Thank you.
  14. Fitchett Developments

    Infinite Tween on a Linear Path

    Oh okay thanks for the info. Yeah im using v12 and its working pretty good.
  15. Fitchett Developments

    Infinite Tween on a Linear Path

    Yes!! That is exactly what i was looking for. You have been more than helpful. It wasnt working when i had it on TweenLite but it does the trick on TweenMax. Thanks again man. So by using GSAP will this boost overall performance? or Optimization?