i am making a game with scrolling background. I am using a tiled background.inactionscript I was going to hide background objects off the screen but this cause memory to still be taken up by the hidden images so what do i do?the scrolling background isnt repeating so i could have 4-5 screens of image tiles off screen and made invisible until required.
I'm very new to flash,and have been digging through google and this site for information on how to piece together an AS2 shooter game.Its going well enough, but I'm having slowdown issues the longer the games runs, and I was hoping someone here could point me in the right direction.To paste an enemy movie clip on the screen, i'm using this:
Code: var spawn =_root.attachMovie("monster1","monster1"+_root.getNextHighestDepth(),_root.getNextHighestDepth())[code]........
I need them stored in an array so that the player's shots can test weather or not they've hit any monster on the bullet's enter frame function, then call that monster's movie clip's take damage function. I'm using a for loop to do this:
Code: for(var i in _root.player.foes){ if (this.hitTest(_root.player.foes[i])){ _root.player.foes[i].takedamage();} }
I think the problem with the slowdown is that each time I place an enemy on the screen the array gets bigger and bigger. The slowdown only happens while the player is shooting, and I suspect the ever longer for loop with the hit testing is causing it.
I'm already removing the monster's movie clips as they get killed or exit the screen, I guess what I need is a way to reduce the size of the array at the same time, or at least tell the for loop not to do a hit test unless the monster is still alive.
I'm trying to create a random sequence memory game, where user has to watch over a certain sequence appears on the screen before they can input (by pushing buttons) according to the sequence appear before.I've found simon sayz code and make a modification on it.It worked flawlessly, but there is one problem with it.The code creates the sequence in this manner, e.g:
1 1 1 2 1 1 2 3 1 1 2 3 4 1 1 2 3 4 5 etc,..
while the game I'm intended to develop doesn't need that kind of increment logic, they just need to display 5 different element for starter and then the user should follow the sequence displayed on it.
I am trying to create a memory game, where about five or six (doesn't matter how much) different colours com up and flash for a second and disappear in a random order.
Then the user has to try to match them again buy clicking on the colours that they have infront of them in the same sequence as the lights went.
Is there a way to make this game so it will tell you when you are wrong or right, and also is it possible to make the flashing colours random each time you play it?
I made a memory game with a tutorial. My knowledge of AS3 is not that good so I have to following question.There is a function like Math.Random to random generate number and put them on stage. I made a memory game and the cards are on the same place every time I play the "movie".I want them to shuffle every time I restart the game. How can I write a good random function in AS3?
This person created this game:http:[url]....i was wondering if i wanted to match two different colours, how could i do this? for example, instead of matching two reds, if i wanted to match a red and green, how is this done?
I may be tackling a huge subject here but I was wondering how to make it so that if someone uses one of my flash projects and they close it that it would remember where they left off. For example there are many Flash Games out there with levels, and instead of having to repeat each level over and over, the game remembers the level you left off at.
The prblem that i have is that when i click the 'Bone Memory' game it load up fine. I can play the game and the 'Play Again' button work as well.The problem occurs when i use the 'Main Menu' button. It goes to the main screen, which is fine, but the 'duplicate' cards that were created for the game appear on this main screen when they shouldn't. This in turn causes problems with playing the game when the 'Bone Memory' button is selected for the second time. The cards are all in the wrong places.I am attching the file with the code. The main screen and game were created seperatly and i have tried to combine the in the file attched.
I m trying scroll pannnel to show image and dynamic text both in scroll panne but when i select dymanic text in text option it comes outer from scroll pannel but static text is coming.
I m trying scroll pannnel to show image and dynamic text both in scroll panne but when i select dymanic text in text option it comes outer from scroll pannel but static text is coming.
This is my first attempt at a game in AS3.I'm currently experiencing a problem which I'm sure is a result of my poor understanding of programming concepts.My problem is this, every time I call the function to rebuild my level, the game progressively slows down.I've tried to clear everything, but somehow something is still causing the slow down. I'll attach a zip with all of the files, and also I will add the main code to this.The attempted clearing happens in a function called cleanup() and the level setting up in setupLevel().[code]
here is some code for a rotating crank that controls an image gallery. refer to the "image viewer stops?" thread in the flash mx forum (sorry don't know how to link to a forum yet!) for more info. attached is the fla. i want to be able to crank clockwise to scroll images forward and counterclockwise to scroll images backwards. If i keep cranking, i want the images to continue to change, if i stop cranking, i want it to stp on that image. it doesn't sem tooooo hard, i'm just numb from tryig to figure it out.
I'm making a game but I have the code that will randomly place an object in a specified area and will keep making new objects that do the same thing (Sort of like the platforms on the game "Fall Down") but the scenery in my game will scroll up not down.
I am trying to make the screen scroll like the helicopter game, using action script or any other way can anyone guide me to a tutorial or any other have to find out how to do this?
create a side scroll game in flash..and i dont know whats the easiest and best to do it,, if i can i wish my game can access to a database to save and load it.
I tried all zooms, placing objects outside there to gain scroll access, but it won't, and seem to be outside of some lighter gray plate... is it simply the limit? how the hell can I design the rest of my level?
i have an evil memory leak that i would like to fix. at the end of the game a bunch of sprites "explode" and fly around. once they leave the stage, i stop their enterframe loop and remove them like so:
I'm making a photo browser. I load 15 photos as Images and add these Images to HGroup every time. When user presses 'next page', I first unload the existing Images by 'Image.unloadAndStop()' and 'Image.source=null', and then load new photos. However, it seems that the GC never works. The task monitor shows that the memory use of my AIR reaches as much as 1.2G! Some people said it's a bug of Image when you load a picture larger than 1.5M. Is it true?
I wrote the following code to check memory when loading a big image (~20Mb). Every time I do mouse click, the application eats up memory, so something doesn't get deleted or cleaned with GC but I can't figure out what exactly.
imageLoader.as PHP Code: package { import flash.display.Loader; import flash.net.URLRequest; public class imageLoader { var fname:String [Code] .....
The movie loads in an external image and refreshes it every second. What happens, though, is the previous image seems to stay in memory. Eventually the browser will hang, because the memory footprint of the flash movie is so large. Even while testing outside the browser, I can see the memory increase by a couple hundred KB every second. You can see it at [URL]
The code I'm using is below (don't make fun, I don't claim to be a programmer).
Code: function refresh_url(event:TimerEvent){ var url:String = "http://www.live-photo.com/asheville-east.jpg?ID="+getTimer(); var request:URLRequest = new URLRequest(url);
Using ActionScript can I do with my game, which is running in a browser, verify that the user already has the files needed to run the game installed on your computer? If he had these files do not need anything else that was born and can play the game immediately. If he did not have the files, they would be loaded so that the browser does not erase these files. So when he returned to play the same game day after,as the files already on your computer, nothing need be loaded.How do I remove one of the main memory image that was loaded using the Loader class? I tried using the unload () method but nothing happened.
I have a bit trouble with LoaderMax memory occupy, i have a queue, and i am keep loading images depend on user's action. if they click load more and it keep load, but i would like to clean the memory which been occupied by the previous queue (i have remove all the children been added by the loading previously). is there a way i can do it? the behavior like this.
I have an FPS monitor running and notice that I am getting choppiness here and there, bringing my game from 40 to 27 fps and back and forth at certain stages. I have an idea of where it is happening, but do not know for sure. I looked up quite a few memory monitors but haven't found anything decent yet. Is there a memory monitor that allows you to see the memory leaked and find its location? If not, how about just he memory leaked?
i am writing a program that need to load photoshowever, there is limitation in flex that users cannot load photos with pixel above 4069 x 4069 into a bitmapdata.how can i check photos pixel before running to error? since some pictures are big nowadays, i would llike to check the user`s system memory and free harddisk space. See if the computer have enough space to load the photos.
I'm making an isometric game and I need to know which takes less memory for scrolling, making everything invisible that you can't see? Like if(!this.base.hitTest(worldHitter))this._visible = false; Or would it be better to remove the movieclips unseen and then reattach them when i should see them?
i am trying to make a flash version of my company catalog. i've got the nifty page turning thing working fine. what i am trying to do now is have it so that when you click on a page, it loads a larger version of that page into a blank mc holder. i can get it to load the image no problem. what i CAN'T seem to figure out is how to make the image scroll so that the viewers can see the entire thing.
i need to constrain the size of the holder mc and then have the image inside move with the mouse movement. clicking the image will empty the holder mc and return the viewer to the main catalog.open the catalog and on the first page you will see a temp blue button. clicking that will open the LARGE page view (i know they don't match, this is just a demo ). i need to be able to scroll that large image. still nowhere.
I'm putting together an image library on a horizontal scroll. Each of the images is a movie clip and there is an expansion button to see the full images that are contained. How to make it so the scroll contents expands and contracts as the movie clips expand and contract.
i've been trying to solve this for an hour now and I have to resort to a forum post. I don't understand why this isn't working.I have two background images that scroll up,right,left and down with arrow keys. They also scroll to the left while no arrow keys are being used.What I want is the background images to reach a boundary, so the player never leaves the background image and sees the stage.My background image x,y coordinates by default are: x(223.0), y(272.4)Just to see if my condition works, I have it move the wisp(player). However, even in the debug screen when it shows the Y coordinate of backround image go below 170, it never moves the wisp.