ActionScript 2.0 :: Putting Colon In Between A Calculated Number?
Aug 23, 2010how to put ":" in between a 3 digit number that has been calculated in a function.
Ex.
I want to make this--> "100", into this--> "1:00"
how to put ":" in between a 3 digit number that has been calculated in a function.
Ex.
I want to make this--> "100", into this--> "1:00"
I'm trying to update a clients site and the original developer left almost no instructions.The code is all updated through XML.Here is a sample of the code
enter code here<FOLDER NAME="COMMERCIAL">
<GALLERY NAME="LOCANDA VERDE: New York">
<IMG HEIGHT="500" CAPTION="Some photo" WIDTH="393" SRC="locanda1.jpg" DX="60" DY="40"
[code].....
how I can pass a variable calculated in a function, to the stage.
View 9 Repliesoptions as I wish to learn how one would create a tool that would provide allow the end user to enter numbers, in some predetermined/static fields. The tool would then use this data and provide the answer.Simply put, i'm looking to create a basic ROI calculator (Return on Investment).
View 3 RepliesThere is a plane in my movie and it's moving (from starting point (x,y) to end point (x',y') coordinates in timeline). it's a very simple issue.And there is a popup that will be visible when user click on the plane mc.
I wrote the following code :
planepp.visible = false;
plane.addEventListener(MouseEvent.CLICK, planefunc);
[code]......
I'm having some problems rounding to a decimal place. I tried adding the flash websites code to round to two decimal places but I can't seem to make it work for me. I am trying to round the results of my runCalculations function so that only two decimal places will appear.
ActionScript Code:
function checkcontent(event:MouseEvent):void {
if (txtMPG.length > 0 && txtMPY.length > 0 && txtCost.length > 0) {
//then do this.
var mpgtemp:String = txtMPG.text;
var mpytemp:String = txtMPY.text;
[Code] .....
I am having trouble getting my dynamic text field to populate based on a countdown ActionScript. My dynamic text field's attribute name is time_txt and is set to Dynamic Text in the Properties panel. Here is my code:
[Code]...
I'm tasked with updating a Flex project created by an outside contractor and in the Actionscript is the following chunk:
CONFIG::FLASH_10_1
{
//Some code here
}
I've never seen this type of structure before and I'm having a heck of a time trying to search for it on Google - I've found what it means in just about every programming language except AS3.
I'm puzzled by the use of the colon in the return line of this function (return {r:r, g:g, b:b}). It returns an object with the properties r, g, and b, but I couldn't find this usage in any reference I've looked at. Is there any documentation of this?
PHP Code:
Color.HEXtoRGB =function(hex) var rgb24 = (isNaN(hex)) ? parseInt(hex, 16) : hex; = rgb24 >>16; var g
[code]....
I'm a total noob at AS3 and am trying to call a function when someone clicks a button.The code is pretty simple:[code]However, I keep receiving the error "1084: Syntax Error: expecting right paren before colon."
View 6 RepliesI am still new to actionscript but after looking over this multiple times I'm not seeing the error. public class Avatar extends MovieClip
{
private var stageRef:Stage;
private var fireTimer:Timer;
[code].....
say I have XML like this:
<root>
<x:Item>test</x:Item>
</root>
How would I navigate to the x:Item node?
I tried myXml..x:Item and myXml..x::Item but both throw errors. The first won't compile and the second complains about me trying to use NameSpace '0'.
I have a string that looks something like this: 00110; book1,book2,book3,: 6 What I need to do it spilt it up into sperate values by the semi colon. so in the end it would be like
[Code]...
We got a call today from a customer saying she was unable to input colon ":" in a textfield, instead it would turn into a ">". My first thought, since she's on a PC, was that she probably had switched her keyboard layout from swedish to english which would indeed make the colon turn into a "greater than". But after some investigation this happened on every pc I tested this on, and outside flash the inputs were correct. I am able to copy-paste a colon into the textfield.I also tried this on a pc with Windows 7 with a strange outcome. The first input became a ">", but after that the colons appeared correctly. After reloading the flash it worked from the first input.
View 3 RepliesRed line error is shown on the dot in between TextFieldType and Dynamic. Same goes for TextFieldType and Input. I can't figure this out...
[Code]...
I have designed an interactive flash animation that will be part of a larger website, using Flash CS4. I can't seem to apply what I learn about actionscript 3.0 to my specific project. Actionscript 3.0 makes my brain hurt![code]
View 1 Replieshow to send off multiple variables in an object (from a class) to the FLA file...[URL]The setup: I have a class that extends EventDispatcher. I created an Object called _pass, public var _pass:Object;.In my last function (everything is cool up until now), I have four variables that need to be passed to the main fla. Let's say they're param1, param2, param3, param4.
It was explained to me that I could use the public var _pass:Object; by first creating an instance of the object like so, _pass = { param1, param2, param3, param4 }; (each param is available in the function). Having setup an object instance, I could then dispatch the object to read from within my fla: dispatchEvent(new Event(Event.COMPLETE));.
But I get these errors:
Quote:
1084: Syntax error: expecting colon before comma.
1083: Syntax error: rightbrace is unexpected.
As the livedocs show, you can use an associative array (with braces and a colon), but I don't need that. I just need to pass my variables that are pre-made to the FLA.
I am trying to make a gallery here and I dont know what the problem is with my gallery...
1084: Syntax error: expecting rightparen before colon.
1071: Syntax error: expected a definition keyword (such as function) after attribute Function, not ldr1.
This is my code...
btn1.addEventListener(MouseEvent.CLICK, ldr1)
Function ldr1(e:Event){
my_ldr1.source="cat.jpg";
}btn2.addEventListener(MouseEvent.CLICK, ldr2)
Function ldr2(e:Event){
[Code] .....
This is a snippet of my code which is giving me
1086: Syntax error: expecting semicolon before leftbracket.
What I'm trying to do is create a an array from the amount of "players" and then for each player in the array, add another array into each level of the array that has 3 levels which are all set to '0'. When I remove: var scoreArray[i]:Array = [0, 0, 0]; the error stops.
ActionScript Code:
public var players;
public var playerScoreArray:Array;
public function gameSetup() {
var playerScoreArray = new Array(players);
for (var i = 0; i < players; i++) {
var scoreArray[i]:Array = [0, 0, 0];
playerScoreArray[i] = scoreArray[i];
}}
showing error....
1084: Syntax error: expecting rightparen before colon. private showXML(event:Event)
1071: Syntax error: expected a definition keyword (such as function) after attribute private, not showXML. {
1084: Syntax error: expecting rightbrace before leftbrace.
[code]...
Im getting error on Line 61 here is the line
[Code]...
In flex 3 I have a hierarchical data structure. I would like to display the content of it in a tree. My problem is that I have nodes which data calculated from children nodes. How to structure the hierarchy to make automatic changes to those parent nodes, if their children's data changed? For example:
Every node has a warning flag. If some of the children warning flag changed to true, then the parent warning flag should change automatically set to true. A node integer field is the sum of the children integer fields, and if any of the children changes, the parent integer field "calculates" the sum immediately. Is there an easy solution wit good structuring changes happen automatically, or I have to make some custom functions?
My project is converting as2 to as3 flash file.In AS2 ,I am using "loadmovie" to load the external swf also it gets totalframes of swf . It works correctly. But In as3 i am using "loader" to load the external swf. But the "loader" is not calculated the external swf total frames.Then how to calculate totalframe in as3.
View 2 RepliesIs it normal behavior, if createTextLine method of TextBlock class splits content text ":sometext" or ";sometext" , into two lines evenif the the method parameter width is long enough
View 12 RepliesDear Guys I Want To Generate A Random Number Between 2 Number BUT Without Generating 2 Same Number I Mean If For Example Already Generated Number "2" Next Time Did Not Generate It , Is There Any Solution
View 5 RepliesI am trying to learn flash and make forms with them. I keep getting this error... 1084: Syntax error: expecting leftperan before colon here is my code function sent:(e:Event):void why am I getting this error?
View 1 Replies1084: Syntax error: expecting rightparen before colon.
ActionScript Code:
mail.dragBar.close_btn.addEventListener(MouseEvent.MOUSE_UP,MoveMail_Down);
function MoveMail_Down(event:MovieClip):void{
mail.move(x:0,y:0);
}
Code: Select allport.push({twitterXML.children()[3].child(j).@name:twitterXML.children()[4].child(i).child(j).child(0)});
getting error "1084: Syntax error: expecting colon before dot.
I Want To Generate A Random Number Between 2 Number BUT Without Generating 2 Same Number I Mean If For Example Already Generated Number "2" Next Time Did Not Generate It,
View 4 RepliesJust wondering what's the meaning of ":" (colon symbol) on this Javascript code below? var switchToTarget : Transform;
View 3 Replies