Flash 'if Statement' - Getting Errors?
May 18, 2010
Ive been working on a pong game, and its coming alond well, but i have a problem with that if your score is 5, or the AI's score 5, it goes to the 'you lose/win' screen.Well, ive been working with this:
if(bluesco==5) {
gotoAndStop(6);
}
bluesco is the enemys score
6 is the lose frame
Ive tried everything i can, ive added _root.'s, changed the equals (to things like '=', '==', '>=4'), and tried things like 'nextFrame' instead of '(6)', ive changed the instances thousands of times, and if it helps:
score = 0;
bluesco = 0;
Ive also put the top code on frames, movieclips, even buttons, but i either get these errors: Nothing happens when the score gets to 5.It goes to frame 6 as soon as the frame is loaded
View 6 Replies
Similar Posts:
Oct 2, 2010
I try to learn Package in AS 3.0. I copy and paste the following code into .as file [URL] When I test it, it doesn't work. It has the message "Javascript Errors. Missing ";' before the statement". I looked into the code, I didn't see any missing ";". Anyone has run this code successfully?
View 1 Replies
May 14, 2009
Having a few problems with what I thought was a simple if statement. Here is the code:
[Code]...
I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.
View 7 Replies
Aug 31, 2011
if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code
[Code]...
I dont want to copy the code from the first into the second and the first and second into the third.
My mind isn't working and there is probably an extremelly simple way to get this working.
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.
View 7 Replies
Oct 10, 2008
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
[code]....
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
View 1 Replies
Mar 30, 2011
why this code won't work
[Code]...
I'm sure you can put if statements inside other if statements, seriously I can't figure it out
View 4 Replies
Sep 22, 2010
I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.
View 13 Replies
Jul 12, 2010
what I'm trying to do is create an else if argument for each object in an array based on a user set number
Code:
for(var i:int=0; i < numberOfElseIfs; i++){
GENERATE AS3 CODE
}
to which I want it to GENERATE THE FOLLOWING CODE:
Code:
}else if(baskets[i].used == false){
baskets[i].used = true;
drawButton(i);
}
the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?
View 4 Replies
Dec 18, 2011
I have a movieclip on the screen called "mc_bg". Within this movieclip are 7 movieclips called "barrier1" through "barrier7".From main.as I want to be able to do this call:
for (var i: int = 1; i < 3; i++ ){
trace("got here")
trace(mc_bg["mc_barrier" + String(i)])
[code]....
View 1 Replies
Oct 27, 2010
i'm trying to make a simple flash movie in cs4. scene 1 > click a button > gotoandplay scene 3 thats all.
[Code]...
View 1 Replies
Jan 16, 2012
[code]...
**I got these errors, and probably more after those:
1046: Type was not found or was not a compile-time constant: ProgressBar.
1180: Call to a possibly undefined method ProgressBar.
View 1 Replies
Jun 2, 2011
Just upgraded from CS5 to CS5.5Code that worked in CS5 now gives compiler errors:Symbol 'VideoPlayerMC', Layer 'Layer 2', Frame 1, Line 211119: Access of possibly undefined property state through a reference with static type flash.events:VideoEvent.Symbol 'VideoPlayerMC', Layer 'Layer 2', Frame 1, Line 421119: Access of possibly undefined property PLAYHEAD_UPDATE through a reference with static type Class.
View 7 Replies
Feb 5, 2011
I download Flash CS5 and I try to execute it without an error message coming in and basically the program does not start.The message goes as follows:
Flash.exe - Entry Point Not Found
The procedure entry point ?ik_treelsActive@CFlashIK@@QAE_NJ@Z could not be located in the dynamic link library FlashIK.dll.So then I tried to install the updates via the website and the AdobePatchInstaller.exe and I get this:
Some updates failed to install.
Update is not applicable.
So here I am unable to start Flash CS5. Anyone know a way to fix this issue?
View 1 Replies
Apr 24, 2012
I have an weird issue with a fla file. I've worked on a big project for a long time ago. I use cs4 to compile the fla and Flash Develop for the classes. Yesterday I compiled many times and suddenly CS3 stopped executing actionscript. There is no compile errors, nothing. Just doesn't execute the code. I typed a simple trace in the first frame and deleted the symbols on the stage - it didn't trace nothing.When trying to compile this file I noticed that the size of the compiled swf cut down in the end of compiling - in decreases from 700KB to 300KB. I made a size report - it is strange that action script bytes is only 6, but I have many (about 100) classes:
ActionScript Bytes: 6
Location: ActionScript 3.0 Classes
It doesn't run any action script no matter whether it is in classes or directly in timeline frames.
The problem is not with CS3 because it compiles perfect other flash files. Do you have ideas why it happens? I've never seen such problem before?
View 2 Replies
Apr 24, 2010
I have been given an SWF to edit a link in the AS code. The fact is the SWF uses some XML that is generated (actually retrieved) by PHP code from a database. menuXML.load("/sub/page/dynamic.php?genre=" + genre); so the point is we can use the same SWF 'mainfraim' and fill them with different animations/sources based on the link provided in dynamic.php?genre=### Now, I've used Flash Decompiler Gold to extract all files in the SWF and can open it again in Adobe Flash to edit it. When done I enter CTRL+ENTER and there are immediately 4 compiler errors!! Errors:
1x < Unexpected 'if' encountered >
2x < Statement block must be terminated by '}' >
1x < Ecpected a field name after '.' operator. >
How can these errors be present, when the original SWF works perfectly??! If I don't manage to solve this, I'll have to find out how to create an .php file the SWF tries to use which can select the proper resources (from a database I guess) to show them (using ?genre=###)
View 1 Replies
Aug 7, 2010
what changes I make to my source, compiling alway yields either a transcoding error, or a missing definition. The stack overflow link I always put in all my source, to look at for encouragement every time I feel like banging my head against the keyboard.
// Main.as
package
{
// General imports
[code]...
Currently when I try to compile I get the following error...
C:Documents and SettingsGekoDesktopFlash estclientsrcMain.as(6): col: 31
Error: Definition com.bit101.components:Label could not be found.
and if I remove the comment from "var myLabel" or "addChild lines" in Main.as, then I get..
C:Documents and SettingsGekoDesktopFlash estclientlibMinimalComps_0_9_5_srccomit101componentsComponent.as(51): col: 4: Error: transcoding parameter 'embedAsCFF' is not supported by 'flex2.compiler.media.FontTranscoder'
C:Documents and SettingsGekoDesktopFlash estclientlibMinimalComps_0_9_5_srccomit101componentsComponent.as(51): col: 4: Error: Unable to transcode /assets/pf_ronda_seven.ttf.
My classpaths are "src", "libMinimalComps_0_9_5_srcassets", and "libMinimalComps_0_9_5_srccomit101components" I'm using Flex SDK 3.5.0.12683 on Windows XP with FlashDevelop 3.2.1 RTM why I'm constantly receiving errors each time I try to build the project?
View 1 Replies
Apr 3, 2011
i'm suddenly experiencing errors in font rendering in my project.the following image is a square sprite with a texture and 2 dynamic text fields as children.the text itself is correct. the bottom field is a 32-bit hexadecimal color ("H: 0xFFFFF4A1"), but as you can see some of the characters are stretched ("x", "4" and "1"). it's the same in the first text field which lists each color in ARGB format.
the font being used is Myriad Pro Condensed. i was originally using Myriad Pro Bold Condensed, which i was using for months, but suddenly yesterday the font became even crazier than what's visible here so i switched. now this font is being rendered incorrectly also.
i've validated the fonts.
i've deleted my ASO files.
i'm using cacheAsBitmapMatrix on the parent sprite object, but cacheAsBitmapMatrix is suppose to only affect mobile devices so i'm not sure why it would be rendering the font like this (if it's the problem) while running under ADL on my desktop.
newSwatch.cacheAsBitmapMatrix = new Matrix();
newSwatch.cacheAsBitmap = true;
this is how i'm calling the font, which is embedded in my library.
//Create Text Field
private function swatchTextField():TextField
{
var myFont:Font = new MyFont();
[code]....
UPDATE:this error was indeed not a problem with Flash but a bug Apple introduced in Mac OS X 10.6.7 that affected the display and printing of some open-type fonts. [URL]
View 3 Replies
Jul 19, 2011
As with most IDEs when you type something that is an error it will highlight it with the red cross or red underline, and this is what used to happen in Flash Builder 4 but for some reason now it does not work.
I can type any old garbage and hit save, which forces the build (I have build automatically selected) and no error shows on the line, or in the Problems panel.
View 1 Replies
Oct 6, 2011
Flash app I've built works fine on desktop and on IIS6, but when I upload to IIS7+ it breaks.Most of the app appears to work as expected but a crucial test fails. I think it's a custom event that is failing, but I've no idea why when it works perfectly everywhere else.My app is built with Flash CS5 and AS3 for Flash player 10.BTW it's not a MIME type issue.
View 1 Replies
Dec 19, 2008
I'm using Flash CS4 and flash player 10,0,12,36. My fla compiles completely when i "Test Movie" but it loops as if it didn't compile correctly- AND it gives no output or error messages. I have no idea what could've caused this. If i change the code to intentionally produce an error, it will then display an error message. My app has an external swf file that it imports if that matters. But like i said it all worked fine just 2 days ago, and i don't think my cat jumped on the keyboard -accidentally deleting anything since there are no error messages.
View 11 Replies
Jan 8, 2011
Other errors just came up
var minNum:Number=0;
var maxNum:Number=7;
var minother:Number=8;
[code]....
View 1 Replies
May 7, 2009
I installed flash cs4 the other day and ever since firefox will popup annoying errors. Its probably some debugger, but i want it disabled cause it comes up 5-6 times in a row when i browse the internet, (usually will happen on facebook or some youtube vids in blogs). the error starts like this: TypeError #1009 I will paste the whole thing in this thread the next time it happens, but i'm pretty sure the error itself doesn't matter, i think some debugger was installed in firefox when i installed flash cs4.
btw I want to make a multiplayer risk game for facebook in flash. think it will be hard? i'm already well versed in php and mysql. but i don't know any flash. i want my flash app to communicate with the server without reloading. is that easy with actionscript? will i need to learn AJAX as well?
View 2 Replies
Jan 4, 2010
Stop errors appearing in another window when swf is run in flash player?
View 1 Replies
Jul 21, 2009
I have 2 errors after test movie from a mx 2004 file with Flash Pro 8. Errors : as follows :
"Error" :Symbol=PuzzlePiece, layer=Layer 1; frame=1, Line 1: The class or interface 'PuzzlePiece' could not be loaded.
"Error": Symbol=DropZone,layer=Layer 1:The class or interface 'DropZone' could not be loaded.What cause the errors ?
View 7 Replies
Oct 15, 2009
I'm trying to open a pdf inside flash. I followed a tutorial online but I'm have issues with the compiler. Here's my code:
import flash.html.HTMLLoader;
import flash.html.HTMLPDFCapability;
import flash.html.HTMLWindowCreateOptions;
if( HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK ){
[Code] .....
It results in these errors:
1046: Type was not found or was not a compile-time constant: UIComponent.
1180: Call to a possibly undefined method UIComponent.
I've tried to import fl.core.UIComponents in the beginning but that resulted in this error: 1172: Definition fl.core:UIComponent could not be found.
View 2 Replies
Dec 28, 2009
I have a inDesign CS4 (.4 update) exported SWF that behaves badly when it is imported into Flash Pro CS4 (.2 update). Hyphens in the text on word breaks are being changed into question marks. Font used is Arial. The SWF ( attached) views fine in Flash Player 10, but produces the errors when imported to the stage. I have tried all settings (Text to Vector Paths, Text to Flash text) but the result is the same. Rasterizing the text is unacceptable because text quality is severely reduced on zooming the Flash document.
If you try importing the attached SWF to a blank file stage, you will see the errors on page 3.So far, the only fix I have is creating all text in flash.
View 7 Replies
Jun 8, 2011
if I put a TLF in my FLA, doesn't matter where, the project compiles but as soon as it runs triggers errors that are not related to TLF at all.It doesn't find a linked class apparently. A class which has nothing to do with TLF. I remove the TLF (in root, anywhere I put it no difference) and the project runs again.
View 1 Replies
Aug 13, 2011
package{ import flash.display.MovieClip;public class Main extends MovieClip { var startPage:StartPage public function Main() { startPage = new
[code].....
View 2 Replies
Feb 4, 2010
I'm am super new at this, and this is my first time ever using Adobe. I get the "joy" of doing a project in my school using The CS4 Suite. I was playing around and using this book to help me get a button to start an action. I have tried many different codings, but this one gets me the least amount of errors. This is what I have so far:
[Code]...
View 1 Replies
May 22, 2010
I try to recompile a flash package from somebody who has left the company and I have some difficulty to understand why I can't. There are only warnings of type "variable 'x' has no type declaration" when building so why does it halt ?
View 3 Replies