IDE :: Craps Game - Get A Lot Of Time Constant Errors And Unexpected Else Statements?

Jan 16, 2010

i'm trying to make a craps game in flash.The program starts with a login screen which takes you to a menu, then you get the choice of 3 games. I'm on my second game so far which i'm having trouble with.So far i've managed to get 2 spinners with numbers 1-6 on each, which will spin, give you the values in 2 separate text boxes then add the value together in another text box.The trouble i am having is the winning and lossing condions, where i have no idea where to start.

Rulse are if your value equals 7 or 11 you win

if your value equals 2,3 or 12, yoo lose and

if your value is anothing else then user gets another go and has to get the same value again or get a 7 and lose.

Heres code so far:

import fl.transitions.Tween;
import fl.transitions.TweenEvent;[code]....

i need to create another function or create if statements within existing functions.I tried creating another function afte the bottom function but got a lot of time constant errors and unexpected else statements whihc i didn't understand.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Run Time Errors 1046 : Type Was Not Found Or Was Not A Compile-time Constant?

May 5, 2010

I use CS4.

Code:
package {
import flash.display.Sprite;
import flash.events.Event;[code]...........

Both of these are saved in files with the name same as the classes.

Both are saved a folder which also contains an fla file name hello.fla.So,when test the movie(hello.fla),after choosing the document class as WavyBall,I get these errors: 1046: Type was not found or was not a compile-time constant: Ball.

Source: var Ball:Ball;
1120: Access of undefined property stage.
Source:Ball.x=stage.stageWidth/2;
1120: Access of undefined property stage.
Source:Ball.y=stage.stageHeight/2;
5000: The class 'WavyBall' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.What is wrong?

View 3 Replies

ActionScript 3.0 :: Runtime Errors: 'Type Was Not Found Or Was Not A Compile Time Constant?

Jun 18, 2011

I'm trying to get a Drag and Drop organised but get the following runtime errors: 'Type was not found or was not a compile time constant'

View 1 Replies

ActionScript 3.0 :: Errors With FlexBuilder - 1046 : Type Was Not Found Or Was Not A Compile-time Constant?

Jul 16, 2009

I have .fla called Helicopter and a movieclip in the library with a linkage of Fly. If I use the code-snippet(as a seperate class called Helicopter.as)below with Flash or Flashdeveloper it works fine. If i use FlexBuilder (Actionscript project)I get these errors. is there some settings I have to change in FlexBuilder?

Severity and Description Path Resource Location Creation Time Id
1046: Type was not found or was not a compile-time constant: Fly. Helicopter/src Helicopter.as line 7 1247730594859 770[code]....

View 5 Replies

Professional :: Flash Game - Symbol 'levelcomplete'1046: Type Was Not Found Or Was Not A Compile-time Constant: NextlevelBtn

Jan 22, 2012

Now getting this error: Symbol 'levelcomplete'1046: Type was not found or was not a compile-time constant: nextlevelBtn. Hi guys, Beginner here having some trouble creating my first flash drag and drop jigsaw puzzle game. The drag and drop jigsaw puzzle works to some extent, but it is the "level complete" movieclip which is causing problems. On testing the movie i get this error:1061: Call to a possibly undefined method addEventListener through a reference with static type Class.

[Code]...

View 3 Replies

ActionScript 3.0 :: Unexpected Errors, Multiple Helper Classes, Extended Classes?

Jan 9, 2010

The examples I'll use don't do anything - they're classes without ANY members - no variables, methods, anything.

Let's say I extends Sprite and call it MySprite.

I save it in test.core

[code]...

Now I create another custom class called MyWindow that extends MySprite.

I save it in test.windows

[code]...

Then I create another class that extends MyWindows (the example I'll use is a document class - but that doesn't matter - I've tested using an instance too).

[code]...

Notice that I'm not even trying to instantiate the helper classes - just having them there throws the error.

If there is only a single helper class, everything runs fine.

Also note that - as far as I can tell - this only happens when extending one class from another package, then extending that class with more than one helper object.I'm pretty sure there's no namespace bumps or typographical errors, as this is a very pared-down version of the original application.

EDIT: seems the problem exists even without the crossing packages - even extending MySprite in the document class with multiple internal classes generates this error.

View 4 Replies

ActionScript 3.0 :: Using Current Time In If Statements?

Oct 12, 2010

I have no problem getting the current minute using the .getMinutes command, but I would like to use that number in an if statement:

ActionScript Code:
if(minute>=30)
doSomething();
else
doSomethingElse

View 4 Replies

ActionScript 2.0 :: 'if' And 'else' Statements Executing At The Same Time?

Mar 25, 2011

I have this code on an onPress event. Just wondering why it's executing my if and else statement at the same time? I've never had that happen before.

ActionScript Code:
if(cableNum + connectNum == 2)
{

[code]......

View 3 Replies

ActionScript 3.0 :: Why Is MouseEvent Not A Compile-time Constant

Mar 28, 2011

In a class file I have a button (GameButton) which I want to all the instances act the same. I found this code in a tutorial but when I run it I get the error: "Type was not found or was not a compile-time constant:MouseEvent."  And then it names 2 of my public functions. Here's all the code in my class file:

[Code].....

View 5 Replies

AS3 :: Exported Class Is Not A Compile Time Constant

Dec 8, 2011

I have a piece of art I made on the timeline that I want to turn into a button, so I comverted it to a symbol and exported it to actionscript with a linkage class, but when I compile it and run it I get the error, 1046 type was not found or was not a compile time constant: playButton22.[code]

View 1 Replies

ActionScript 3.0 :: Type Was Not Found Or Was Not A Compile-time Constant

Jul 21, 2009

I have a AS3 need to call 2 functions in a WS to get 2 return parameters.

But, it has

Compile Error:
1046: Type was not found or was not a compile-time constant: OperationEvent.
function onResult(e:OperationEvent):void {
function onFault(e:OperationEvent):void {
function onResult1(e:OperationEvent):void {

[Code].....

View 5 Replies

Flash :: Type Was Not Found Or Was Not A Compile-time Constant

Mar 20, 2010

I keep getting the error: "Type was not found or was not a compile-time constant: Team" on my constructor for this class:

package ncaa.Data
{
import ncaa.Data.Team;

[Code]....

The class, Team is imported on the third line, what's going on?

View 1 Replies

Actionscript 3 :: Set Constant Value From A Config File During Compile Time?

Nov 23, 2010

Is there a way to set the value of a private static const identifier from a config file during compile time in Actionscript 3?Also, it would be nice if I can do this in the mxmlc ANT task.

View 2 Replies

Flash :: Found Or Was Not A Compile-time Constant 1046

Oct 2, 2011

I want to pulish SWF file from .fla file. I have some scripts there, but when I pulished them - they don't work. I get error from compiler:

1046: Type was not found or was not a compile-time constant

**Warning** The linkage identifier 'scrollableContent' was already assigned to the symbol 'pop_ups/__pop_up_other_elements/scrollableContent', and cannot be assigned to the symbol 'pop_ups/__pop_up_other_elements/scrollable_game_content', since linkage identifiers must be unique.

View 2 Replies

ActionScript 3.0 :: Type Was Not Found Or Was Not A Compile-time Constant?

Nov 9, 2008

I've got this movieclip that I made into a button with ActionScript. When clicked, it should go to a frame in my main timeline labeled "beansbus", but whenever I try to test the movie out, Flash gives me this error:

1046: Type was not found or was not a compile-time constant: bus.

I've looked around on the internet and I've been told that this error can crop up if the instance name is the same as a library object. That WAS the problem, but I renamed the library object to Cutebus, so that should have fixed it, I hope. There was another fix that involved something called TextFields in my movieclip, but I don't have those...

View 6 Replies

IDE :: Type Was Not Found Or Was Not A Compile-time Constant: EVENT?

Apr 25, 2009

Im new to AS3 and just want to get my button (labled button1 in the properties instance box) to move me onto the next frame in the timeline(frame labled start) and play from there, when you hover over it Button is on first frame on a different layer to actions & labled frames.this is the code Ive copied and adapted from a tutorial its in the first keyframe on the action layer....

stop();
button1.AddEventListener(MouseEvent.MOUSE_OVER, mouse_overbutton1);
function mouse_overbutton1 (event:EVENT) :void

[code].....

View 1 Replies

ActionScript 3.0 :: Compile-time Constant Annoying Error?

Jan 9, 2012

I have a character added as Child in the Main Time line and i am trying to make a class for that same char to control it, but as soon as i start it gives me this huge annoying error that says It has a compile time-constant error in the

private function checkKeysDown(event:KeyboardEvent):void{
Full class code below
Code:

[code]....

View 2 Replies

ActionScript 3.0 :: Tracking Time - Count The Seconds Passed While Playing The Game And Gives A Bonus Multiplier To The Current Score When The Game Ends?

Mar 15, 2009

Is there a way to get this code to work? It's meant to count the seconds passed while playing the game and gives a bonus multiplier to the current score when the game ends. I don't know how to get the returned value to combine it into the multiplier int variable. Is there any way to get this code to work or is it completely wrong?

View 11 Replies

ActionScript 3.0 :: Restart The Game Without Getting A Bunch Of Null Object Errors?

Apr 14, 2011

I am almost done my short AS3 "Flight of the Conchords" game I just want to attempt to do one last thing...to successfully restart the game without getting a bunch of null object errors. The way it restarts now is that if you die or win the game then a screen pops up and a button takes you to the previous scene (menu), the problem is that once it goes to the previous scene all these null object errors occur.

P.S. This is my second time working with AS3, and I was able to do this following a YouTube tutorial by Borris123psn.

View 1 Replies

ActionScript 3.0 :: 046: Type Was Not Found Or Was Not A Compile - Time Constant: SoundTransform

Feb 18, 2010

I am having trouble with my flash program. im trying to make a media player but the tutorial that i am using told me to enter SoundTransfor into the action scripts but when i run the program all i get is an error... 1046: Type was not found or was not a compile-time constant: SoundTransform.

View 1 Replies

1046: Type Was Not Found Or Was Not A Compile-time Constant: MOUSE_OVER

May 24, 2010

My movie clip button isn't acting like a button and it's looping even though I have a stop on it's timeline. Here is my code:

about_mc.buttonMode = true;
about_mc.addEventListener(MouseEvent.Mouse_Over, aboutClick);
function aboutClick(e:MouseEvent.MOUSE_OVER):void { trace("aboutClick"); }

I get an error message of:1046: Type was not found or was not a compile-time constant: MOUSE_OVER.

View 10 Replies

ActionScript 3.0 :: Error: Type Was Not Found Or Was Not A Compile-time Constant?

Sep 17, 2008

This is my first time using flex. I tried compiling thecripts below usingmxmlc example.mxmlAnd I get:Error: Type was not found or was not a compile-time constant:UIMovieClipThis is on a windows machine. If I type just "mxmlc" I getthat I'm using version 3.1

View 17 Replies

ActionScript 3.0 :: Type Was Not Found Or Was Not A Compile-time Constant: ArrayCollection

Aug 15, 2011

I have never seen this type of error before. I was running the asdoc tool when I got the issue to:

[Code]...

View 1 Replies

ActionScript 3.0 :: 1046: Type Was Not Found Or Was Not A Compile-time Constant?

Sep 6, 2011

Im trying to get my character(Box 2D to respond to the accelerometer) But flash throws thie error at me..Here is what i have done to try and get it working:

import flash.sensors.Accelerometer;
import flash.events.AccelerometerEvent;
import flash.events.*;[code]...

(obviously this is not how my class is set out, this is just all I have done to test my accelerometer)

View 1 Replies

Flash :: Flex: Type Was Not Found Or Was Not A Compile-time Constant?

Aug 6, 2010

I am trying to build a pure as3 project in flex and I got the following error:

type was not found or was not a compile-time constant: Button

type was not found or was not a compile-time constant: TextField

[Code]....

View 3 Replies

Flex :: FlashBuilder 4.5 : Type Was Not Found Or Was Not A Compile-time Constant

Nov 17, 2011

First I create a new ActionScript Project, then add a Library Project's bin folder to the build path, and reference the Library Project. I code the new project, and everything works fine. But later, when I'm optimizing the code, I'll create a new ActionScript class file in the Library Project, save it, and then change an already defined function within the ActionScript Project to use this new ActionScript class in the Library Project instead of some other class in the Library Project. The class file is in the Library Project's src folder, under (default package), same as all the other files the ActionScript Project is using successfully.At this point, FlashBuilder shows an error "Type was not found or was not a compile-time constant: PEArrays."

Here is the Library Project file:

package
{
public class PEArrays
{

[code]...

I have included import PEArrays; or, import PEArrays.*; and both result in the same error.Also, I tried exiting and re-entering FlashBuilder, didn't help. Cleaning the ActionScript Project had no effect on this error. I also right-clicked on the project folder and selected Refresh, but it didn't help.

I verified that the needed classes are correctly selected by going to Project>Properties>Flex Library Build Path and reviewing the Classes tab. I'm just a single developer so there's no version control system in place.

After troubleshooting a bit, I now find that the ActionScript Project folder's bin directory is empty. When I run the .as file in the ActionScript Project's src folder, I get an error that the ASname.html file cannot be found (where ASname is the ActionScript Project name and also the .as file name, e.g. ASname.as, in the src folder, which is run). This ASname.html file is not found in the html-template folder. What process generates this needed .html file?

View 3 Replies

Actionscript 3 :: Type Was Not Found Or Was Not A Compile-time Constant: Event

Dec 15, 2011

1046: Type was not found or was not a compile-time constant: Event.

private function contactListener(e:Event)
{
if (simContacts.isCurrentContact(winBox))
{

[Code].....

View 1 Replies

ActionScript 3.0 :: Type Was Not Found Or Was Not A Compile-time Constant: Event

Oct 26, 2009

I have this piece of code on a mouse click:

[Code]...

It basically downloads an mp3 file when you click a "download" button. I have assigned an on complete listener and function but keep getting this error message: Line 53: 1046: Type was not found or was not a compile-time constant: Event. Which the source of is: function completeHandler(evt:Event):void {

View 3 Replies

ActionScript 3.0 :: Error - Type Was Not Found Or Was Not A Compile-time Constant

Feb 11, 2011

I have a symbol with name and class name "cat". I also have buttons with names and classnames of values "upButton" "downButton". I dragged the symbols onto the stage and gave them instance names of "cat", "upButton", and "downButton", and tried to control the position of the cat using the buttons, however I got the error message:

"type was not found or was not a compile-time constant"

So I tried changing the name of the instances to cat2, upButton2, and downButton2, and it works perfectly fine. So am I not allowed to have instance names identical to the class name? This is strange because in the book I am working out of, the instance names are identical to the class names.

View 2 Replies

ActionScript 3.0 :: Type Was Not Found / Was Not A Compile-time Constant:MyStar

Oct 28, 2011

i have tried to make mouse trail effect with stars but i m failed.there was error mesagge "type was not found or was not a compile-time constant:MyStar.[code]

View 5 Replies







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