ActionScript 3.0 :: Stopping The Character At The Edge Of The Stage

Jul 24, 2010

I'm trying to do a simple game which you have to move a frog character in an X axis , and you have to "caught" the falling insects (as much as you can). The game lasts until you fail 5 ,and then it's game over with a display that says how much insects you caught. However, i'm doing this as a mid-term exam for a course in college.. but really, because of some problems, most of the us,the students.. learnt almost nothing, or hardly the necessary for being able to understand the code, but not to script by ourselves

The game works propertly, except when the frog reaches the edges of the stage, which is 800x600 px , and goes beyond it This is the code: (I'll skip the 2 other AS frames which make the game start and end and post the one with the in-game code)

[Code]....

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Screen Scrolling As Character Moves To Edge

Sep 16, 2009

I am trying to make my screen scroll as my character moves to the edge of it, but when I get to the edge of the screen nothing happens, I think this could be something to do with my registration points but I'm not sure. I have added trace statements for debugging but no luck. I have included my Fla so you can see what I mean.
Here: [URL]

Here is the code I am using to try and make this happen
PHP Code:
// scroll the LBground if character gets past half way up or down the stage
function scrollLevel():void {
// Horizontal scrolling
var horizontalCentre:Number = stage.stageWidth / 2;
var horizontalPosition:Number = LBground.x + Mchar;
[Code] .....

View 2 Replies

ActionScript 2.0 :: Stop Character Walking From When Road Scrolling Reach The Edge Of Screen?

Mar 1, 2008

here i have a zipped fla file where i have problem with the character still wallking when road scrolling reach the end of the screen.how would i stop that?heres script:

Code:
//road scrolling
road.onEnterFrame = function() {

[code]......

View 7 Replies

Dragging The Stage From Left To Right To Reveal Hidden Areas Off The Edge Of The Stage - Part 2

Dec 10, 2009

I have created an animation (see attached) where the stage can be dragged from left to right to reveal hidden areas off the edge of the stage. Unfortunately I need to add buttons containing links to websites within the dragable movie symbol and I can't work out how to do it.

View 2 Replies

ActionScript 2.0 :: CS3 Character Animation Not Stopping?

Jul 30, 2010

I have a character that is moving left and right across the screen. When it does there is a running animation that takes place from the idle animation to running, that part work but it does not go back to the idle animation when you release the left or right button.

View 8 Replies

ActionScript 3.0 :: Stop An Image At Edge Of Stage?

Jul 12, 2011

I'm creating a navigation bar for a website, and the client wants a little car to roll back and forth as you mouse over the buttons. Ok, that's easy enough, I say to myself, but I've run into a hitch.

When the page loads, (before you mouse over anything) the little car is sitting half off the stage, that is, only half the car is visible. I fixed that by putting the car symbol's registration point along the left side, but then the car's left edge is whats following the mouse. I need the cars center to be whats following the mouse, but at the same time, not be able to slide off the screen.[code]...

View 1 Replies

ActionScript 3.0 :: Lock The Stage So Cannot See Past Edge?

Feb 7, 2010

my stage is set at 500x400 in flash cs4. I created a rectangle for the background and set the same size as my stage that covers the whole stage but I noticed when I hit ctrl+enter to test the movie clip, it initially looks fine but when I expand the window large, you can see white area all around.

View 3 Replies

Professional :: Objects On Edge Of Stage Disappear In Video?

Aug 16, 2011

I am a newb to Flash CS5 Pro, so I can't tell what is wrong. I have multiple objects on my stage that I copied to create afull effect. Most of the objects perform perfectly, but the ones on the edge of the stagedisappear when I export to video. When I zoom in to look at them, they are there,but when i zoom out to fit to page, they are gone

View 2 Replies

ActionScript 3.0 :: Map Which Can Be Scrolled By Moving The Mouse To The Edge Of Stage?

Mar 9, 2011

I just finished some code to get enemies in my game but im experiencing strange behaviour within the game.My game currently is a 2000x2000 map which can be scrolled by moving the mouse to the edge of stage... i just tried adding some enemies.

Whats happening here is that the red bordered enemies stick to a position on the screen. The green bordered enemy scrolls with the map.In my code im trying to spawn 10 enemies, and have them update their positions according to map scrolling.

heres my code

[code]...

View 4 Replies

ActionScript 3.0 :: When Mc Hits Stage Boundary - Transfer To Opposite Edge

May 14, 2011

I have an mc which moves on pressing buttons. I want it to come to the left of the stage if it hits the right end. Simple, isn't it? But I want to have one move thing done. I want only that part of the mc to come to the left which has hit the boundary. For example, Let this be the mc-

[Code]....

View 1 Replies

ActionScript 3.0 :: Stopping Stage.MOUSE_DOWN When Other Button Is Clicked?

Jan 26, 2010

I've got an MOUSE_DOWN listener on the stage (it's a rough drawing tool thing) and I've also got a bunch of other buttons on the stage with MouseEvent.CLICKs on them. The problem is that the stage.MOUSE_DOWN still gets called when the buttons are pressed. Is there a simple way to stop that happening or do I just have to deal with having a boolean set and unset that blocks the code in the stage.MOUSE_DOWN event function?

View 3 Replies

ActionScript 2.0 :: Random Pictures Loaded On Stage - Stopping Blur Tween

Dec 27, 2010

In this game I dynamically load 9 random pictures onto the stage. They all start off with maximum blur. The idea is that when the user hears a sentence the pictures gradually lose their blur. The sooner the correct picture is clicked on, the higher the score. My problem is, I can't stop the tween when the user clicks on a picture. I've tried it successfully on a much simpler fla, where the images are already on the stage and not loaded from an external source.

Here's my extracted code - the source fla is way too long to attach.
Actionscript Code:
import mx.transitions.Tween;
import mx.transitions.easing.Strong;
import flash.filters.*;
import mx.controls.Loader;
var totalBlur:Number = 100;//100 is maximum blur,
[Code] .....

View 1 Replies

ActionScript 2.0 :: [FLASH5] With Strings - Check When The Last Character Of The Text Loaded Gets Out Of The Stage

Oct 1, 2003

I'm using flash 5 to develop a dynamic banner. It loads a txt file in an single line text field that moves from right to left, similar an electronic bank display. What I need is to check when the last character of the text loaded gets out of the stage (-x), so I can send the text field to its original position simulating a continuous loop animation. (I could do this using flashMX cause the text field scales according to the text size but I have to use flash5 ).

View 7 Replies

ActionScript 3.0 :: HitTestObject - Character To Walk Down The Screen And Hit The ObjectWall And Then A Movieclip Gets Added To The Stage

Apr 13, 2012

i want my character to walk down the screen and hit the objectWall and then a movieclip then gets added to the stage and plays but it doesnt seem to work and ii dont know why.

[Code]...

View 1 Replies

ActionScript 3.0 :: Character Animation - When I Press Left Or Right Key - Draw Each Frame That Makes Character Movement?

Sep 24, 2010

I have a 9 frames image of a character.In other language generally i used to make character animation by looping the array consisting of different frames and drawing each frame when pressing key.What i want to do is when i press left or right key, i want to draw each frame that makes character movement and update x coordinates of frames, and it will appear as character is moving.

View 4 Replies

ActionScript 3.0 :: Regular Expression To Test If A Single String Character Has Both Upper And Lower Case Character?

Nov 27, 2010

Does anyone know the regular expression to test if a single string character has both upper and lower case character?

eg. All A-Z and a-z.

View 0 Replies

ActionScript 2.0 :: Drag Throw Scroller - Ease Into Place Stopping And Showing The Second Image Stopping The Image At X Axis 0

Feb 18, 2009

I want it to while still easing into place like the iphone does. For example my stage is 550px. The drag and throw MC is 1650. That's 550x3. If the first image is showing starting at x axis 0 and you drag to the left it will ease into place stopping and showing the second image stopping the image at x axis 0. And the same thing scrolling to the next one and scrolling back. So the code is below and I've attached the movie that I'm working on.

[Code]....

View 8 Replies

Actionscript 3 :: Stopping Sounds Without Stopping Bgm?

Dec 25, 2011

flash pro. as 3.0.animation . almost no codes except ends of scenes having :

import flash.media.SoundMixer;
if(SoundMixer.areSoundsInaccessible() == false)
{
SoundMixer.stopAll();
}

[Code]...

i got this scene, with this specific bgm , individual frame layer. and the sounds at another layer. what i want is to stop the sound without stopping the bgm . (yes, i know the above code wouldn't work as it stops all sounds)

View 1 Replies

ActionScript 2.0 :: Make A Movieclip Of A Character And When The Character Is Dragg?

Aug 11, 2009

i was wondering if any of you out there could tell me how it is possible to make a movieclip of a character and when the character is dragged about the screen by the curser, how do you make the characters arms and legs swing about in a realistic fashion.

View 2 Replies

Flash - Calling The Function Within That Function And Later Stopping The Loop - Starting And Stopping Functions?

Jan 7, 2012

I am making a character walk. This code will make him wobble to the right and when thats done it will trigger him to wobble to the left and then call the function again to continue the loop.I can get the loop to work fine by calling the function but how do I STOP the function? Also I want to call it later on. Is there a way to start and stop a function?

function wobble()
{
var ws = .1;
var dis = 1;

[code]....

View 2 Replies

ActionScript 2.0 :: Action Tween - Clicks Somewhere On The Stage The "character" Moves To The Position That Was Clicked

Dec 30, 2008

how to do a basic action tween in actionscript 2. I can only find tutorials on AS3 ones or AS2 ones with easing, i dont want easing. i want it so when someone clicks somewhere on the stage the "character" moves to the position that was clicked.

View 2 Replies

ActionScript 2.0 :: Drunk Moving Character To Be Able To Catch Character And Play A Scene From Within The Drunk Characters Movie Clip

Jan 13, 2004

I would like my character to move as if he was drunk I am unsure how to do that I am using the keyboard for his movement. I also have a character that moves at random I would like the drunk moving character to be able to catch this character and play a scene from within the drunk characters movie clip but I want this character to try and escape the idea is the drunk character gets points for how long he is able to hang on to this character

View 2 Replies

Actionscript 3 :: Get Edge Coordinates?

Feb 2, 2011

I'm trying to move movieclip Ball along the borders of movieclip Ground. You would move the Ball with the arrow keys which would increase and decrease its x value, but the y value will always be equal to the top edge of the Ground movieclip.

To do this I need to find the y value of the points on the edges of movieclip Ground. How is this possible?This is what the Ground MovieClip would look like. It is an irregular shape. What I want is for any x point a y point at the top edge of this shape.

View 5 Replies

IDE :: White Edge To Animation?

May 27, 2009

I have written, based on some internet tutorials, a simple header for my website to display a slide show of images. I have set my animation dimensions to 845x295, the same as each of my images. The DIV tag I then embed this into is set to the same dimensions but when the animation runs I get a white border down the right and across the bottom.

View 1 Replies

ActionScript 2.0 :: Easing Off The Edge?

Mar 22, 2004

Using Voetsjoeba's golden formula, I've made some panels that ease into place. But why can't they start at 0,0? It seems I have to start the panels from the middle of the stage or else they drift off the edge, even with x and y specified in the code.

View 8 Replies

Flash8 :: Blur The Edge Of Letters?

Mar 10, 2009

I am having problem with the text tool on flash version 8 the problem is that I am seen some blur letters when I preview my swf on explorer using dreamweaver version 8. I trying to find out what could cause the blurring the properties of the text is arial size 10 and verdana size 10. For example the period on the small i in some words look different.

View 3 Replies

Create A Feathered Edge On A Mask?

Nov 19, 2009

how do i create a feathered edge on a mask?

View 13 Replies

AS3 :: Flash - Find Edge Of Movieclip?

May 21, 2011

movieclips in flash have a Rectalge Zone . if we have a Circle shape and covert to movieclip , have a Rectagle Area.with empty area.

i want terminate this area when az drag any moveclip on my target movieclip. when i use hitTestObject do now work good.

View 1 Replies

ActionScript 2.0 :: Center Offset From Edge?

Sep 1, 2010

How do I determine where an MC's center is relative to its edges?

I'm developing a tool that a variety of noobs (as if I'm not still a noob) will be using, and I don't trust them to keep art with 0,0 being the top left corner.

How do I figure out that the left edge is now at -111px, and the top at -52, and the right at 12, and the bottom at 334?

Or what if they draw it so the left edge is at 56px and the right edge at 583?

Essentially, I want to determine the center of my artwork, wherever it is relative to the center of the MC

View 1 Replies

ActionScript 2.0 :: Tooltip Goes Off Edge Of Screen

Dec 6, 2005

I have a tooltip that follows the mouse, but i need to to figure out where the edges of the screen are and always keep the tootip on the screen. Its something to do with screen width and height.

View 3 Replies







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