ActionScript 2.0 :: Lots Of OnEnterFrames Running Concurrently?
Jan 8, 2007
Only recently have I understood that onEnterFrame creates a continuously-running program that runs at the same framerate as the movie (until you call a "delete enterFrame). So, if I have a bunch of these running at the same time will I see a big speed drop? I'm a bit leery about using onEnterFrame because of this. Are there any alternatives to this method? I haven't been able to find any (short of putting onClipEvent handlers on movie clips).
View 5 Replies
Similar Posts:
Apr 27, 2006
Is there some way to createdelete multiple this.onEnterFrames for the same element? Like if you wanted it to expand and fade out over time simultaneously but wanted it in 2 seperate functions, and to stop at 2 seperate points.
[Code]....
Both are applied to the same element so when one triggers the delete the other is also deleted. I tried making a dummy movieclip for each function to be the onEnterFrame trigger, but then I don't get to use This and I'm not sure how to pass which pic I'm on into the onEnterFrame if I do it that way.
View 3 Replies
Jul 29, 2009
I have two functions that work individually, but not together because they're both onEnterFrame functions for the same mc (which is not possible).
Here's the code from the mc "A" class file:
Code:
function onEnterFrame(){
removeA();
connectT();
}
This works until the next function runs...
function removeA(){
if (this._x < 500){
removeMovieClip(this);
}} var strandID:Number
function connectT() {
[Code] .....
Explanation of code: mc "A" hits "strandT" and the two move together across the screen. Mc "A" needs to disappear when it hits x = 500.
View 2 Replies
Feb 23, 2010
Is there any way to call two functions concurrently at the same time in AS3? I have two functions which do very sensitive things, a difference of 0.1 second is considered failure.
View 2 Replies
Dec 3, 2009
The following is from an application that uses the Welsh alphabet, loading in audio of each letter-sound and pushing them into an array (supposedly in alphabetical order) for later use. However, this fails to work correctly as they end up in the wrong order as the order in which they are pushed into the array is dictated by the order in which their load completes, not the order in which they were loaded.[code]...
View 1 Replies
Feb 6, 2009
I have been firing a few onEnterFrame functions depending on the users interaction. ie. animations/loading bars etc. Now I have been trying to streamline my code practice, so it's nice and efficient, and most importantly - I get to delete those onEnterFrame functions when they are complete. The way I call my functions doesn't neccessarily delete my onEnterFrames when they have completed their task. Sometimes it does, sometimes it don't.[code]Is there a more efficient way to get this dialogue to work? As if I start using this method to call a progress bar % and it is concerned with 'loading' something, then this onEnterFrame doesn't seem to work properly. For simple animations, it's ok.
View 5 Replies
Nov 15, 2010
I have two identical-length videos that I need to stream and play back concurrently while staying in sync. The best I can do so far is keep them about a second apart, but I'm wondering if there's a way to force them to actually stay in perfect sync? Oh yeah: I'm using AS3. (Ideally, I'd just have a series of JPGs instead of the second video and load the relevant image via cuePoint, but that aspect is out of my control.)
Second, what's the best/ideal method of knowing what I can only think of as "percent buffered"? These videos I'm loading are hosted on a Flash Media Server (which I don't have control over or access to, short of loading files from it), and while bytesLoaded/Total works for progressive stuff, I know it doesn't work for streamed stuff. Full disclosure: I know very little about working with serving video in Flash (obvious, I'm sure)(I'm not using the FLVPlayback component.)
View 3 Replies
Mar 19, 2012
I have a strange problem. When I run an exe projector that I exported from flash cs5.5, and on few of my client's computers it running very slow in full screen.When I running an swf file (not exe projector), also in full screen, it running well!I checked my clients computer hardware, and it match the system requirements of flash player.
View 3 Replies
May 11, 2009
I have a problem in Flash Site uploading.That is, i have created a flash site & in the dreamweaver i inserted the flash site as insert -> media -> Shockwave.The site is running inside the dreamweaver but when i publish it, flashsite is not running.
View 2 Replies
Apr 14, 2011
I have around 400 sounds in my flash file.Is there anyway to go about using them with having to instantiate them all.I will be storing them in an array.
var sound1:Sound = snd1;
var soundN:Sound = sndn;
var mySounds:Array =[sound1,soundN....];
I already have linkages in the library as sound1,soundN,etc
View 1 Replies
Aug 21, 2003
How would one go about this ?say you have a number of input text fields. and ppl feed their orders in.
big mac = 5
mc chicken = 2
lg coke = 0
fillet of fish = 0
cookies = 0
sunday = 2
then once they are done it shows thier order..... without all the menu items.
big mac = 5
mc chicken = 2
sunday = 2
To do this I was going to attempt to have an if statement for each item.if there was an item ordered a dynamic text box would be created at _x _y...... then add 10 to _x. (to move the next one down the stage)
if there was no item ordered a dynamic text box would not created.then the next item would be created further down the page as _x was increased with the last menu item created.
View 7 Replies
Aug 11, 2009
Is there a way to make many movieclips change the same way, off the same line of code.. rather than having to write them all out seperatly?
eg.
If this was the original code...
clip1_mc.onRollOver = function () {
clip2_mc._visible = false;
clip3_mc._visible = false;
[Code]....
The above doesn't work... but i'm wondering if anyone knows of a method that will work... saving me from having to write so much code in future?
View 3 Replies
May 14, 2010
I'm a game developer and I have been (trying) to optimize an engine I'm making for my game. So far I have done almost every code trick there is (almost, because I'm not even close to be a professional programmer so I don't know how to do this perfectly )The game is working very smoothly now, I'm impressed, but its still generating some issues with MovieClips. When I load a new map, it loads up a movieclip that contains all the ingame objects (Screen). Inside, I add all the enemies, player and map elements I need. After that, I sort the index of the objects inside it by their position on Y.
While this works fine (using vector), my problem is that each map has like 30-40 movieclips (like doors, walls, etc), plus the player (another movieclip), plus some objects (20-30 movieclips), plus some enemies (10-40) movieclips... and when I move the camera (following the player), all the flash window area needs to refresh, and generates lag. If I only have the doors, walls and player, it runs ok... but when I start adding the enemies and other objects... Is there any efficient way to work with movieclips? Notice 90% of map elements like doors and walls are a movieclip with only one frame.
View 1 Replies
Nov 20, 2010
I have made a for loop that makes lots of squares by making a fresh graphics object for each square:[code]Is there a better way to do it as this seems to cause massive slowdown as the game gets larger.Like if I use something from the library, I can just reuse it without making it every time (like = new telephone() ).Its like it reuses the image in each instance of the object.But is it possible to reuse in this way with shapes?
View 3 Replies
Apr 23, 2010
I am using FlashDevelop and Flex SDK, I use this to embed things on the swf:[code]Now, I would like to embed more than 100 files (or maybe more!), and doing this one bye one will take long and will be very exhausting Is there any easy way to that easily?
View 1 Replies
Jul 22, 2010
We have made a simple button class that extends MovieClip, the purpose of which is to allow animated switching between lots of states. So far so good. Then we extended the simple button again to allow for a text field and resizing hit area. Still all good. Finally we extend our label button into an application specific type that alters the button's background image in a certain way. Everything seems pretty simple, right?
Now for the problem: it doesn't perform any gotoAndPlay actions.It should be jumping to labeled frames, the traces of the target labels come out correct, but the playhead never moves. Looking at the application using De Monster, it seems that each instance of the button is missing all the properties and methods of a MovieClip.I realise that this is all a bit vague without showing any code,what might cause the debugger to report a lack of properties or why gotoAndPlay might be blocked
View 5 Replies
Jan 8, 2010
I'm having a hell of a time optimizing my loading sequence for a gallery site I'm working on. This is the way it works:
1. I load and parse an XML containing the URLs to the thumbs and large versions of the photos. - This step is fast and works the way I want.
2. I load the thumbnails in sequence jumping back and forth between two functions - one initiating loading of a thumb, and the other the event handler for that particular thumb which iterates a value, and then calls the initiating function again. I suspect this is where the major slow down happens.
3. When the iterating value has reached the same number as the number of URLs to load, the class dispatches a complete event, and all is well - except so much time has passed that no one will ever have waited to see the content ...
[Code]...
View 7 Replies
Apr 18, 2010
I'm trying to get the program to generate a library object called "Enemy" on the screen when the conditions are met.
Here's the bit of the code which is causing me problems:
Code:
var army:Array;
var enemy:Enemy;
function AvoiderGame()
{
[Code].....
I'm sure it must be a simple error, I can get the logic working when it just traces something on the screen but i can't get it to generate an "enemy"
View 4 Replies
Apr 16, 2011
I'm doing an AS2 project with a parent.swf that loads many child_##.swf's. they each use identical buttons and other library assets.tried using Shared Library concept two different ways:
1 - created library.swf and used assets from it for child swf's ... no problem when child is played by itself, but when parent loads the child's, shared assets do not work,
2- established parent.swf as the 'library', and followed the common steps of Shared Library setup, but shared assets did not work. of course, using class files works, but still I need a central place for the graphics ( I'm avoiding having my classes create graphics via draw methods ).
View 1 Replies
Aug 24, 2009
I hired flash developer to make me fisheye menu with a lot of rows and columns, be he just can't make it, he says that it stuck and that it is slow when he tries to make a lots of rows and columns, is there any component in flash that could work with to make that.
View 2 Replies
Oct 19, 2010
I am running into trouble with a multidimensional array. This works well with up to about 2000 "sets"
var datasets:Array = new Array(
// one "set"
new Array(
[code]......
View 4 Replies
Aug 19, 2011
I want to create an array of loaded xml for the following:
ActionScript Code:
var xmlQuestions:XML = new XML();
System.useCodepage = true;
[Code].....
What I want to achieve is so I can load 5 different xmls and place them into an array. All 5 random xmls will be placed in an array then I wish to trace them
View 3 Replies
Jun 7, 2011
How can I assign the same function to lots of different buttons with different instances names? ie the following function needs to be assigned to all my "correct" buttons. ie, correctansnwer1, correctanswer2, etc etc.
Code: Select allObject(this).mainquestions.CorrectAnswer1.addEventListener(MouseEvent.CLICK,correct);
function correct (event:MouseEvent):void
{
[code]...
View 1 Replies
Apr 25, 2008
I've recently created a Super Text Transition class - its pretty much perfect, except theres on thing that niggles me.
It works by splitting up dynamic textfields into many movie clips, one for each letter - but I cant work out how to position the newly created letter movie clips (each containing a dynamic textfield with only one letter in them) in the right way so it looks exactly like the original text would in the textfield.
Im assuming Im not taking into account certain variables - between textWidth/textHeight, _width and _height of the letter movie clips, leading, letterSpacing blablabla. know the variables to use to recreate a text field with lots of letter mcs?
View 2 Replies
Jul 20, 2011
i created a game that has 96 still movieclips and seven more movieclips that basically move horizontally. The lag starts to rise if i add more and more moving movieclips. The game loop just basically, increment the x coordinate of the movieclips, so i don't think i have problems in the game loop.Is it normal the flash will lag once it has exceeded certain number of movieclips??if it's normal, what do you suggest to increase the game's performance?anyway, this is the update method from the game loop:
public function update():void
{
//cek kondisi untuk melakukan spawn char
[code].....
View 2 Replies
Mar 5, 2011
I need to add things to the stage and later they get removed, my first flash had a problem because when I removed things from the screen their click handeler didn't get removed, and was slowing the program down.So I've been trying to figure out the best way of making a thing and assigning a click handeler to it that I can remove later.
I've written this as a test piece of code .This basicaly makes 20 circles and adds a click handeler to each that knows which circles been clicked but it dosn't work.The error I get is
TypeError: Error #1006: value is not a function.
at test_fla::MainTimeline/addClicks()
at test_fla::MainTimeline/frame1()[code]......
View 1 Replies
Apr 11, 2007
i've been batteling with this for over a week now and i've just been unsucessful. I wonder if someone has got a better solution/theory to solve my problem I am trying to make an online product selection in flash. So the user goes from stage 1 to 6 choosing different options.
The first stage is where they choose the material. I have over 100 different materials to display! I want to put them in a database so i can update it later and also apply filters on the display page, because each thumbnail needs to store the Picture url for thumnail and main picture, the name of the material, the Price range code, the Colour description, pattern description and the material description.
How can i achieve this?! I really have looked high and low for something that stores it on one page and filters can be applied. It just needs to fill a movie clip with as many thumbnails as it finds in the DB, whilst storing the information for each thumbnail. Eventually i would like to add a button below each thumbnail which says 'select this one' which then just sets a variable to the name of the thumnail button they clicked.
View 6 Replies
Apr 18, 2010
I've managed to get a sensor attached to an arduino talking to flash using something called AS3glue. it works, when i set up a trace("leaf") for the contition that the sensor reads 0, i get a printout of the word "leaf". however i want the program to make a graphic appear on the screen when this condition is met, not just trace something.
I'm trying to get the program to generate a library object called "Enemy" on the screen at a random position each time the conditions are met. It's called enemy because I was following a game tutorial...actually it's a drawing of a leaf. Here's the bit of the code which is causing me problems:
[Cdoe]...
View 2 Replies
Feb 19, 2012
I have typical situation where big loop is loading lots of images and its done asynchronous which make browser to frees during loading and I want to make it synchronous but having big trouble doing it. I found this class synchronous loader and it work great but you cant add mouse event listener to loader. Here is sample code:
[Code]...
View 2 Replies
Dec 23, 2008
I am in the making of a isometric level editor, and I have about 15 movie clips with more to come. I want to let people change the color of tiles to what they want from a list of colors, so how can I let them change the color of a tile dinamicly with actionscript so that it changes a tile's color while preserving changes of "shadows"? I mean I have let's say a cube and to make it look 3D I need to change each face to make a feeling of 3D and not a flat one.
View 1 Replies