ActionScript 3.0 :: Multiple If Statements - Place All Of The Same Parts Of The Face?

May 6, 2010

I am working on a puzzle has four different eyes, nose, and mouth. These can be placed on a blank head. I want to be able to place all of the same parts of the face, and have a response that says "Beauty" if the mix up the pieces from different faces, it will say "Beast." I don't know how to set up the AS3 to make this work.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: If Statements - Moving One Item To Certain Place

Jan 10, 2005

I am using the following to move one item to a certain place once the first item has reached there:
[AS]
if (mc_skip._y - 1 < 20 && mc_skip._y + 1 > 20) {
mc_skip._y = 20;
mc_skip_b._y = 20;
//the movieclip is within 1 point of where you want it
} this.onEnterFrame = function(){
trace("Button:" + mc_skip_b._y);
trace("Text:" + mc_skip._y);
}
[/AS]

Why does the mc_skip_b not move to 20 _y? I am tracing it, and it's definitely going to 20 _y so I don't get it?

View 2 Replies

Actionscript 3 :: ByteArray With Multiple Parts?

May 27, 2011

I'm thinking about distributing bytes of a SWF into multiple files, how can i put a set of bytes in different parts into one byte array?

[Code]...

Also would reading partial bytes into a byte array work?

View 1 Replies

ActionScript 3.0 :: Simulate A Pause Command For Multiple Parts Of A Game?

Oct 8, 2009

I need to simulate a pause command for multiple parts of a game I'm programming. How do I start the timer, then stop it after 10 seconds in as few lines of code as possible without using multiple functions?

View 3 Replies

IDE :: Make Some Buttons That Play Different Parts Of Multiple Movie Clips?

Mar 10, 2010

I am trying to make some buttons that play different parts of multiple movie clips- and also link to a url. I also want to be able to click on a movie clip and make it play starting from a certain point (this is what I have been working on) I have this code

stop();
_root.frogdance.stop();
froggy.onRelease = function() {
_root.frogdance.play(4);
}

it is on an actions layer of my main timline- I am not sure if I put it in the wrong place or what- but it doesn't do ANYTHING when I click on it when testing the movie. I gave the frogdance movie clip the instance name 'froggy' in the properties panel. The rest of what I am working with will be buttons that do things- but I also want this movie clip thing to work...

View 1 Replies

Professional :: Multiple Statements One Drop Box?

Apr 9, 2010

So I am creating a drag and drop game but the thing is that there is not one question for each statement. Is it possible to have say... 10 statments on the right and one "box" on the left where the statements can be dragged to, if its correct it stays there, if its incorrect it goes back to its original position.

View 12 Replies

ActionScript 3.0 :: Loop For Multiple For Statements?

Oct 20, 2010

I need to put a load of MC's on stage with the use of an array as such:

Code:
for (var i = 1; i = 4; i++) {
if (reg[i] == "singlewall") {
var Wall:MovieClip = new wallClass() as MovieClip;
mainClip.addChild(Wall);
}
}

I need a lot more then 4 though and I need a way to make new "Wall" variables
Tried doing it with:

Code:
for (var i = 1; i = 4; i++) {
if (reg[i] == "singlewall") {
var Wall:MovieClip = new wallClass() as MovieClip;
Wall.name = "mc"+i;
mainClip.addChild(Wall);
}
}

This does not work though, yields an infinite loop somehow

View 4 Replies

ActionScript 3.0 :: Multiple For Loops Within Various If Statements?

Jul 28, 2011

I'm building a quick products display app for my company (basically customers put in certain numeric values and the app recommends a product based on the numbers.) I've done this with if statments and addChild()s

Now if they've gotten one result and they want to try with different values I need to removeChild() the product images from the stage.

So far I have this working by adding the addChild()s to an Array and using a for loop to remove them everytime the calculate button is hit. This works fine until I get to product double ups (some products can work across multiple values) then it errors.

Below is part of the code I've shorthanded some of the parts which are working fine as well as the repeat parts so that it's not just a whole blob of code

Code:
stop();
import flash.display.MovieClip;
equal_btn.addEventListener(MouseEvent.CLICK, equClick);

[Code]....

View 6 Replies

ActionScript 3.0 :: Multiple If / Else Statements - Not Working

Dec 31, 2010

I've been developing an AS3 based 2D fighting game engine (like Street Fighter II), and have run into an issue. I'm using if/else statements in my onEnterFrame function to hit test my fighters. This works great in my first if/else statement, but for some reason it doesn't recognize my second if/else statement that follows the first. I know it's not the code, because if I bring the second if/else statement up and place it above the first statement (simply swapping the order), the hit test is successful. Why is it that only the if/else statement that comes first works, but any that come after it don't?

