Flash 10 :: Auto Format - Maths Functions Not Done In Correct Order
Apr 23, 2011
I have some code that looks like this:
ActionScript Code:
level_btn.x = 50 + (i - 1) % 10 * 50;
It sets the x location of my level button. But this is in a for loop (that's what the 'i' is for.) I run it and everything works perfectly, as it should, not a single problem. Then I press the auto format button in the flash actionscript editor. (It's the button that adds all of the ; to the end of each line and other stuff)
Well that changes my code to this:
ActionScript Code:
level_btn.x = 50 + i - 1 % 10 * 50;
thinking it's done me a favour but it hasn't. It's got rid of the brackets so it won't do the maths functions in the correct order. I've tried adding more brackets in places and other stuff but I just don't know how to fix it. It's annoying because every time I press the auto format button I have to add the brackets in again.
View 1 Replies
Similar Posts:
Nov 21, 2011
While coding, I wondered if a plugin exists that I could highlight a series of variable declarations, hit some special keyboard shortcut and BAM! They would appear in alphabetical order.Is there anything that does this in Flash Builder? Or FlashDevelop even?So it would go from this:
private var _value:Number;
private var _helloWorld:String;
private var _foobar:Boolean;
To this:
private var _foobar:Boolean;
private var _helloWorld:String;
private var _value:Number;
View 3 Replies
Aug 17, 2004
I am creating an order form for my flash site. I have never done this before in flash but I have in visual basic. I have a few questions:
1. Is assigning variable names to checkboxes and radio buttons the same as in visual basic? I mean i know that you probably assign them in the properties. ex..say i name a radio button 'radio1', to run a check in my actionscript whether radio1 was checked or not would it be something like if(radio1){}
2. After the person fills out the form I would like to have the results of the order sent to a pre-specified email adress in a certain format. What would be a good way to do this?
View 3 Replies
Oct 27, 2010
did anyone else notice after switching to flash cs5 the auto format will fail constantly? 90% of the time i comment something out the auto format will error.
View 1 Replies
Dec 8, 2009
i would like to load a flash file in order to use it's functions and classes. i would like that this file will be never cached. how can i do that ?
View 1 Replies
Nov 25, 2009
I have tried loading in some images in the order of the xml files that contain them they did load in one by one but in random order.
View 9 Replies
Mar 25, 2010
I'm having a problem with my images not showing up in the correct order.
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
[Code] .....
View 1 Replies
Dec 7, 2009
I'm getting a large JSON string and decoding it into an object, i'm looping through this object to create the interface. The problem is it seems to build the interface in a random order, is this because actionscript 3 loops through the properties of the object randomly?
View 3 Replies
Sep 11, 2011
I am trying to get the datefield populated in the correct format. I tried the formatter but that doesn't seem to work. I need it to be YYYY-mm-dd
View 3 Replies
Oct 3, 2011
I need to format a url passed to Facebook Sharer via AS3 using navigateToURL(new URLRequest(request), "_blank");. The url that is passed has a lot of strange characters. What is the best way to get the correct output?[URL]..
View 1 Replies
Sep 12, 2011
I am trying to get the datefield populated in the correct format. I tried the formatter but that doesn't seem to work.I need it to be YYYY-mm-dd
View 1 Replies
Jan 11, 2009
I'm having issues displaying movie clips in the correct order. I'm pulling in data from an xml file, in this case images and then create movie clips to hold them. I'm getting the right order from the actual Array when looping through the xml file but when I create the clips the order gets all screwed up. how to order the clips exactly the way they are in the array?
#########loop that creates the clip########
for(var b = 0; b<story_arr.length; b++){
if(story_arr[b].nodeName != "title"){
[Code]....
View 0 Replies
Nov 6, 2010
I have a slideshow (graphicsshow_mc) within a navigation menu (graphicsmenu_mc) - a movieclip nested in a movieclip. There are previous / next buttons inside the slideshow that work correctly.
Example: prev_btn02.addEventListener(MouseEvent.CLICK, navBack02);function navBack02(event:MouseEvent):void { gotoAndStop("deinonychus")}
The navigation menu acts like chapters for a DVD, and I want one button to always go to the beginning. I copied the other code, but need it modified to reflect that it appears in the parent.
[Code]...
View 7 Replies
May 17, 2010
I am trying to format my datagrid column to display the decimal value of the price of the item they have chosen to (2) decimal places. Currently the datagrid is displaying $10 instead of $10.00 & $10.4 for $10.40?
Code:
import mx.controls.*;
import fl.controls.dataGridClasses.*;
[code].....
View 8 Replies
Oct 23, 2011
I created two empty Sprites to serve as layers, bottom_spr and top_spr. When clicking a button, a MovieClip appears and follows your mouse, until you click, then its position is fixed. As soon as the button is clicked, I addChild the MovieClip to the correct Sprite. Unfortunately, the layer system doesn't see to work, because they are layered in the order I place them, the Sprites don't seem to influence it. How is this possible?
private var ground_spr:Sprite;
private var units_spr:Sprite;
public function Game() {
addEventListeners();
ground_spr = new Sprite();
[Code] .....
View 1 Replies
Jan 25, 2005
I have five simple equations that I need help converting to ActionScript. I'm making a small "calculator" that takes input from the user and displays a number representing the result of the equation. They're two sets of equations: 1) three-scenario fee calculator to compare the annual costs (X) of renting versus buying equipment; 2) comparison of two rental plans. The numbers entered need to stay the same - the alphabets represent what the user will input. The equations are as follows:
Scenario 1:
X = ([A � F] / G) + H + I + J + (K x 12) + ([L / N] x M)
Scenario 2:
X = ([B � F] / G) + ([E x C] / G) + H + I + J + (K x 12) + ([L / N] x M)[code]....
I've looked at my resources at hand, but my brain just shuts down when I see numbers and letters representing numbers. I do speak three languages fluently, so I (think) I make up for it.how to properly assign the correct order of events (brackets first, etc) in ActionScript to reflect the equations above.
View 14 Replies
May 17, 2011
All I have in the fla is this code
Code:
stop();
var t; var f;
[code]....
View 4 Replies
Jun 17, 2011
I have this script path to an XML attribute[code]...
Also, I have issues with spaces not being added around operators even though I have that set in my preferences. I have access to Adobe's bug system but Flash is not listed, so I can't report the bug. Even their general website "Request a feature/Report a bug" form does not list Flash Pro under the list of apps.
View 5 Replies
Nov 28, 2009
took me like 20 minutes to get why my code is not functionning... this line: tempRef.x=(limitL-dist-tempRef.width/2)+(tempRef.width+dist)*(i+1); after auto format becomes like this: tempRef.x=limitL-dist-tempRef.width/2+tempRef.width+dist*i+1; that's not the same thing at all...may I know why this is happening?
View 2 Replies
Jan 13, 2009
When I click the check mark, message 'The script contains no errors'When I click the Auto format button, message 'This script contains syntax errors, so it cannot be Auto Formatted.ix the errors and try again.'I've never had these two buttons disagree.Code compiles normally and everything works.
View 2 Replies
Apr 27, 2010
I've got a line in my Actionscript like this:[code]If I click the auto format button with this line in there, it adds unnecessary semicolons through the rest of the code and the file stops working. Is there something wrong with the way I have this coded? It works just fine with the code in there before I hit the auto format button.
View 1 Replies
Feb 26, 2009
I found a reference to CS3 Flash's auto format breaking AS3 code on kirupa back in May 2007 but was surprised to find out that it still breaks code by removing parenthesis.Beforetruescale=Math.pow(8,(1 - i) * scaleit);Aftertruescale=Math.pow(8,1 - i * scaleit);Obviously the results are devastating. Would someone check to see if CS4 Flash's auto format still causes the same error when editing .as file? Might be worth the price of an upgrade if it does NOT mess up the format.
View 5 Replies
Dec 12, 2011
Something is corrupt with my Flash Professional CS5 Actionscript Auto format: Comments within a block, such as ' // ' or block comments ' /* ... */ ' are tripping up the Auto Formattor, which returns this error: ' Error with autoformat near line: }'. Comments before package block don't cause an error. When I remove comments within package block, Auto format works correctly.
View 2 Replies
May 15, 2009
The code works fine, but every time I click Auto Format it changes the code so it doesn't work anymore, giving me all kinds of errors. I perceive this as something imperfect in the code and potentially preventing it from working as efficiently.
import caurina.transitions.Tweener;
import fl.transitions.Tween;
import fl.transitions.easing.*;[code]...
View 1 Replies
Oct 9, 2003
How do I make a photo gallery that up dates by itself its contents getting it from a folder and putting then in order? The pictures when clicked should load a swf with information about the tittle.
View 1 Replies
May 21, 2008
I created a slideshow of movieclips to auto show not in order. Now I need to create the same slideshow of movieclips but this time in order.
[Code]...
View 2 Replies
Mar 28, 2012
I'm working on a project which I want to build up OO. Now I came with a function that checks or a value is valid.
private function valid(value:*, acceptedValues:Array):Boolean {
for(var i:uint = 0; i < acceptedValues.length; i++) {
if (value == acceptedValues[i]) {
return true;
}}
return false;
}
As you can see, the function is very general and will be accessed across different classes. Now my question is; where do I store it in a OO correct way?
View 5 Replies
Mar 29, 2010
I've struck with this issue for a long time now.I have one dynamic textbox that'll read a text file written in Thai language.The text shows fine, but when it have to go to new lines it'll go likeFor word: "Thai Language"Desired result:Thai LanguageMy program:Thai LanguageIs there a way to make dynamic textbox do an auto format with Thai/any language that will prevent this behavior?
View 1 Replies
Feb 15, 2010
My copy of Flash CS3 seems to have a problem with its Autoformatting. Whenever I press the button, it adds a semi-colon to the end of every single line (apart from the beginning of functions). There's no problem with the Edit > Preferences > Auto format menu.
View 6 Replies
Jul 26, 2004
Problem:I want to be able to run functions in a certain order from an array. The code below is a non-fat version of what I want to accomplish. The problem appears when thefunction(scream_name) runs. Flash makes the passed variables into one variabel; sname = "John", "Doe" and lname = undefined.
Code:
function run_func(func,vars){
func_ready = func(vars);
[code].....
View 2 Replies