ActionScript 2.0 :: Setting Boolean Values Within Function, So They Don't Confilct?

Jul 24, 2007

'm trying to do: I have a number of buttons on stage. When you rollover, a movie clip is attached. If you roll out, it disappears; if you click, it stays. Then you can drag it around. I'm using a boolean for the rollout disappearing trick. I've set these up in named functions.

[code]function attachBar(word) {
var showIt=false;
i++;

[code].....

View 2 Replies


Similar Posts:


Flex :: Parse Boolean Values In Strings For Use With Function.apply

Mar 13, 2010

I'm using String.split to parse a command line string into an array of strings. The result is then used to call a function using the Function.apply API.If apply(null, ["17"]) is called with this function:[code]does not work (expected output: false Boolean; actual output: true Boolean).Is there a way to make it recognize "true" and "false" (or anything else) as Boolean values, just like it does with numerical strings? Ideally "true" and "false" should also remain valid string values.

View 1 Replies

Flex :: Parse Boolean Values In Strings For Use With Function.apply?

May 5, 2003

I'm using String.split to parse a command line string into an array of strings. The result is then used to call a function using the Function.apply API.

If apply(null, ["17"]) is called with this function:

static function test(foo:int):void
{
trace(foo, typeof(foo));
}

it works as expected (output: 17 number).

However, calling apply(null, ["false"]) or apply(null, ["0"]) with this function:

static function test(foo:Boolean):void
{
trace(foo, typeof(foo));
}

does not work (expected output: false Boolean; actual output: true Boolean). Is there a way to make it recognize "true" and "false" (or anything else) as Boolean values, just like it does with numerical strings? "true" and "false" should also remain valid string values.

View 1 Replies

ActionScript 3.0 :: Setting Boolean Var From XML Node?

Mar 2, 2010

I have an AS3 program that is loading an external XML file. I seem to be having a problem setting Boolean values from the nodes with true or false in them. When I set a Boolean var from a node in the XML it always traces as true. When I trace out all of the XML I can see that those nodes do indeed say false, but the trace shows true. I don't seem to have this problem with uint and String, only Boolean.

Code:

<question type="multichoice" number="">
<msbref>
<textnode>1</textnode>

[Code].....

View 3 Replies

ActionScript 3.0 :: Boolean Tests Combination Of Values

Nov 12, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations. Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 5 Replies

ActionScript 2.0 :: Upper- Or Lowercase For Boolean Values?

Jan 6, 2005

I'm reading a AS-book for a week now, and now it's about fscommands. But I noticed they use both lowercase & uppercase to start the boolean values (true/True & false/False).

Code:
fscommand("fullscreen", "true");
fscommand("allowscale","False");

Is that a mistake or does it just not matter?

View 1 Replies

ActionScript 3.0 :: Boolean That Tests Combination Of Values?

Nov 11, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations.

I've attached a simple diagram that visually explains objective of actionscript.

Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 4 Replies

ActionScript 2.0 :: Zoom In & Out Boolean Function

Oct 29, 2009

Been trying to get a flash map to zoom in and out but I can't seem to get it working, it'll zoom in fine, but not zoom out.I'm zooming into a particular area of a map (Uganda in this example) with a function for a button, I'm using a boolean value to check if I am zoomed in and it registers whether it's true or false (checking with a dynamic textbox). [code]

View 1 Replies

ActionScript 2.0 :: Boolean Not Working In A Function

Oct 29, 2009

I've been trying to get a flash map to zoom in and out but I can't seem to get it working, it'll zoom in fine, but not zoom out I'm zooming into a particular area of a map (Uganda in this example) with a function for a button, I'm using a boolean value to check if I am zoomed in and it registers whether it's true or false (checking with a dynamic textbox). [code]

View 8 Replies

Actionscript 3 :: Get Boolean Return From This Sqlrunner Function?

Mar 6, 2011

I'm trying to do here, basically I need to check if a record exists in a database, so I call a function to do so, but I'm using the sqlrunner class wherein the result of a query is called as an event response and I don't know how to get that value out of the resulting function back to the parent.[code]...

View 1 Replies

ActionScript 3.0 :: Passing Boolean Arguments To A Function

Jul 20, 2010

How to pass boolean arguments to a function[code]On the stage i have all the MC - screenX, alarmsX, criticalX, majorX,warningX, redX, orangeX, greenX.But i get errors:Scene 1, Layer 'Layer 1', Frame 1, Line 171119: Access of possibly undefined property visible through a reference with static type Boolean.for each of the MC.

View 9 Replies

ActionScript 2.0 :: Setting Values To Movieclips?

Jan 13, 2010

I have 6 movie clip objects and I want to assign them all a value for when the user clicks on them. This value is to be hidden from the user but I will later use it with an additional software to capture the value. I assume this will be done by using a dynamic text field for when the movie clip is pressed.

View 6 Replies

ActionScript 2.0 :: SCORM 1.2 Setting SCO Objectives Values

Dec 10, 2007

how to set the objectives of a SCO within the LMS reporting of SCORM?

Here is what I have so far:

ActionScript Code:
var theScore = 10;
var theStatus = "c";
var intData = theStatus+";"+"mytestobj"+";"+theScore;
fscommand("MM_cmiSendObjectiveInfo",intData);

The only thing tracking in the LMS is "mytestobj" which is reporting as the objective name.

View 2 Replies

ActionScript 2.0 :: Setting Boundries When Moving Mc With ._x Values?

Jun 7, 2004

I'm moving this little red box along the x axis. It just moves w/ the mouse but it moves off the movie clip area, i want to be able to set the left and right boundries. Heres my code.

mc_movingBox.onEnterFrame = function() {
var xMouse = _root._xmouse;
f(Math.abs(xMouse - this._x) < 1) {

[code].....

View 1 Replies

ActionScript 2.0 :: Setting Boundaries When Moving MC With X Values

Oct 5, 2004

I'm moving this little red box along the x axis. It just moves w/ the mouse but it moves off the movie clip area, I want to be able to set the left and right boundaries.

Heres my code.
mc_movingBox.onEnterFrame = function() {
var xMouse = _root._xmouse;
if(Math.abs(xMouse - this._x) < 1) {
this._x = xMouse;
} else {
this._x -= (this._x-xMouse) / 6;
}}

View 6 Replies

ActionScript 2.0 :: Setting And Concatenating Variable Values?

Jul 24, 2009

I&#65533;m calling a ColdFusion page that generates output in the form of a text file to be used in a scrolling dynamic text field.So, Instead of calling a text file like so:

//calls a static text file
loadText.load("StaticTextFile.txt");
Im calling a ColdFusion page like so:

[code].....

View 1 Replies

ActionScript 2.0 :: Setting Boundaries When Moving Mc With ._x Values?

Oct 5, 2004

I'm moving this little red box along the x axis. It just moves w/ the mouse but it moves off the movie clip area, i want to be able to set the left and right boundries. Heres my code..

mc_movingBox.onEnterFrame = function() {
var xMouse = _root._xmouse;
if(Math.abs(xMouse - this._x) < 1) {

[Code].....

View 6 Replies

Flex :: DataGrid - Getting And Setting Individual Cell Values

Oct 8, 2010

I have Flex 4 DataGrid, what I would like to do is when an cell has been edited, I would then like to walk through the values of that column and preform math on the values, e.g., I want to total up certain values.

1) How do I reference individual values of a specific column so that I may set them.
2) How do I then set those values or should I create a new column array and pop it in place of that column.

View 3 Replies

Actionscript 3 :: Setting Default Values For Object Properties?

Dec 28, 2010

how to set default property values for objects that are being created in a loop.

In the example below, these propeties are the same for each object created in the loop: titleTextField.selectable, titleTextField.wordWrap, titleTextField.x

If you pull these properties out of the loop, they are null because the TextField objects have not been created, but it seems silly to have to set them each time.

var titleTextFormat:TextFormat = new TextFormat();
titleTextFormat.size = 10;
titleTextFormat.font = "Arial";

[Code]....

View 4 Replies

Flex :: Item Renderer And Setting Values For Named Objects (Odd Bug)?

Oct 19, 2010

I have a custom component as an item renderer.In this renderer there is an item called dlFirstChoice.Now when I add more items to this list and force the list to rebuild itself something odd happens.Part of the creation of the renderer I set a default selection for the DropDownlist as follows: dlFirstChoice.selectedIndex=0The problem is once I have more than one item to render from my dataset this property stops working. So if my dataset has only 1 item to render the drop downlist sets itseld up properly, the momment I need to render more than 1 copy of my item renderer, all of a sudden nothing gets set fo

View 1 Replies

Flex :: 3 - Flex: Affecting Function Result On Bindable Boolean Not Generating Databinding Event

Mar 14, 2011

I have a small question. I am probably misunderstanding something, but when I do :

[Code]....

View 1 Replies

ActionScript 3.0 :: Confirm Box - Make A Function Confirm() Which Return A Boolean Value?

Aug 29, 2010

I'm trying to make a custom ConfirmBox.I have this movie clip: http:[url].....and I'm trying to make a function confirm() which return a boolean value.Obviously true when the user press "SI" and false when he press "NO:.Something like this:

ActionScript Code:
public function confirm(msg:String):Boolean [code]....

View 8 Replies

ActionScript 2.0 :: Setting Array Values To Variables In Another Array

Dec 11, 2007

I have some variables created on the main timeline and a mc called options which will be where those variables can be manipulated. A way I've tried to this is by creating a first array(array1) and populating it will all the variable names found on the main timeline, and another array(array2) containing the values of the variables the user has changed(which are displayed on some dynamic text fields). To make these changes, an "apply" button is pressed which will set the values found in array2 to the variables in array1.[code]How would you do this so that var1, var2... are updated properly according to the values found in array2?And because array2 contains strings(read from dynamic textfields), how do you deal with that since var1 and var2 are numbers?

View 6 Replies

ActionScript 3.0 :: Setting Variables For Timer Function

Jan 1, 2011

I'm making an animation of calculating a projectile motion with air resistance based on Python code from [URL]. I include the relevant portions of codes as follow. I'm not familiar of the vector object in AS3 so I translate them into variables as follow:

Actionscript Code:
//timer related variablesvar
fps:uint = stage.frameRate;var interval:Number = 1/fps;
var myTimerYes:Timer = new Timer(1000/fps);
//air resistance timermyTimerYes.addEventListener(TimerEvent.TIMER, startSimYes);
function startSimYes(e:TimerEvent):void{
[Code] .....

The timer activates when the user clicks the start button. The start buttons set the variables for the timer function. The variables are created at the start of the actionscript file. The code of the start button is:

Actionscript Code:
start_btn.addEventListener(MouseEvent.CLICK, goTimer);
function goTimer(e:MouseEvent):void{m = int(airText_mc.mass_txt.text);
A = int(airText_mc.refA_txt.text);
Cd = int(airText_mc.Cd_txt.text);
rho = int(airText_mc.density_txt.text);
[Code] .....

The result I get is the aX = 0 all the time, even after the update I specified in the timer codes. I can't understand what's wrong with the code, it's supposed to be updating every time the timer goes on.

View 1 Replies

ActionScript 2.0 :: Way Of Setting A RollOut Of Application Function?

Dec 21, 2009

Is there a way of setting a rollOut of application function?

View 1 Replies

ActionScript 2.0 :: Dynamically Setting Function Type Through Xml?

Jan 16, 2006

I have a number of functions and I want to execute 1 based on the entries in a .xml file

part my xml file reads as follows

<funcType>thisFunc</funcType>

In my .fla I have defined thisFunc along with a number of similar functions

I want to execute the function as follows

chosenFunc=Node.childNodes[0].childNodes[0].nodeValue;//points to thisFunc in the .xml file
chosenFunc(); // This should execute as thisFunc ()

Problem is this doesn't seem to be working. Am I trying the impossible?

View 1 Replies

Flex :: Setting The Correct Sort Function At Runtime?

Aug 27, 2009

Using Flex 3.2, I have a object which extends a TitleWindow. In this TitleWindow I have an AdvancedDataGrid.

On creation of this object, I pass it 2 lists, one full of data to display, and the other I pass an array of column definitions. This allows me to, at runtime, create the correct columns and define the correct display attributes for each column (e.g. booleans will show up as checkboxes, and dates are formatted in a specific format (coming in from an XML feed in a variety of STRING formats where nulls are a possibility)

The problem is that the default sort, being based on string, doesn't work 100% of the time and even when the format is one that would be sorted nicely, it fails when nulls are involved.

The above problem would be easily solved using a sortCompareFunction, but the fact is when you set the sortCompareFunction of the column, it seems to require you to hardcode in the column name into the function.

for reference here's the function I'm using to create the columns:

private function setupGrid():void
{
var localcols:Array = new Array();

[Code].....

View 3 Replies

ActionScript 1/2 :: Pass Values From One Function To Another?

Apr 25, 2011

I am a middle school teacher and a newbie in Flash Actionscript. I am trying to create a countdown timer for use in my class during tests. The start and pause functions work as required, but not the pause button. When I click on the pause button, the timer is reset to 0:00:00.[code]

View 1 Replies

ActionScript 2.0 :: Returning Values From A Function?

Oct 12, 2005

I need to load data from a database, so I created the following function and placed it in frame 2 on the main timeline.

Code:
getQuestionSet = function (category:String, subject:String, level:Number, count:Number):Array {
var questionSet:Array = new Array();
var writeV:LoadVars = new LoadVars();

[Code]...

Whenever I try to call the function, it fails to set the value of the questions array. It always appears empty(questions[0]-questions[10] have the value undefined). But, if I check the values from within the function after I have set them, it works, so I know that it is receiving the values. What am I doing wrong?

Code:
questions = getQuestionSet("Art and Music", "Art", 1, 10);

Here is an example of how I have would call the function.

View 7 Replies

ActionScript 2.0 :: Setting A Function Execution In Flash Via Text Link?

Jan 3, 2010

Is it possible in Flash to set a hyperlink (in a textField), and then have that link run a function within Flash (not Javascript)?I know one can easily launch a URL via a text link, or even run a Javascript function, but what about a function in Flash?

View 2 Replies







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