Here's my code:
function onEnterFrame(event:Event):void {
//MOVE THE char1
PlayerBase.players[0].x += plyr1vx;
PlayerBase.players[1].x += plyr2vx;
[Code] .....

I've also attached a .zip file with my published files so you can see the issue in the game (must be viewed in a browser for keys to work correctly). Move the left player using "A" and "D" keys. Make him punch with "Z" and kick with "X". Punch is the first if statement in my code, and kick is the second if statement (not working).

View 10 Replies

ActionScript 3.0 :: Load Multiple Parts Of An XML File Into One Dynamic Text Field

Aug 12, 2011

I am trying to load text from an external XML file into a dynamic text box. I have so far managed to load single parts of the XML file into a dynamic text field. I now want to be able to load different parts of the XML file (something similar to a string with appendText) into the same text Field. I have so far managed to achive this using the String and append text properties, but would like to use XML file to do it instead.

View 1 Replies

ActionScript 3 :: Multiple Statements In For Loop (1084 Error)

Sep 30, 2011

I'm trying to do a binary search in a for loop. However, flash does not like the following for loop.
for(var select:int = Math.floor((min + max / 2)), var turns:int = 0;
turns < input.length / 2 + 1;
turns++, select= Math.floor((min + max / 2))){
if(input[select] > want){ max = select;
} else if (input[select] < want){
min = select;
} else {
return select;
}}

On the first line I get 1084: Syntax error: expecting identifier before var. I think I know why (I'm using , to separate the different statements), but how do I fix it? ; won't work since it's what the for loop uses.
( var select:int = Math.floor((min + max / 2)) ;
var turns:int = 0);
turns < input.length / 2 + 1; //etc
does not work either.

View 2 Replies

ActionScript 2.0 :: Multiple If Then Statements To Check 3 Text Fields

Sep 9, 2010

I am trying to check 3 scores at once. Is there a better way to code this... I want to check to see if they are all tied? If one score is greater than another? Seems like there should be a more cleaner way.

[Code]....

View 4 Replies

ActionScript 2.0 :: Replacing Multiple Statements With A Loop - Syntax Incorrect?

Jun 30, 2009

I have a series of images loaded in via XML and assigned to "loady" movieclips. This code works fine:

Code:

_root.myMCL.loadClip(_root.myImages[0].attributes.url,_root.loady0);
_root.myMCL.loadClip(_root.myImages[1].attributes.url,_root.loady1);
_root.myMCL.loadClip(_root.myImages[2].attributes.url,_root.loady2);
_root.myMCL.loadClip(_root.myImages[3].attributes.url,_root.loady3);

[code]...

I want to replace this with a loop since I know the total amount of items (myImagesNo), but this isn't working:

Code:

for (i=0; i<_root.myImagesNo; i++) {
_root.myMCL.loadClip(_root.myImages[i].attributes.url,this["_root.loady" + i]);
}

View 2 Replies

ActionScript 2.0 :: Replacing Multiple Statements With A Loop / Syntax Incorrect?

Mar 12, 2010

I have a series of images loaded in via XML and assigned to "loady" movieclips. This code works fine:[code]

View 1 Replies

ActionScript 3.0 :: Using Multiple If Else Statements & Manual Dynamic Xml Data Input To Trigger A Goto And Play

Dec 19, 2011

Below is code that has a timer countdown that reads off of the computer. Below in bold is code to read "if it reaches the date, go to and play frame (2).

[Code]...

Below is code that is manual input - I had set up a dynamic txt field in flash named it : raffle_tix_remain When loaded on to the host I can manulally update the xml code and the change will take effect. raffle_tix_remain.text = root.loaderInfo.parameters.raffle_tix_remain;

My question: Since the raffle_tix_remain is a manual input from a user to xml Is there a way to tell flash once it refreshes and "raffle_ tix_ remain" goes to (0)zero gotoAndPlay(2); and let it play like a "sold out" sign i guess that would be a if else statement.

[Code]...

View 1 Replies

Professional :: Copy Multiple Frames From One File To Another And Paste In Place?

Mar 25, 2010

How can I copy multiple frames from one file to another and paste in place? For some reason when I do this flash pastes them to the left of where they need to be even though the stages are the same size.

View 5 Replies

ActionScript 3.0 :: Multiple Flv Player - Load A Different Video When A Button Is Clicked In The Exact Same Place As The Old One

Jun 26, 2009

im creating a portfolio website that primarily uses flv videos for graphics. For example, if you click to go to another section of the website a video plays that actually walks you to that area. What I want to do is be able to load a different video when a button is clicked in the exact same place as the old one. I currently have a working class that plays a video

[Code]...

I want to some how be able to change the variable flvName on the click of a button on my stage and recall the class to change the video. If you can think of an alternate way of doing what i need to do id love to hear it.

View 0 Replies

ActionScript 2.0 :: Use Multiple "if" Statements?

Mar 1, 2002

say i want something to happen, but I only want it to happen if more than two conditions are satisfied...is there a way to use multiple "if" statements?

View 3 Replies

ActionScript 2.0 :: If Statements Within If Statements?

Oct 7, 2004

If they get a question wrong in my quiz ( weakest link) the money clip goes to zero and it goes onto the next question. If they get it right the money clip advances and they go onto the next question. I want to include each time that it should only go onto the next question if all questions have been asked. SO i want an extra if clause in both sections, saying if current question is more than 11 go to '#game over"The questions are saved in the frame of the quiz

_root.qArray = new Array("question: A;B;C;D")
_root.qArray.push("Question?:A;B; C; D")

There are 11 questions.At the moment at the section with choosing answers I have

function selectAnswer(n) {
// correct
if (answers[n] == correctAnswer) {
_root.money.nextFrame();

[code].....

View 1 Replies

ActionScript 2.0 :: Bitmap Data - Place Smoke Effect At Specific Place

Feb 1, 2011

How to make this smoke effect work without mouse input. I am trying to have it spill from the end of a cannon, & my attempts to modify the position have resulted in all my bitmaps shifting. I changed this
doTrail(_root, _xmouse, _ymouse, currentBitmap);
To this
doTrail(_root, _x=80, _y=100, currentBitmap);
[Code] .....

View 0 Replies

ActionScript 2.0 :: Duplicate A Movie Clip And Then Place It On A Certain Place On The Stage Set _x And _y?

Apr 8, 2005

how can i duplicate a movie clip and then place it on a certain place on the stage

View 5 Replies

ActionScript 3.0 :: Place A Scrollpane In A Specific Place On Stage?

Aug 21, 2010

I've used .x = and .y = with the position I want and the pane continues to show up in the top left corner instead. What am I doing wrong?

View 2 Replies

ActionScript 2.0 :: Place Hundreds Of Instances Of One Movieclip On Different Place?

Mar 7, 2008

how can we place hundreds of instances of one movieclip on different place?

for exemple, pacman:

how should i code the placement of all the money?

i would go:
_root.attachMovie(
_root.attachMovie(
_root.attachMovie(

but that's not the good solution is it?

there must be a code to do that without hundreds of lines of code.

View 3 Replies

ActionScript 3.0 :: Multiple PM's To Take Place In Their Own Individual "windows"?

Mar 26, 2011

I'm trying to make a chat room that basically has a static background but it also allows for multiple PM's to take place in their own individual "windows" that can be dragged around the screen...

I think I can manage the basics but how do I create a template for the PM windows and how to I use them?

I've been trying to find some information on it, but the queries I've come up with have pretty generic terms and is therefore not returning any helpful results.

View 1 Replies

Actionscript :: Away 3D Face Link?

Aug 15, 2011

I'm recently playing with Away3D Library and have a problem in finding Face center in Away3D. Why Away3DLite has a face.center feature while Away3D doesn't have it ? and what is the alternative solution for this ?

View 1 Replies

ActionScript 3.0 :: Put Each Face Into It's Own ViewportLayer

May 22, 2010

I have the project where I need to use papervision3d engine. It's 3d model of building. Each floor is separate .dae model embedded within swf file. Everything is okay regarding performance, but z-sorting of BasicRenderEngine is making me sad. If you take a look over attached image you will see that sometimes wall faces appear above cover and backwise, cover faces appear above wall. Each floor model was made with Swift3d by path extrussion. It has two types of material: one for wall and another for cover. Is there any way I can go through all faces and regading material applied to it assign them ViewportLayer and sort index ?

I tried to use QuadrantRenderEngine, it does correct z-sorting, but is CPU killer.

View 1 Replies

ActionScript 2.0 :: Rotating To Face Something

Oct 13, 2004

is it possible to rotate an object so that it always faces another object that is able to move around the screen? as in track it on the y and x axis?

View 2 Replies

Rhino Charging At You Face On Animation

Nov 19, 2010

I have a flash movie i would like to create that will be around 400px x 500px.

I would then like to have a rhino charging towards you (the user) so it would have the effect that the rhino is trying to break the screen to charge at you (face on) but it stumbles because of the glass on the screen.

how they would go about this animation?

View 1 Replies

How To Replace Face / Image In Animation Like On Elf

Aug 31, 2009

I am making a simple Flash animation that I would like to put online and let people visiting my site upload a picture of their face so they can be the character, like on Elf Yourself. How do I do that? I'm assuming I make the animation with a square image of a face that I mask out, and the image gets replaced when a new one is uploaded, but I don't know how to set that up dynamically, or if there's a better way.

View 3 Replies

ActionScript 3.0 :: Upload Face To Put On Avatar?

Sep 3, 2009

what is involved to create a Flash file where the user can upload a .jpg of their face, crop it, and then add that picture to an animation? I'm sure you've all seen this...sort of a jib-jab type animation.

View 1 Replies







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