ActionScript 2.0 :: Unable To Make A Variable In A Function?
Apr 15, 2007
Why cant i make a variable in a function? like this:
aiBunny = function (target)
{
var target.hp:Number = 15;
target.interval = setInterval (aiFoe, 24, target);
};
View 3 Replies
Similar Posts:
Jul 17, 2009
I have a number of functions in my code that I want to be called from a List Component, epending on what the user selects from the list. I've added a number of cities to the list like this:
Code:
combo.addItem({value:"akron",label:"Akron, OH."});
combo.addItem({value:"albany",label:"Albany, NY."});
[code].....
View 3 Replies
Mar 6, 2011
Some might know by know that I am working on a school project.But my knowledge of AS3 is not so big.My game is doing what it is supposed to do (for now).But the place where I declare (or something.It now looks like this:
Code:
public class game extends MovieClip
{
[code]......
View 2 Replies
Jan 29, 2012
I have a public variable and I am trying to set it, then read it from a different function:
public var str:String;
public function DailyVerse()
{
function create() {
[Code]....
My trace results says null. Why does it not give me "hello"?
View 1 Replies
Jul 16, 2011
I have a site that plays either .mp3 or .flv files depending on what is selected from the menu. Menu loads in from xml. I get "unable to make connection with server or unable to find flv on server" when I try to play the video. But the video and audio files are all in the same directory and the mp3 files play fine. I think I'm having a problem with the setMedia command. Here's the code that loads the video and audio files.
[Code]...
View 9 Replies
Dec 2, 2004
how to make a function that will not lose the values of the variable before calling it and will not lose them after it is finished. example.
[Code]...
View 4 Replies
Jun 11, 2010
[code]...
Here the method clientMonitor() is called on creationcomplete() from the main application.
I am not able to bind the Bindable variable dbl to my textInput. Using the debugger, I am able to see that the result is assigned successfully to variable dbl, but it is not able to bind it to the text of view1. I see a NaN displayed in the text of view1.
View 1 Replies
Jul 29, 2007
I've been playing around and still can't get this to work. My thumbnail gallery is loaded dynamically using xml and I have a link included with each thumbnail but can't seem to get it to work to load the link with each thumnail.In xml I have:
Code:
<pic>
<image>http://www.yoursite.com/images/image1.jpg</image>
[code].....
View 5 Replies
Jan 27, 2009
It seems that under Actionscript 3 XML (E4X) I'm unable to use dynamicaly created variable names...
this is ok:
Code:
var i:number = 111
this["someVarName" + i] = "actual_value"
trace(someVarName111) // = actual_value
[Code].....
View 3 Replies
Oct 5, 2010
I have beginner's skills in AS3 and have been trying out a sample script in Flash CS5 to create an animation. The script works fine, but I am not sure how to give the user the ability to pause the animation by clicking on the screen and then resuming the animation by clicking again (if this toggling is even possible for a click event handler to do). Is there a way to pause/continue a function by clicking the player screen?
View 10 Replies
Mar 15, 2012
Iknow what the function does, It get the information about the webcam in your computer and post it on the textArea,
private var camera:Camera;
private function list_change(evt:ListEvent):void {
var tList:List = evt.currentTarget as List;
[code].....
View 1 Replies
Aug 25, 2009
If you solved it right, a message pops up telling you "Well done" (or something in Dutch).You can close the message with a left-click.Now i want it to close with "esc" too (for the troubled users not realising you can just click).[code]...
View 1 Replies
Dec 25, 2005
I'm having issues with the bricks on the pong out game... not sure why they aren't loading into the Map or leaving the screen when the ball hits it.
I tried to write the script pretty much word of for to get the game to work then I figured I would change it up a little bit...to work better but I wasn't able to get the Bricks to function... Mainly because I wasn't sure what code to place on the blocks.
View 1 Replies
Mar 27, 2012
i am trying to load the variables from parent(flash) to child(flash).Its working fine,.
parent swf:(flash)
var parentMessage:String = "Hello";
var swf:MovieClip;
var l:Loader = new Loader();
[Code].....
View 4 Replies
Mar 7, 2012
how you would target a function's local variable through a concatenated variable string.For example:
var txt = "Hello World";
function testing(msg) {
var test1 = msg;[code].........
I'd expect the trace to be "Hello World" but rather is given "undefined". So if variables created outside functions are created on the main timeline, where are local function variables created and how would you access them?
View 2 Replies
Jul 28, 2007
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
View 2 Replies
Oct 18, 2008
I want to be able to send a second (or 3rd) parameter to a function that is called by an event listener, but I can't seem to get it to recognize the parameter - it gives me an error 1067 (implicit coercion of value) when I try the below code.
[Code]...
View 3 Replies
Aug 19, 2009
When using the class listed below, I am unable to add a CLICK function that will not break the piece. I want to add another tween on CLICK that clears all mcs off of the stage except the e.target, which will have a zoom applied to it... I get my trace fine, but then I am unable to CLICK again on that particular mc, and the proximity begins to break.
Code:
package {
// Import Flash classes
[code]........
View 1 Replies
Apr 1, 2012
I have the following code:
<fx:Script>
<![CDATA[
import shared.GlobalsManager;
[code].....
View 1 Replies
Nov 24, 2010
I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?
View 1 Replies
Apr 27, 2010
im making a platform game project but as of yet im still un able to make the camera move up and down when the charater jumps or stands on a platform?
[Code]...
View 1 Replies
Jan 7, 2005
Im new to AS but Im working everyday to improve, Im trying to make a menu but Im having difficulties with moving the menu:
I have a bar in 500 length and mask of 100 And I have 5 buttons. When I click 1 ofthem I want it to bring the correct positon of the bar with easing. Btw the registration point of thebar is upper left corner
View 4 Replies
Feb 26, 2004
I was wondering how to do the box effect like on [this] site. The lines move up and across to form a box. I have tried a few things that I could think of, but have't got it.
View 2 Replies
Jan 1, 2012
I have a main.as scipt whereby i put the following in the constructor main function.
L1: LoginScreen.enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, checkLogin);
L2: map.visible=true;
it will execute checkLogin function but stuck at Line 1. how do i make it run Line 2?
View 1 Replies
Feb 16, 2009
i know its easy to override a function of a parent class, but I need to be able to override a function for a class on movieclip.. see highlighted code.
[Code]...
View 2 Replies
Sep 19, 2011
So I am trying to access a variable that is defined within my parent code from a class which has been called from my parent code. I am using this:Code:TileCode(parent).game_quests.add_quest(0);to try to access the game_quests variable (which is defined within TileCode). However, for some reason it is not picking that up. It is working for other variables which I have called and ran in a similar fashion
View 7 Replies
Nov 27, 2009
I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.
[Code]...
View 4 Replies
Jul 27, 2009
is it possible to declare function this way
ActionScript Code:
function startShake(e:MouseEvent, num1, num2):void
what i mean is it possible to send to the function not only en event but also a variable and a second question how can i access
ActionScript Code:
function stopShake(e:MouseEvent):Array
this array that function return.
View 1 Replies
Jan 8, 2010
I have a grid that is drawn by the graphics library. I have small pieces, let's call them blocks that are the shape of a square. These blocks connect to each other to form pieces. I want the user to be able to rotate the pieces and then snap them to the grid.I've looked at the geometry libraries but I'm unsure how I would get the points of each square in a piece to match it up with the board after it has been rotated
View 5 Replies
Jun 7, 2010
how to make a countdown timer? I created a timer that counts down to a certain date, but I just want the timer to countdown 24 hours, not to a certain date. I also want to have a button below the timer so that when you click it, it adds 30 seconds to the timer
View 6 Replies