ActionScript 3.0 :: Flash - FrameRate Drop With MovieClips?

Oct 8, 2010

I'm currently trying to make a little game but I experience now some loss of framerate while adding "bullets" in the gameI'll not enter in the full code source as it will take some time but basicallyI got a mainGame class, a Player class, and a bulletClassthe mainGame class contain the game loop working like this, main timer cecks:-loop function of the Player class, checking if space is pressed,if it's pressed a bullet is displayed with this line in the player class:Code://main_class is the MainGame class and the container is the main displaymain_class.container.addChild(new Bullet(x, y, otation,main_class));//then the bullet add itself in a _bulletArray of the Main Gam class-loop function of the bullet Class, for each bullet cointained in the _bulletArray,it moves the bullet from some X, and if it's out of view of the screen it destroying itself from the array and with a removeChild of the display list like this:

Code:
y += vy;
x += vx;

[code].....

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Stop(); Causes Sudden Drop In Framerate?

Feb 17, 2012

when I have a movieclip that gets to the end of its playhead and calls the stop() command, the framerate drops from 24 to about 16.  This movieclip contains other movieclips that continue their animations.  I assumed with one less timeline running the performance would actually increase.  There is no other code running, just a movieclip containing other movieclips that suddenly slows when it hits stop().

View 2 Replies

Flex Web Application - Prevent Framerate Drop When Window Is Invisible?

Nov 20, 2011

So there's been a new "feature" in the flash player since version 10.1, which reduces the player's framerate to 2 fps when the application window is out of view. This is good news for performance, but it can break some functionality, such as the Timer class.

I have an application which uses a Timer to display a countdown. Given the nature of the application, it is required for the Timer to complete its countdown even if the user is not there to see it. Imagine that you need to give the user only 10 seconds to perform a task. If the user minimizes the window halfway through the counter, they can take as much time as they want and still have 5 seconds left when they return to the window. This apparently can not be avoided with the newer flash players.

In Air applications there is the backgroundFrameRate property which can be set to prevent this behavior, but this is part of the WindowedApplication class, so it seems that it is not available in a web application. Does anyone know a way to keep a constant frame rate even when the window is not visible?

View 3 Replies

ActionScript 2.0 :: Change Framerate Of Movieclip Without Changing Framerate Of Main Movie?

Feb 26, 2004

How do i change the framerate of a movieclip without changing the framerate of the main movie?

View 2 Replies

ActionScript 2.0 :: Change The Framerate Of A Movieclip Without Changing The Framerate Of The Main Movie?

Feb 26, 2004

How do i change the framerate of a movieclip without changing the framerate of the main movie?

View 2 Replies

ActionScript 3.0 :: Flash Wordgame Drag / Drop Movieclips Textfield Bug

May 16, 2010

I'm making a drag and drop wordgame, and I've encountered a rather irritating problem. Based on the words contained in an array, I create different movieclips with drag and drop functionality, so that they can be dragged on top of the corresponding correct translation of the word. Problem is that when I add a textfield to my buttons (using addchild), dragging and dropping becomes rather buggy, and dropping doesn't work properly, quite often. "Bug-free" version, no text on the MCs: [URL] This was done based on a tutorial that used pre-made movieclips containing shapes, maybe it was at kirupa, I don't remember where I read it I'm afraid. There are many tutorials out there on this subject, but I haven't found any that show you how to dynamically create movieclips which contain text and drag/drop functions. Here's the code:

[Code]...

View 1 Replies

ActionScript 2.0 :: [Flash 8] - Set The FrameRate

May 3, 2007

how to set the FrameRate (fps) using action script?

View 2 Replies

Force Flash To Keep A Steady Framerate?

May 22, 2010

The problem is, the framerate is not constant, meaning it goes out of sync with the music very often.[code]...

Can I get flash to maybe skip or drop frames to make sure it keeps an overall steady framerate?

View 4 Replies

Flash :: Flex App: Framerate Property Is NaN?

Jan 11, 2011

I have an AS3 App class e.g (pseudo code)

public class MyApp extends Application
{
protected function onRender():void
{
trace("frameRate = "+frameRate);
}
}

and this is then extended by the app MXML:

