ActionScript 2.0 :: Flash Array - Object Stay Stuck On Screen
Feb 18, 2006
I have created a game in which the user controls a object which moves across the bottom of the screen firing bullets at fish which randomly swim across the screen. My problem however is that when the timer runs out some of the fish stay on the screen instead of disappearing, I have tried everything to make them all go away but I always end up with one or two which stay stuck and remain there no matter what the user does. My code for the balloons moving n disappearing is as follows:
function moveBalloons() {
// loop through balloons in array
for(i=balloons.length-1;i>=0;i--) {
// get speed and clip
dx = balloons[i].d;
balloon = _root[balloons[i].clip];
[Code] ......
View 4 Replies
Similar Posts:
Jan 20, 2010
It seems like the loading screen (more like frame) is the last thing to load, so you are stuck staring at a blank screen for a while. How can i prioritize how the game loads so that the instant you get on the page the loading screen comes up immediately?
View 5 Replies
Mar 17, 2006
I am using an external actionscript file, and I have dynamically loading images that stay on the screen for X amount of seconds (the user can set the value of x), then it loads the next image. However, this user would like for there to be a transition, For Example, have it fade out and have the next image in line fade in after the image has been displayed on the screen for X amount of seconds. This user would also like a loading bar, much like the one on the flash banner here: [URL] between each image transition.
I also have it so when someone hovers over a button, the flash banner stops, once they rollout X is reset to 1 and starts the counter again, and sets the movie to play at frame 1. Here is the actionscript file: [URL]
View 4 Replies
Jun 5, 2010
I've been trying to get this preloader working for days! I finally got it working, and now when I upload it to my site and refresh the page, the .swf file is stuck at the preloader screen.
This is my code:
//Stop Framestop();
//Create a listener to call the loading function as the movie loadsthis.loaderInfo.addEventListener (ProgressEvent.PROGRESS, loading);
//Runs when the loading progress has changedfunction loading(event:ProgressEvent):void{//Determine the percent loaded from bytesLoaded and bytesTotalvar percent:Number = event.bytesLoaded / event.bytesTotal * 100;
//Stretch a progress barprogressBar.scaleX = percent / 100;
//Set the progressText text box to the percent loadedprogressText.text = int(percent) + "%";
//When the load is finished, go to frame 2if(percent == 100){this.gotoAndStop(2);}}
View 10 Replies
Sep 3, 2010
I'm trying to create object and insert them in an array, for moving them across the screen. I'm trying to use the attachMovie for this task:
attachMovie("MyObject",arrayVal[counter],1);
the problem is that the second parameter must come in "" like
attachMovie("MyObject","arrayVal[counter]",1);
So, as you can see, i'm not able to tell which number comes on the "counter" variable
arrayVal[0]
arrayVal[1]
...
and i'm not able to use it latter:
arrayVal[0]._x++;
...
How is this usually done? (i'm a as3 developer, so i'm stuck here)
View 2 Replies
Sep 8, 2009
What I am trying to explain/do is to take a movie and not only have it follow a guided layer, but also to have it not dissapear.So for example, I have sucessfully made a movie move around a path as I broke some letters in to symbols and created a guided layer out of them.However I don't want the move to keep dissapearing and initializing as it transverses the path.To better explain this, please check out the online example: UrL...Now instead of holding down the mouse button and having the movie of hearts just keep compounding wherever the key_pressed mouse goes to, Imagine the hearts coming to screen as the movie goes through the guided layer so as to spell out a word. Here is the minimum that I think I need and I have edited it below and tried change the "mouseX" and "mouseY" to something such as flashmo_group.X and flashmo_group.Y but the resulting effect does not follow the path.[code]
View 2 Replies
Mar 9, 2012
OK so i have a character that moves with the mouse. I need it to stay in the center of the screen(kind of like a platformer game). I can't figure out how to access the camera and move it. (Note: I have tried Vcam and moving all of the other objects but Vcam makes the file slow or something [or so i have heard] and moving the other objects in kind of like cheating [and for my needs is insufficient]) I don't have any code because i don't know where to start. Maybe someone can point me into the right direction.
View 3 Replies
Sep 30, 2009
i want a character to stay in center of screen and where ever we click on the page the character goes there , i mean that click position comes to centre with ease and we can also navigate map like age of empires, or DOTA but in that case character stick at its own position to map.
Im not flash developer so i dont know how to do this but i can do designing. I am attaching a fla with this pls do this experiment with that fla file so that i can understand it easy. Being a non programmer it is tough to understand these things for me. those brown sections in this map would be colusion areas , where we cannot move character and blue is river. so we cannot move character to river too.
View 1 Replies
Mar 8, 2010
When I use the play option under "control" menu every thing runs perfectly. When I try to test movie under control menu, play as exported .swf, or debug movie, etc. the animation is stuck at the initial screen.
[CODE]...
View 2 Replies
Dec 16, 2011
I had to set the "Default linkage" actionscript setting to "Merged into code."
I have pretty basic AS that says to switch to a different scene, and it will switch, but movie clips from the original scene won't disappear. Never happened before...
Code:
function unit1MainMenu(event:MouseEvent):void {
gotoAndPlay(1, "Main Menu Unit 1");
}
MainMenu.addEventListener(MouseEvent.MOUSE_UP, unit1MainMenu);
View 2 Replies
Jun 5, 2010
I've been trying to get this preloader working for days! I finally got it working, and now when i upload it to my site and refresh the page, the .swf file is stuck at the preloader screen.
[Code]...
I've been reading up on it for a while now, but I can't seem to figure it out.
View 1 Replies
Jul 4, 2008
the aim of this script is to make a slide show, loading images form an external file (called: images) they fade in, then fade out, then load the next swf in the Next Level.My Question is that I cannot manage to set different times when the image load to stay in the screen (1, 2, 3 sec (1000, 2000, 3000 miliseconds) and then to fade.They Need to fade in, stay 1,2 or three seconds, and then fade out... but its not working, I used the SetIntervalID but nothing after loading the 1.swf this will call a 2.swf with a different time of the image to remain, lets say 5 sec, and then this swf will call the 3.swf and remain 8 sec??[code]
View 5 Replies
Jan 20, 2009
When you drag the screen in any direction the background scales and rezises.But How do I make the text stay center and a certain size so that it wont scale to fit the screen and will stay a certain size
View 1 Replies
Feb 9, 2011
I need a video which has been embedded into Flash to stretch, regardless of aspect ratio.This video will then reveal some content which I don't want stretching at all.I've tried using the "exactFit" scaleMode property and tried to find a way of that only affecting the video and not everything in the swf, but I failed. I've also tried using Stage.width/height and applying it to the dimensions of the video but t
View 2 Replies
Mar 5, 2011
I've searched for almost a whole week to get this thing converted,I found a great tutorial for a scrollbar that was exactly what I was looking for. I wanted something that didn't have up or down buttons, had a thin line for the track, and a circular dragger. However, it was written in AS2. I've tried to convert it myself, but I'm a complete beginner, and I know nothing about AS3 code, or AS2 for that matter. So, I've managed to get the scroller icon to move, but it moves all over the screen & doesn't stay put
var scrollUpper:Number = 31.5;
var scrollLower:Number = 381.5;
var textLower:Number = 40;
[code].....
View 3 Replies
Sep 15, 2004
i've got 5 images. i want the following things to happen:
1. the placeholder movie clip automatically tweens to adjust to the image's dimensions.
2. the transition between each image is a la: www.barbariangroup.com -- front page when you enter
3. the images stay on the screen for approx. 5 seconds each.
View 1 Replies
Feb 13, 2008
I need to have a series of four numbers appear randomly with fade in and out and stay on screen for a couple of seconds each. These are then linked through to separate movie instances that display relevant information regarding that number and then go back to the random numbers. There are options to randomly display text from an external file, but not library objects within the same movie. I have a cobbled together version using scenes and timeline animation, but it's repetitive. It needs to be more random and effective as a visual element.
View 2 Replies
Sep 24, 2009
[Code]....
so my array is longer but u get the point. i want it to whenever i click on any letter, cause they are all on buttons, the one i clicked dissapears. i dont know how to work splice with the "i" variable,
View 3 Replies
Apr 3, 2012
I currently have objects populating the screen randomly and bouncing around the stage. The problem is, some of the objects are getting stuck and bouncing back and forth rapidly between two points. How can I prevent this?
Here's how I have the EnterFrame setup:
var ballT = e.target
ballT.x += ballT.vx;
ballT.y += ballT.vy;
if (ballT.x + ballT.width / 2 >= sWidth || ballT.x - ballT.width / 2 <= 0) {
ballT.vx = - ballT.vx;
} else if (ballT.y + ballT.height / 2 >= sHeight || ballT.y - ballT.height / 2 <= 0) {
ballT.vy = - ballT.vy;
}
View 1 Replies
Jul 5, 2010
I have a movie which is serving as a button.When you rollover the image, it grows, and stops.When you rollOut, it shrinks, and stops.This code works fine. The Problem:When you scroll the mouse over quickly, the animation get stuck and doesn't execute the rollOut code.This is most likely because the first rollOver action hasn't yet completed.Here's my code:
thumb_test_4.onRollOver=function () {
this.gotoAndPlay(2);
}[code]....
View 9 Replies
Feb 8, 2010
I'm currently working on a game that has multiple 'scenes' located on each frame. In one scene, if you click on an object it disappears. I did this using the visible = false method. However, anytime you return the scene after, the object is visible again. How would I write the code so that it stays invisible permanently when you click it, regardless of whether or not you leave and later return to the scene?
View 4 Replies
Aug 27, 2005
i'm working on a gallery that loads thumbnails from an xml file into 3 columns and when you click on a thumbnail it opens a new window with the fullsized image in.
I have modified code from a gallery tutorial to load the thumbnails from a xml file. They are going in 3 columns at the moment (I don't understand why but they are) but only the last image has a hand cursor when you rollover it, and then when you click on it, it traces "undefined" into the output box.
I have put
Code:
trace(images_arr[i].attributes.fullsize);
just below the bit where it loads the thumbnails and it traces the right path from the xml file for each image.
get it to trace the right path from the xml file when you click on ALL the thumbnails, not just the last one.
Code:
function GenerateThumbs() {
images_arr = images_xml.firstChild.childNodes;
gap = 10;
[Code]...
View 3 Replies
Aug 15, 2009
I have a center window and a background in my flash file. I am trying to get the center window to stay in the center of the web browser screen and get the background to expand and fill the entire web browser screen below center window layer. Sort of like this site [URL] I've currently converted the background to a movie clip and have this code.
[Code]....
View 11 Replies
Jan 24, 2009
I have a swf within a html page. There is a function that opens an html page when an object gets to a certain x position. However, when the object gets to that point the new html page (in _self) opens over and over again and get stuck in a loop. Any way to escape this loop and what would be the best way to trigger this new html page to open when the x position of the object is true?
View 1 Replies
Oct 13, 2004
I've made a site with small draggable "popup" windows (not actual windows since they are objects in flash..) I can drag em off the scene outside the edge. I've attempted many things.. A adaptation of the collision script found through search.. (on collision it stopped dragging) Worked nice, until you move the mouse real fast, then it can pass right through or partly through and the fact that it's stopdrag. It takes effort to get it from the edge. It's stuck basically.
I fixed it by making the on (press) change frame in a moveclip containing the border.. had a side effect though.. You can now drag the window out from the scene if you repetitively drag it towards the edge. Is there a way to limit a movieclips possible X & Y positions? (in both + & - range to make it a 4 cornered block). I also want the moveclip to keep moving up/down if if hits the right/left edge if you continue dragging it up/down (same with left/right edge also)
I tried the scrip from the "dynamic mask":
onClipEvent (enterFrame) {
getlimits = _root.normalpic.getBounds(_root);
if (_root._xmouse>=getlimits.xMin && _root._xmouse<=getlimits.xMax && root._ymouse>=getlimits.yMin && _root._ymouse<=getlimits.yMax) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}}
I changed the size of the "normal pic" and it works lovely.. but it's on enterFrame... and I need to react on on press and on release.. : tried to adapt it but cant figure out how.. and besides the script don't allow movement along the edges (like I described above) and if you move the mouse fast enough the window stops short of the edge..
View 5 Replies
Jan 23, 2010
I'm new to Adobe Flash CS4. I'm making an animation of some fish underwater. I have 2 small fish motion tweened to follow a large fish from left to right. When I view the animation in full screen the small fish seem to be wiped off the screen at a certain point. The tween box continues to follow it's path but the symbol disappears. This only seems to happen with larger objects.
[Code]...
View 2 Replies
Jul 13, 2010
I am curious if this is an okay implementation of the Array.filter() method.
[Code]...
I was not able to figure out an implementation of the callback function for the filter() method, where the callback was outside of the getGallery() function. I wonder if there is a way to get the isGallery function outside of the getGallery scope?
View 1 Replies
Mar 26, 2009
is there a way in action to group to object so when one object is drag across the screen the other object sticks with it, im using flash btw
View 6 Replies
Jan 27, 2010
How do I get the 2D screen coordinates of a 3D object when using Papervision 2.0 (Great White)? I've read that following properties should return the screen coords but these always return 0.
[Code]...
View 2 Replies
Sep 6, 2011
I am new in flash developer. I want to set my frame at the center of the screen interdependent of screen size. but we are working on full screen view (means stage.scaleMode = StageScaleMode.EXACT_FIT).Logically I want one background image at back side, which cover all part of the screen, and on that background image I want to set my frame image at center of screen with fix size of (1000 X 750 px).
View 1 Replies