ActionScript 2.0 :: Eval And [] Differences (looping Fct)

Jul 25, 2008

I'm not really good at figuring out how to do some things in Actionscript and I'm confused about looping throught functions with thins like eval. Here's my code :

[Code]...

I'm trying to loop to dynamically create functions. I have 5 boutons and I don't want to duplicate 5 times the same code. This code works but I don't seem to be able to use the same eval trick on the variable "blnBtn05". Anyone knows why and how can I be make it work?

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Looping Non-array Variables With Eval()

Sep 3, 2003

I want to do a for loop that grabs values from different variables. This function works nicely without the eval() statement (using the commented line below it) but not with it.

function saveData ()
{
saveUrl = "savedata.php?";
for (count=1; count<=numberOfVariables; count++)

[Code].....

View 14 Replies

ActionScript 2.0 :: Use Hittest And Eval?

Jul 24, 2005

when I use hittest and eval?

View 1 Replies

ActionScript 2.0 :: Using Eval For +/- Calculations ?

Apr 29, 2008

Basically I want to eval() a string like _level0.mc._x-=dist; where the "-" or "+" is a variable.You can paste this straight in and it should work.. only the last part (where it's doing the eval) doesn't.

Code:

this.createEmptyMovieClip("mc",this.getNextHighestDepth());
_level0.mc._x=200;
_level0.mc.createTextField("txt",_level0.mc.getNextHighestDepth(),0,0,200,200);[code]......

View 2 Replies

Flash - Differences Between 2.0 And 3.0?

Aug 13, 2010

I'm developing a simple Flash animation using Flash Professional CS5 and I'm writing some ActionScript code. I noticed there's a choice between using different versions of ActionScript.Wondering what the key differences are between 2.0 and 3.0...?

View 4 Replies

Differences Between Flash And AIR?

Sep 19, 2010

From a developer's point of view, are there other differences between Flash and AIR to take into account, apart from the certificate and AIR not supporting ActionScript 2.0?

View 2 Replies

ActionScript 3.0 :: Differences Of AS3 To AS2?

Jul 18, 2009

I recently learned beginner grade skills for AS2 via Macromedia Flash. it had only AS2 so i thought i'd be good to programin that.well i completed my project (a minigame for a bigger game was the first time i programmed ever actually. Was really fun and you can find my "work" in the attachment) changing to adobe flash on the way its what the workstations in my u have. well i there saw actionscript 3 too. also, sometimes when i asked for help on here they told my i "should switch to as3" soon. now im about to work myself into as3 but first I'd like to know.what are the main differences and could someone show me a code in AS2 and the same code in AS3 or link me to a tutorial that makes good use of AS3 (possibily by using AS2 references to clarify the structures?)?why is As3 "better" than AS2?

View 9 Replies

ActionScript 2.0 :: Differences Between AS1.0 And AS2.0?

Jul 11, 2010

i'm a student and have to code a flash game in AS2.0. I found a really good tutorial, which helped me to understand, how to code. The Problem is,the tutorial is written in AS1.0 and i don't know the differences between AS1.0 and AS2.0.

Code:
fscommand("allowscale", false);
fscommand("allowscale", false);[code]......

View 7 Replies

ActionScript 2.0 :: Any Way To Eval String Into Array?

Dec 9, 2010

I have a response coming in from a server that contains a ton of strings that I need to eval to have them replace arrays already set as globals. So program fetches response, evals string into an array, and then we do stuff with the array. I've played around with little tests and can't get it working.

ActionScript Code:
var superArray= new Array('3','4');
var testArray="superArray=['1','2']";
function testEval() {
eval(testArray);
trace(superArray);
[Code] .....

View 1 Replies

ActionScript 2.0 :: Eval LoadMovieNum Is Not Working?

Aug 16, 2011

i'm new to flash programming. the code below is not working.[code]

View 3 Replies

ActionScript 2.0 :: Using Eval To Check Through All The Objects?

Feb 25, 2003

I was reading another query on this board about NOT using eval, as it had become deprecated, for attaching a name to a new MC. I have been using eval to check through all the objects, and to add ones with a certain name to an array.

for (i in this) {if ((typeof (eval(i))) == "movieclip" && substring(i, 1, 5)== "names") {

would there be another method of doing this using dot notation? sorry if this question seems a little muddled. I am new to flash, some things in it make a lot of sense and others are still confusing me.

View 3 Replies

ActionScript 2.0 :: Instance Name Not Eval'ing Correctly

Apr 28, 2003

I have a global map, when the user selects a continent it loads a seperat swf for that area. The continents grab variables from a database, and bring a bunch of variables into the movie.

One group is for the names of countries. It grabs the country name and it's 2 letter code. Then passes the country name to the local movieclip with that same instance name.

This works well for the most part. A couple countries don't load. Right now I'm looking at Asia. The country od Malaysia with it's code of "MY" produces errors half the time. Well most of the time.[code]...

View 1 Replies

ActionScript 2.0 :: Eval New Array From String?

Jun 21, 2008

I am passing flash a variable in string format and it looks like this

var stringVar = "new Array(new Array(1,3,4),new Array())";

Now i need to make an array out of it. I tried this:

var stringArray = eval(stringVar);

but had no success.

View 4 Replies

ActionScript 2.0 :: Any Way To Eval A String Into Array

Dec 9, 2010

stuck on a bit of code, trying to transition a program over from JS to AS2 flashlite 3.1.So here's the deal, I have a response coming in from a server that contains a ton of strings that I need to eval to have them replace arrays already set as globals. so program fetches response, evals string into an array, and then we do stuff with the array.I've played around with little tests and can't get it working. This is a dumbed down version of what I need to happen.[code]

View 3 Replies

Differences Between Flash Player 6 And 7+

Dec 29, 2009

I used Jamie Durrant's tutorial for making a chat bot in flash. Everything works fine, but one thing which makes the bot remember people works only if the fla file is published in Flash Player 6 version. There are 4 symbols: a button, user, reply and custid: user is the textbox where the user inbuts the text, reply is the textbox that displays the bot's reply and custid displays the id of each person. If the version is newer than flash player 6 it says "undefined". It's a local shared object, I think. Could this code be edited to work in later versions or I have to stick with flash player 6 (the graphics are worse even at lossless compression)[code]

View 1 Replies

Differences Between Flash And Flex?

Nov 1, 2009

We have lots of log information (syslogs, database logs...etc) which is in CSV format.  I need to present this information to key management about the activiites from the logs in Visual format but still has dynamic links.  For the management sake, I need this application to be cross platform (Windows, MacOSX, Linux).What tool do I need to use Flash, Flex or (something else like Java)?

View 2 Replies

ActionScript 3.0 :: Math Differences On PC And Mac

Jun 27, 2011

I have created a flash 3d racing game which relies heavily on AS3's Math functions (sin, cos, tan, asin, acos, atan). It also makes heavy use of Matrix3D and Vector3D functions. The game works great on a PC, but the cars flip around and display innacurate positions on Mac computers. I know this is an issue due to the note on the Math docs page: [URL]

which states: "Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow, sin, and sqrt may result in slightly different values depending on the algorithms used by the CPU or operating system. Flash runtimes call on the CPU (or operating system if the CPU doesn't support floating point calculations) when performing the calculations for the listed functions, and results have shown slight variations depending upon the CPU or operating system in use."

how do I get this game to work on a Mac? I've tried using lookup tables and inline FastMath style approximations. But lookup tables still create the same problem, and the inline approximations I have found are not accurate enough for my game. I've also tried rounding values with floating point errors, but that has not seemed to help (in my implementation) either. I think the specific problem is with the use of Math.atan. I have not found an accurate approximation for this.. but I maybe that is not even necessary.

View 2 Replies

ActionScript 3 :: Differences Between The Two Platforms?

Dec 13, 2009

I have been moving over to JavaScript (esp. canvas) from Flash / Flex / ActionScript 3 (JavaScript is a more open platform), and I was wondering if anyone has any advice on differences between the two platforms, important things to note, pitfalls, optimizations, etc.

View 2 Replies

Actionscript 3.0 :: URLRequestMethod Differences?

Sep 14, 2011

What are the differences between POST and GET methods of a URLRequestMethod ? In what context should we use them?

View 1 Replies

Javascript :: Eval Throwing Error With Try / Catch

Nov 29, 2011

I have an air application, in which the user types javascript in a textarea, and it is eval'd in an mx:HTML component, but even with try/catch around the eval, and around the code in the eval, and an HTMLUncaughtScriptExceptionEvent handler, it still throws an error. htmlWindow is html.htmlLoader.window.

[Code]...

View 1 Replies

ActionScript 2.0 :: Using Set And Eval Functions Setting Variables?

May 12, 2006

I'm having problems in setting three variables using a for loop and then passing these variables to my function. I think it's something to do with the set function I'm using, because my colorFadeTo function claims it's being passed an undefined variable.

Code:
for (var i=0; i<circles.length; i++) {
var current = circles[i];

[code].....

View 1 Replies

ActionScript 2.0 :: Eval Usage On The Left Of Equals?

Apr 1, 2007

I'm sick of writing long scripts or being locked in certain cases to not being able to use dynamic features because I don't know how to use things like eval on the left side of the equalsHere's an example

Code:
base.mitem1y = mitem1._y
base.mitem2y = mitem2._y

[code]....

View 3 Replies

ActionScript 2.0 :: Eval() Versus [] Use In Nested Loops?

Jan 23, 2008

why code snippet #1 works, but code snippet #2 doesn't? i thought the array operator would work in this case...

CODE SNIPPET #1:

Code:
for (i=0;i<products.length;i++)
{
// XML data code
for (j=0;j<prodItems.length;j++)

[code]....

View 3 Replies

ActionScript 2.0 :: EVAL To Apply Text Variables?

Jul 19, 2003

I have a clip containing 8 MCs, named id1, id2 etc, each of which contain a dynamic text field with the variable thisNo. I want to run a loop that inserts each digit from a randomly generated number into each of these MCsPatID is the random number, IDLength is it's character length.

for (i=1; i<(IDLength+1); i++) {
thisNo = PatID.substr(-i,1);
eval("id"+i).iconNo = thisNo;

[code].....

View 6 Replies

ActionScript 2.0 :: Convert Eval() Flash 5 Code To It?

Jul 27, 2010

I'm trying to update an old flash 5 site I made years ago so that I can put video clips in it. I opened the file is flash cs3 and compiled just to see if it would work as is before modifying. It's hanging on a bunch of code, all which have eval() in them. It's been a loooong time since I coded actionscript so while I know that the bracket syntax is what I should be using, after trying various ways of writing it I just can't figure it out. Can someone tell me how the following should be written in Actionscript 2.0 and I can extrapolate from there?[code]...

View 1 Replies

Actionscript-3 :: Differences Between Flex Mxml?

Jun 10, 2010

What are the differences between flex mxml and as3.

View 3 Replies

Flash :: Text Box Formatting Differences

Feb 14, 2011

I have two text boxes on the same window. They are both set to Arial 14 Regular but they both appear very differently. To see what I am referring to: [URL] and go to the Conversion Tools at the bottom of the page. Click on Surface Finish and type in a value in the two different fields and click calculate. I really don't see anything that could be causing this difference in appearance.

View 2 Replies

Flex :: Font Rendering Differences From 4.1 To 4.5/

Apr 11, 2011

I'm currently upgrading an app from Flex 4.1 to 4.5.We've noticed that the Arial font is rendered differently between the two versions when used at small sizes.Here's a simple app example:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]....

When run against the 2 different sdks, here's an image of the font rendering we get:

Note that in 4.5 the font looks slightly squashed.

What's the cause of this, and how do we resolve it?

View 3 Replies

ActionScript 2.0 :: What Are The Differences With Playback Of Video On A Mc And Pc

Apr 27, 2004

i've got a large video (48MB) that after 7% is loaded, it starts playback. on a pc it takes 10 seconds before it will start to play and it plays all the way thru with no problem. on a mac it takes 30 seconds before it will start to play and sometimes playback is choppy. why does this happen? what are the differences with playback of video on a mc and pc? is there some way i can get around this?

View 11 Replies

ActionScript 2.0 :: Eval Methods - Dynamic Object Name Creation

Mar 9, 2009

I'm having problems with my usual eval methods of creating objects to read off dynamic values programmatically using concatenation. I've found the set command doesn't seem to work with objects that are dynamic....

Code:
function createobject(item){
//create it and store something in it
set ("_root.item"+item.stored, "data storage test for item "+item);
}function checkobjects(){
for (i=1;i<5;i++){
checkit=eval("_root.item"+i);
trace("_root.item"+i+".stored="+checkit);
[Code] .....

Running this produces the output of...
Code:
_root.item1.stored=undefined
_root.item2.stored=undefined
_root.item3.stored=undefined
_root.item4.stored=undefined

How to do this - basically I'm trying to load data, then use that to create dynamic objects and values within it, then I'm trying to work with those values by again using loops to read off the dynamic values during runtime. Obviously if these were "fixed" variables, then it would be easy, problem is that its impossible to use the new Object() command with dynamic names!

Previously I've used this:
Code:
checkit=eval("_root.item"+i+".stored);
trace("value is "+checkit);
Is it my imagination, or was this stuff a lot easier to do in AS1?

View 2 Replies







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