[Code]...

The app appears to be running at the right speed, but in MyApp.onRender(), frameRate is seen as NaN (in the debugger too if I step through). Why is this? How should I be obtaining the application's FPS property?

View 1 Replies

ActionScript 3.0 :: Flash - To Get The FrameRate Of A Loaded SWF?

Mar 3, 2011

I'm loading some external SWF's and want to see what framerate the loaded SWF have. However, all of the data tells me the root SWF's framerate. I've checked the loaderInfo object, the movieClips.stage field (before it's been added to anything). Everything says 30FPS when it should say 20 FPS (in my case).

View 3 Replies

ActionScript 3.0 :: Drag And Drop One Of Many Movieclips Dynamically

Mar 4, 2011

I'm looking to be able to pick up one of 36 movieclips on the stage, and drag it to a hotspot. If it lands on the hotspot, then it does something, otherwise it just gets dropped.

How do I dynamically change the "target_mc" to be whichever movieclip I select?

This code works fine, but that's because eventlistener is set-up explicitly for a given mc.

Code:
// sprites
import caurina.transitions.*;
var drag_mc:MovieClip = energy_sprites.play_wave;

[Code].....

View 3 Replies

ActionScript 3.0 :: Drag 'n Drop Stacked Movieclips?

Aug 16, 2009

I have a four groups of images which are stacked one above the other. the images which are under the top image won't be seen.I need to drag an image which is on top and drop it on target movieclips(10)I need to validate each target movielcips will contain max 3 images which should be from different groups. No two same groups's images should bedropped on any target, doing so it will go to it's original position.I am facing a problem handling depths of the images/movieclips. Whenever I try to drag an image(placed at the top) the bottom-most image gets dragged. I don't know why is it happening

View 1 Replies

Flash :: Control Animation Framerate In The Object Tag?

Sep 7, 2010

I have a compiled flash animation (swf) embeded into a HTML document using the object tag.

Question: There's a posibility to change the original SWF framerate using some params in the object tag?

I don't have the source code (FLA).

I want to decrease the framerate.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="570" height="220" id="FlashID" title="Empresas">
<param name="movie" value="assets/flash/scroll.swf" />
<param name="quality" value="high" />

[Code]....

View 1 Replies

ActionScript 2.0 :: Changing Framerate In Flash 8 Dynamically?

Nov 24, 2006

any scripts which I could use for my little stickman movie which allows the user to change the framerate of the movie dynamically by pressing buttons and etc?

View 9 Replies

ActionScript 2.0 :: Create Movieclips Using A Loop / And Then Start Drag And Drop?

Jul 31, 2007

I want to create some instances of a movieclip thats in my library. [code]This code works. Then I want to startDrag all of them, in the same loop. How to?I'vre tried "k"+i.startDrag(this) but that won't work. Any other good guesses?

View 1 Replies

Actionscript 3 :: Prevent Flash's Input Events From Stacking Up When Framerate Slows?

May 7, 2010

My Flash game targets 24 fps, but slows to 10 on slower machines. This is fine, except Flash decides to throttle the queue of incoming MouseEvent and KeyboardEvents, and they stack up and the Events fall behind. Way behind. It's so bad that, at 10 fps, if I spam the Mouse and Keyboard for a few seconds not much happens, then, after I stop, the game seems to play itself for the next 5 seconds as the Events trickle in. Spooky, I know.

Does anyone know a way around this? I basically need to say to Flash, "I know you think we're falling behind, but throttling the input events won't help. Give them to me as soon as you get them, please."

View 2 Replies

Actionscript 3 :: Huge Framerate Difference Between Test And Publish Movie In Flash?

Dec 24, 2010

Simply put, I am making a flash midi player. I am using ENTER_FRAME for my timings. I set the framerate to 100 to ensure that the timing of each note in milliseconds is accurate. When I test the movie with CTRL + ENTER it works fine. When I publish it and open it in a browser (tested both IE and Chrome), it suddenly plays back a lot slower. I don't think it's a performance issue, since the code is very simple. If this slowdown is consistent then I can perhaps work with it so that the playback speed will be correct. Do browsers make the framerate slower or do they implement a framerate cap of some sort? What is going on?

View 2 Replies

Create ActionScript-based Flash File That Doesn't Operate With Fixed Framerate?

Feb 18, 2012

I'm creating an ActionScript-based flash file that only needs the screen to be updated in response to something happening behind the scenes. As such, I don't need it to run with a fixed frame-rate. Instead I just want to tell it to lay dormant until I explicitly tell it the screen needs to update.However, I don't see any way to do that. Can that be done? (i.e. set the framerate to zero and manually force an update based on some user-defined event?)For example's sake, if you can provide an example that just kicks off the update based on a simple timer,

View 2 Replies

ActionScript 3.0 :: Flash Release To Drop NOT WORKING On Drag And Drop?

Mar 10, 2011

Release to Drop NOT WORKING on drag and drop? Or is it something else?Can be seen here:

[URL]

Code:
var origX:Number;
var origY:Number;
for(var i:uint=1; i<6; i++){
this["choice_"+String(i)].buttonMode = true;

[code]....

View 3 Replies

ActionScript 2.0 :: Make A Flash Movie That Would Allow The User To Control The Framerate Of The Movie?

Apr 11, 2006

I have to make a flash movie that would allow the user to control the framerate of the movie. Unfortunately I'm not that good with flash and I don't know how that could be done ..I thought about something like

"on(press){
movieclip.increaseframerate(*2);
}"

View 3 Replies

ActionScript 3.0 :: Framerate Lag When Only 10-14 Of CPU Is Being Used?

Feb 24, 2011

Is there anything else besides high cpu usage that would cause the framerate of a swf to lag?I'm working on a game that is set to 60fps so the animations are super smooth, and I am on good, fast computer so even with tons of animations going my cpu usage never goes above 14% usage, and only about 1% of the systems memory is used.

View 4 Replies

ActionScript 3.0 :: FrameRate Changes To 1 When Deactivated?

Apr 16, 2010

i am making a flex air application and when its deactivated (lost focus), its framerate becomes to 1fps.i am using psudo-threading encoder that uses enterframe to keep it working the app requires long time converting process more than hours and i need the program to do the same thing while sitting back in the background how to disable deactivation in air application as soon as the focus is out, it becomes 1 fps instead of 24 fps which i need.

i know i can use timerevent rather than enterframe event but my app needs alot of calculation and i figured that in flash, the frame extends its time if the calculation isnt finished. if it gets too long in one frame, the ui hangs up.if i use enterframe, on slow comps it would extend its time to complete the calculations when all the calculations didnt get to finish in time in 1 frame.but im afraid if i use timer event, instead of waiting for the codees to be excuted it would excute the next timer event, i didnt try it though.i created the app that when you add the xml songbook data, it would load up the data sort it and create pages with the graphics and skins set up and when you save, it saves the pages to jpg files using the encoder i created.and the encoder uses enterframe.its working fine but when i deactivate the window while encoding, it becomes extremely slow since it becomes 1fps.

View 3 Replies

ActionScript 3.0 :: Looking For A Simple Framerate Debugger

Jan 19, 2010

Every now and then I come across some examples on the web that have a nifty little FPS output window. I have also seen a couple that count objects on screen and various other usefull data.Rather than build one myself since I am pressed for time on my current project, does anyone know where I could find a little class or component like this? I had a link from a friend pointing me to one, but I lost the email when I migrated to a new machine (yes, I should have migrated my mail data file - STUPID STUPID ME!).

View 2 Replies

ActionScript 3.0 :: Set An Independant Framerate Of An Imported Swf?

Jun 5, 2010

Just wondering.  Is it impossible to set an independant framerate of an imported swf?

View 3 Replies

ActionScript 3.0 :: How To Change Movieclip FrameRate

Jul 15, 2011

i want to change my frameRate without changing another instances.Basically stage frameRate should be same but my movieClip frameRate has to be changed as per my choice ?

View 2 Replies

ActionScript 3.0 :: Total Control Of The Framerate?

Dec 10, 2011

control the framerate of my app by a external event, like a timer or a network socket. I have one solution wich works, but not very elegantly:

stage.frameRate = 0;
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
var timer : Timer = new Timer(1000);

[code].....

View 5 Replies

Change Framerate Of A Movie Clip?

Jul 6, 2009

i want to change frame rate of movie clip during run time on button click.....i have 3 movie clips...and i want to control the frame rate on button click...am using attachMovies to play the movieclips.

View 1 Replies

Framerate Slowing Down In Sections Of Animation

Mar 20, 2011

To cut a long story short, i'm learning flash in order to get a job in 2d interface design. I had some basic knowledge of the software prior to this, but i needed to further my animation to compliment my design skills, so bear in mind that this is my first major flash project. So far, everything was going well, and i was managing to achieve my vision so to speak, but i have hit a brick wall with this problem. The interface starts with three menu options, single player, multiplayer & settings; each staggered behind and to the right of the last. However the transition i have made between them (basic motion tween with blur filters changing slightly) stutters everytime.

I have uploaded the animation here so you can see for yourself. Also, here is a screenshot of the timeline for the first transition: It does it a little bit in the scaled down version, but if you view it full screen it really slows down. Also, if anyone can be bothered to wait through the slow stuff to see the animation that works

View 7 Replies

Actionscript 3 :: AIR App Inactive = Lower Framerate?

Mar 10, 2012

I'm developing an AIR app that is receiving TUIO events from a Framework for a fiducial marker based multitouch table. Until yesterday I was faking the events by mouse to work faster, but then I connected everything to a TUIO simulator and the problems appeared.

The TUIO Simulator is a java app. By dragging markers on the simulator you can send OSC messages that I'm forwarding to my AIR app. The problem is that I'm noticing that when I drag something on the simulator, my AIR app lose the focus, and the AIR framerate suddendly drops. If I drag something on my simulator and I switch super fast to the AIR window, everything goes smooth, so it seems the problem is that if my AIR app is not the active app it's redrawn at a lower framerate (I remember reading something about this, not sure).

So my questions are: am I right about the fact that inactive windows in AIR are redrawn at lower framerate? do you have any workaround to fix it and to allow me to interactive with the java app without my AIR framerate drops?

View 1 Replies

ActionScript 3.0 :: Keeping A Steady Framerate?

Sep 22, 2009

However, there is one issue that plagues a lot of viewers, their players not being able to rend the frames in time.Flash rends each frame on the spot where it is needed, this is obviously needed for actionscripting and similar. But this also means that if a frame takes too long to rend, the player has to do something about it.

The player actually does one of two things, depending on if there is any streaming sounds going on or not.If there is a streaming sound, Flash drops frames to keep in sync. Otherwise, Flash just ignores the issue and draws the next frame as if it didn't have any lag detection.Obviously, neither of these is desirable. What can you do about it? Well, the obvious thing is to not do crazy graphics that takes forever to rend. But what if you can't change the graphics?

There is one thing that you can always do, change the antialiasing level the player is using to do the rending. It's 4x4 (High), 2x2 (Medium) or none at all (Low). This makes the rendering go faster, since it is rendering to less pixels.You can also do other things that are movie dependent to reduce the work load. Things like spawning less particles in a particle effect or outright not having some effects. But those are all movie specific and difficult to work with in a general way.

One idea that I had was to draw everything to a bitmapdata of a smaller size and showing that instead, however, that has it's own issues. For one thing, I do not believe that the player can do it's "changed only" redrawing when you do this. Second, there is the issue if you want the corresponding bitmap instance to be smoothed or not. And of course, if you do this, zooming in will not have the infinite resolution that Flash is known for.Obviously, you need to know when the movie is lagging in order to know when to do this. However, the best I can think of is timing the enterframe events and checking if it has been too long since the last one.
This works to show if you are having issues reaching the target framerate or not, but it does not show the load if you are not having trouble reaching the target framerate.

Now, assuming that we have a metric for how well the playback is working, the big question remains: when do you change the rendering settings? And how do you do it?Yes, it is just a simple property of the Stage class for the antialiasing, but that is not what I mean here. I mean, how do you say if it should be changed or not? When it's even lagging one frame? When it's not lagging for one frame? The same, but for 20 frames? This is something I don't know what to pick.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved