ActionScript 2.0 :: Show MyMessage When Score Reaches 10?

Mar 18, 2010

I want to show myMessage when score reaches 10. But these lines doesnt work.

score = 0;
if (score = 10) {
myMessage.text ="WIN!";
}

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Get The Game To Stop When It Reaches A Certain Score?

Feb 24, 2003

The game Iam busy with, it keeps score how do I get the game to stop when it reaches a certain score?

View 3 Replies

ActionScript 2.0 :: Goto New Scene When Score Reaches Certain Number

Apr 14, 2003

I'm trying to create a game for a class project, using Flash MX. Unfortunatly, I am unable to figure out how to goto a new scene when the score reaches a certain number.

The ActionScript for it is...:
//hit
_root.total = _root.total + 100
//miss
_root.total = _root.total - 50
[Code] .....

I've even tried using ""'s around 'score' and other things, but still no luck. I still havn't figured out the stupid timer either...

View 5 Replies

ActionScript 3.0 :: Score Board For A Game Show?

Jun 7, 2011

I need to create a score board for a game show at work for staff. The score board must keep score on the left and right parts of the screen. score must start as default on 0. Then every time I press for example the left arrow key the left score must increase by the value of 1 and when I press the right arrow key the left score must decrease by 1.Same goes for the right score only with differant keys example up and down keys. This sounds very simple and I managed to get it to work when I tested with only 1 score, but failed when adding the second score to the picture.

View 5 Replies

ActionScript 2.0 :: Only Show Button If User Gets To Certain Score

Mar 23, 2010

I have recently created a quiz that allows user to submit score to database, however I only want the submit button to be available if the user scores 100 % (all questions correct). This is the actionscript used on the final summary screen. is there a way to add to this? if userScore = 100 then display submit button, else leave blank.

Code:
userScore=(numOfQuestionsAnsweredCorrectly*100)/
(numOfQuestionsAnsweredIncorrectly+numOfQuestionsAnsweredCorrectly)
stop();

View 3 Replies

ActionScript 2.0 :: Timer And Score-keeper Only Show Numbers 1 And 5?

Oct 4, 2011

I'm designing in AS2 - because for some reason, i thought this tutorial was made for AS2 - is this AS3 code and is that the problem??The Problem. The game runs fine, but the score keepers (both for hit and missed balloons) only show the numbers 1 and 5. so if i pop one balloon, it says 1. then for a score of 2, 3, and 4, it is blank. until i pop that 5th balloon, then it says 5, then back to blank for a score of 6.Even stranger (to me) is that the game has a count-down timer that counts backwards from 60. it also only shows then the time has a 1 or a 5 in it. same as the scores.

View 4 Replies

ActionScript 2.0 :: Get Score Text Box To Gotoandplay Another Frame - Scene When It Hits A Certain Score?

Aug 10, 2004

Im designing my own game in flash, iv set up a score text box and it works fine. Except i just cant seem to get it to gotoandplay another frame,scene, when it hits a certain score??

View 4 Replies

ActionScript 2.0 :: Score - Movie Go To Frame 3 If The Score = 500?

Feb 17, 2004

i am building a shooting game and i was wondering if it is possible to have the movie go to frame 3 if the score = 500.I.E Score is displayed in a dynamic text box and everytime the enemy is hit the:

_root.score +=50
=============
on the first frame of the film i have the code

if (_root.score == 500) {
gotoAndPlay(3);
}

View 2 Replies

Actionscript 3 :: Multiple Dynamic Text Score Display - Modifying Each Text One After Another And Incrementing The Score By A Certain Number

Feb 23, 2011

I have a result screen that shows bonus points and such. I want each text field to increment one after another and also have it increment by a certain amount each frame. Result Screen pops up. First is the player score check the player score, is it more than the score we want to display if the player score is greater than the player display score by 100 increase the player display score by 100 if the player score is greater than the player display score by 10 increase the player display score by 10 else increase the player display score by 1 when finished move to the next score...and so on. I have thought of using timers to move from one score to the next, but not being in an Event.ENTER_FRAME it only does one if then moves to the next one.

Also the if statement for incrementing the score looks ridiculous and I'm thinking there has to be a better way to do it. I was thinking of making it a separate function but then I wouldn't know what to return, or how to return it so it looks like its increasing and not just showing the total number instantly. I'll try to expand on it a little more.

View 1 Replies

ActionScript 3.0 :: Trace The Value Of A Slider When It Reaches A New Value?

Nov 25, 2008

How do I trace the value of an slider when it reaches a new value? So that I can change other properties depending on what value the slider has.

View 1 Replies

ActionScript 3.0 :: Get Rid Of A Movie Clip When It Reaches The End?

Oct 19, 2010

I am placing and modifying a movie clip using actionscript, and I want to know how I can use an if statement with the movie clip ending. I tried using this. but it didn't work:

addChild(thing);
thing.width = (500/3)+25;thing.x = 225;thing.y = 250;trace(thing.totalFrames);if (thing.currentFrame >= thing.totalFrames){  removeChild(thing);
}
 
It plays and resizes the movieclip, but doesn't get rid of it(i.e. it keeps looping). I also noticed that when I just used removeChild(thing); without the if statement, it only removed the graphics, and not the sound.

View 9 Replies

ActionScript 2.0 :: Stop The Swf From Playing Once It Reaches 100%?

Jun 29, 2007

I've got my preloader working where it loads up the external swf. The thing is what I want to happen is instead of once the loading progress reaches 100% and starts playing my swf, I want the preloader to hold off on playing the Swf and simply allow me to trigger the playback with a button. I can't seem to figure out how to stop the swf from playing once it reaches 100%. here's my code

Code:
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function(target, loaded, total) {[code].........

View 8 Replies

IDE :: Start A Movieclip When Another One Reaches A Certain Frame

Dec 3, 2009

I have been playing with this idea for a few hours and now I'm completely miserable,I have two movieclips, mc1 & mc2. mc1 is palying a simple animation.I want to write a script so that when you rollover mc2, it checks mc1's frame number. if mc1's frame number is for example "10", it should play its own animation. otherwise is should wait until mc1 reaches frame "10" then play mc2 animation.

View 1 Replies

Flash Freezing When Playhead Reaches End Of Timeline

May 19, 2009

I have a piece of code like a the end of a timeline, most usually looping back to frame one or a stop() if I let the playhead play through to this frame then flash will freeze!

View 1 Replies

ActionScript 3.0 :: Stopping Picture From Moving When It Reaches The End?

Mar 17, 2010

move picture according to mouse movement.

I have this picture moving based on mouse position. Can anyone tell me how to stop it from moving when the pic reaches the edge of the stage? On the example posted I can't stop it from moving, it goes all over the place.

This is the code I am using now.

Code:
// add listener to the stage to detect mouse movement
stage.addEventListener(MouseEvent.MOUSE_MOVE, scrollPictureLeft);
stage.addEventListener(MouseEvent.MOUSE_MOVE, scrollPictureRight);
stage.addEventListener(MouseEvent.MOUSE_MOVE, scrollPictureUp);

[Code].....

View 2 Replies

ActionScript 3.0 :: Getting Script To Stop After MC Reaches X Position

Dec 7, 2009

working on scrolling panel and trying to get the function to stop scrolling when the last frame in one direction is the last left to be displayed so it doesn't keep scrolling infinitely off the stage. here's what I have

rightscroll_mc.addEventListener(MouseEvent.ROLL_OVER, scrollRight);
rightscroll_mc.addEventListener(MouseEvent.ROLL_OUT, rremoveFast);
function scrollRight(e:MouseEvent):void {

[Code].....

View 2 Replies

ActionScript 1/2 :: Start Playback Of A Loading Swf When It Reaches 50%?

Jan 8, 2010

I have a website that loads external .swf files using XML. People viewing my website would have to wait a while for my .swf's to load as some are 5mb plus. Is there a bit of script I can use to say start playback of my .swf when it has loaded 50% of the file?

View 5 Replies

Movie Clip Disappears When It Reaches To Last Frame

Jun 24, 2010

I have a movie clip on stage which length is 600 frames. I put a actionscript 3 code "stop();)" at the end of movie. it stops when it reaches to 600 frames but it disappears from the stage as well. Which I don't want. It should stop animating but stay with last fram which has a welcome message.

View 1 Replies

ActionScript 3.0 :: When A Movie Clip Reaches X = 0 It Will Gotoandstop(2)?

Jan 27, 2011

i am creating a movie clip(gotoAndStop1) which when a movie clip reaches x = 0 it will gotoandstop(2).

View 5 Replies

ActionScript 3.0 :: Remove A Movie After It Reaches A Certain Size

Oct 10, 2009

I'm trying to remove a movie after it reaches a certain size using an event listener, but I can't seem to figure out what listener to use:

[Code]....

View 3 Replies

ActionScript 3.0 :: Fire An Event When The A Timer Reaches 0?

Jan 20, 2010

I am trying to create an if statement where when the timer reaches 0 seconds it loads level 2. It isn't working.

ActionScript Code:
private var numberOfSeconds:Number = 10;
private var myTimer:Timer = new Timer(1000, numberOfSeconds);

[code].....

View 8 Replies

ActionScript 3.0 :: Swf File Starts Before Preloader Reaches 100%

Jun 25, 2010

So everything works fine except when the preloader reaches 100% the swf already started. below has the action script in the preloader.swf file... in my main movie the first frame has stop();

ActionScript Code:
stop();
var myRequest:URLRequest = new URLRequest("3DFlashFinal.swf");
var myLoader:Loader = new Loader();

[Code]....

View 5 Replies

ActionScript 3.0 :: Removing An Object When It Reaches A Certain Point

Aug 15, 2010

I have a rounded rectangle that the x and y values will always stay the same. However it rotates around and it's height is increased (it follows moving targets). (Think of it as a turret that shoots out a beam of light that will always be anchored to the turret on one end but it gets longer and rotates so that it constantly tracks the moving targets) I want to remove the object when it moves off the screen.

Normally I would just do this with:

(if myObject.x >= 550){
removeChild(myObject);
}

and the same for each other direction of the screen. However, as mentioned, it's not the x and y values that are changing - it's the height that's changing.

Now I've tried just swapping out 'x' for height:

(if myObject.height>= 550){
removeChild(myObject);
}
etc. for the rest.

But the problem with that is that if my turret (the anchor point for beam of light) is closer to the edge of the screen (i.e. it's x is 500), then it will take a couple of second's for the light beam's height to reach 550.

View 0 Replies

ActionScript 3.0 :: Set An Action After The Third Time A Mc Reaches Its Last Frame

Nov 26, 2010

i want to code something like this:

Code:
if(mc played three times to the last frame){
addChild(mc2);
}

View 1 Replies

ActionScript 2.0 :: Go To Another Scene When Variable Health Reaches 0?

Feb 9, 2011

I have a game in which comets fall from the sky onto the player, and when they hit him helth gets decresed by 10 i want when health reaches 0(or less) for game to stop.

View 1 Replies

ActionScript 3.0 :: Animation Reaches End And Pulls Scrollbars To The Top?

Jul 29, 2011

I am working on a site that shows a .swf logo inside of other .swf files (it's a as3 xml template from activeden) and it works with several other swf logos and it doesn't do it, however with my logo it takes focus away from the scroll bars for the content whenever my logo reaches the end of the animation to loop.I have been trying for over 2 weeks to fix this and I'm finally breaking down and starting to get discouraged.

View 0 Replies

ActionScript 2.0 :: GotoAndStop When TextBox Counter Reaches 200

Sep 28, 2004

I have a dynamic text box with the var: counter, instance: c2. I have a MC on the screen with the code:
onClipEvent(enterFrame){
_root.counter ++;
}
I want to put some coding on the frame they are on to say, when the text box counter reaches 200, gotoAndStop(2);

View 5 Replies

ActionScript 2.0 :: Duplicating MCs When Variable Reaches Certain Number

Feb 18, 2003

I'm trying to duplicate a movie clip when a variable reaches a certain number.. this is the code I used...
if (numBlts<300) {
_root.power = 1;
_root.p += 1;
duplicateMovieClip(_root.plus, "plus"+p, p);
}
The problem is that I just want to duplicate it once everytime numBlts gets below 300. After numBlts increases above 300 and then goes below 300 I want the clip to duplicate. All its doing now is duplicating infinite times...

View 1 Replies

ActionScript 2.0 :: Randomly Pick From The Three Mcs As The First One Reaches A Certain Point

Dec 29, 2004

i'm using Mx Flash and i am making a game. it is called "falldown". the 'ledges' that you run into as you are falling down need to go up. i have the mc that moves up and all, but there needs to be three of them that move up to keep you from hitting the bottom. i need it to randomly pick from the three mcs as the first one reaches a certain point. in case you don't understand ask questions and i am going to post the .fla when i get on my own comp.

View 2 Replies

ActionScript 2.0 :: Can't Get The Map To Stop Its Scroll When It Reaches Its Edge

May 2, 2003

I have created a scrollable map which moves via mouse down buttons (left, right etc). Problem is I can't get the map to stop its scroll when it reaches its edge.

View 3 Replies







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