ActionScript 2.0 :: If Statement Not Recognized?

Jul 8, 2008

so i have this code for a video player i'm using

Code:
var listenerObject:Object = new Object();
listenerObject.stateChange = function(eventObject:Object):Void {

[code].....

View 6 Replies


Similar Posts:


AS3 :: IDE - URLLoader Data Not Being Recognized By Conditional Statement?

Jun 1, 2009

I am loading data from php using the echo method into flash via the URL loader:URLLoader method. The data then gets assigned to an objectMy problem is that the loaded data is being imported in fine and I can trace it and even display it in a text box, but if I try and use this data in a conditional statement - the statement just won't recognize its value?

My PHP---v
$row = mysql_fetch_array($query);
echo "result=success";

[code].....

View 1 Replies

ActionScript 3.0 :: URLLoader Data In Conditional Statement Not Recognized?

Jun 1, 2009

I am loading data from php using the echo method into flash via the URL loader:URLLoader method. The data then gets assigned to an object.My problem is that the loaded data is being imported in fine and I can trace it and even display it in a text box, but if I try and use this data in a conditional statement - the statement just won't recognize its value?[code]My problem is in green above. The variable/data being imported in is indicating which measuring unit the user preferred - "inchs" for inch's or "cms" for centimeter's.The statement never seems to recognize this data and always proves false and 'else' is executed.However if I instruct the data to be displayed in a text box eg."display.text = n.unit;" The text box displays the correct result as if the data has came across fine?

View 3 Replies

ActionScript 2.0 :: First Requirement Of The If Statement When Type In The Proper Input And Go Straight To The Else Statement

May 14, 2009

Having a few problems with what I thought was a simple if statement. Here is the code:

[Code]...

I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.

View 7 Replies

ActionScript 1/2 :: Execute Code In Previous If Statement If Second If Statement Is Executed?

Aug 31, 2011

if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code

[Code]...
 
I dont want to copy the code from the first into the second and the first and second into the third.
 
My mind isn't working and there is probably an extremelly simple way to get this working.
 
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.

View 7 Replies

ActionScript 2.0 :: Loading Data From XMl File And Uses It To Run An If Statement. If Statement Fails?

Oct 10, 2008

The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);

Heres the code:

Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {

[code]....

The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.

View 1 Replies

ActionScript 2.0 :: If Statement Inside If Statement Won't Work

Mar 30, 2011

why this code won't work

[Code]...

I'm sure you can put if statements inside other if statements, seriously I can't figure it out

View 4 Replies

ActionScript 3.0 :: Another 'if' Statement Inside An 'if' Statement?

Sep 22, 2010

I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.

View 13 Replies

ActionScript 3.0 :: Use A For Statement To Create An If Statement

Jul 12, 2010

what I'm trying to do is create an else if argument for each object in an array based on a user set number

Code:
for(var i:int=0; i < numberOfElseIfs; i++){
GENERATE AS3 CODE
}

to which I want it to GENERATE THE FOLLOWING CODE:

Code:
}else if(baskets[i].used == false){
baskets[i].used = true;
drawButton(i);
}

the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?

View 4 Replies

Motion Presets (mp) Not Recognized When Put A Mp'ed Swf Into Another FLA?

Jun 1, 2009

1. I did a small SWF with motion preset.
 
2. Import that SWF into another FLA that has a larger stage.
 
3. Play back (ctrl-Enter) the FLA and the motion (translation etc.) inside the SWF is there, but the effects (blur etc.) are not honored.

View 9 Replies

ActionScript 3.0 :: Btn Not Being Recognized Through E.target.name?

Nov 21, 2009

I had this posted in another post I had which was answered and it also had a lame post name so I have reposted it here I can not figure out why my code here is not working.... (i guess that's pretty obvious or I would not be posting it!).
 
Would you mind taking a look at this and possible you can spot what it is that I have wrong?
  
I am getting the error:TypeError: Error #2007: Perameter url must be non-null. at flash.display::Loader/_load() at flash.display::Loader/load() at asFiles.reality::RealityScenarios/loadImage()[C:(networkpath).as:226]

[Code]...

View 16 Replies

ActionScript 1/2 :: MouseEvent Not Being Recognized?

Jun 9, 2010

but1.addEventListener (MouseEvent.CLICK,play1) ;
function play1 (event:MouseEvent) :void{
gotoAndStop("Wales 1") ;
}
 
This is my code but the MouseEvent is not recognised

View 3 Replies

Professional :: System.gc() Recognized In AIR 3 For IOS?

Mar 6, 2012

is System.gc() recognized in AIR 3 for iOS ? Or am I putting on a line a code that's just for pasterity ? I have made every effort to dispose(),null and removeEventListener any unused Object, hence to be able to tell the Garbbage Collector to "go ahead" is a really awesome feature.

View 5 Replies

Xml :: ToXMLString() And Other Methods Not Recognized?

Apr 30, 2011

In Flash CS4, I've got a project that's working with a lot of XML. Previously, it's all been working fine, but recently I'm getting warnings like this when trying to compile:

Warning: 3594: toXMLString is not a recognized method of the dynamic class XML.

Warning: 3594: appendChild is not a recognized method of the dynamic class XML.

The lines of code that these errors refer to are:

stream.writeUTFBytes(currentXML.toXMLString());

and

currentXML.appendChild(marker.getXML());

"stream" is a FileStream object and "currentXML" is an XML object. "marker" is an instance of my own class, which I have imported, but I'm pretty sure that's not related.As I've said it's only happening now. I don't see anything in my code that could have changed it. Even if I turn the changes into comments, I still get errors.In addition to these two I am also getting other warnings, although all of them concern a method "not being recognized" in the XML class.I am using Flash Pro CS4 and am coding on the first frame of the timeline, as opposed to in a Document Class. Oh, and I'm making an AIR app, not a Flash Player one.

View 1 Replies

ActionScript 2.0 :: Some Keypresses Not Being Recognized In CS4?

May 24, 2010

I'm using Flash CS4, and using ANY method for capturing keypresses, only some keypresses are recognized. Backspace, Enter, and all of the letters on the keyboard do not trigger anything for me. Even using code as simple as...

on(keyPress "<Enter>"){
trace("pressed enter");
}

...doesn't work at all, while code like....

on(keyPress "<Space>"){
trace("pressed space");
}

...works perfectly. And no, caps lock isn't on.

View 4 Replies

ActionScript 1/2 :: Button Click Not Recognized

Jun 9, 2009

I have a movie clip on stage; instance name: "slide_mc" on the enterFrame of slide_mc, I fill slide_mc by using: this.attachMovie (_global.myNewCip,"newMC",1); // _global.myNewCip holds the linkage identifierThroughout my swf, I use attachMovie to swap out new movie clips in slide_mc like this:this.slide_mc.unloadMovie (); //clear contents of slide_mc slide_mc.attachMovie  (_global.myNewCip,"newMC",1);There is a button on the movie clip I just attached to slide_mc. Its instance name is: "pause_btn"From the main timeline I try to detect a mouse click by using this

[Code]...

View 4 Replies

ActionScript 3.0 :: Any Way To Get TextField Recognized Without Instance Name

Jun 14, 2009

I'm trying to have action script recognize a text field without me having to give it an instance name. All is fine at first because i wrote custom errors to show if Flash doesnt find a text field on the stage, and no errors come up. I know that my errors work because when I remove the text field from the stage all the errors appear. The problem arises when I try to manipulate the text field through AS that I right on the main timeline. When I do then I get that old 1119 undefined property error.

Here's my code.
package com.nate.ui {
import flash.display.Sprite;
import flash.events.Event;
import flash.net.*;
import flash.text.TextField;
public class TextArea extends Sprite {
[Code] .....
And here is just my trace (on the timeline) that throws up the 1119 error.
trace(ta.textField);

View 4 Replies

Tahoma Font Not Recognized In Flash CS4?

Jul 26, 2009

I wanted to use Cs4 to edit a flash template but noticed it kept saying I did not have tahoma font installed. I checked the font folder and I did have the font installed on the system but nevertheless I reinstalled it which did not fix the problem so I manually mapped/substituted it to the Tahoma I had on my system but noticed the fonts still appeared off when I published. I have uninstalled and reinstalled the software and it still occurs.

View 3 Replies

ActionScript 1/2 :: Variable Not Recognized / Passed In PHP?

Nov 4, 2009

Why isn't the "finco" not recognised/passed to php? I'm not getting the text results!!
Code:
var finco = "motors01";
XMLParser.load("[URL]"+finco, onFinish);
function onFinish($success:Boolean, $results:Object, $xml:XML):Void {
if ($success) { category.text += $results.category[0].value;
namez.text += $results.namez[0].value;
[Code] ......

View 17 Replies

Php :: Sessions Not Recognized When Going Through Flash / Uploadify

Jan 15, 2011

I'm writing an application which uses cookie-based sessions for authentication. All was well until I tried to integrate the uploadify jQuery plugin into my site. I need uploadify to send the files to my upload.php file. When I check the existence of any preknown session variables in that upload.php script, I get nothing. I've tried print_r($_SESSION) and got an empty array.

I'm not sure if this a problem with my php sessions code or my jquery uploadify code. I'm somewhat new at both.

/** INSIDE JQUERY **/
$('.fileUploadify').uploadify({
'scriptData': {'filesUploaded':'1','PHPSESSID' : <?php echo

[Code]....

View 2 Replies

Actionscript 3 :: Collision Detection Is Not Recognized?

Feb 22, 2012

I'm trying to make a game like Mario. I've made a character which can jump right now, but I've got some problems with collision detection.

I would like my character to jump on a bar, which is placed higher. My collision detection doesn't work at all I gues..I've made a cirle which has a instance name mcMain and I've made a MovieClip of it. T also made a rectangle which has a instance name balkje, I also made aMovieClip of it.

I hope you can tell me what is wrong about my code and what I've to change to make the collision detection work!

[Code]...

View 1 Replies

ActionScript 3.0 :: MovieClip's Children Not Recognized?

Aug 4, 2009

I have 2 movieclips on stage; one called 'myMarker_mc', the other called 'myMarker_mcOne') - they both contain 4 children (bt_up, bt_dn, bt_remove ) and myText (a textfield) and they only work properly when it is the 'myMarker_mc' that is being called (called from the xml at the top of the file).

Code:
stop();
import flash.display.MovieClip;
import flash.text.TextField;

[code]...

When myMarker_mcOne is called the dynamic textfield, called 'myText' produces a blank and the output box pops up with...

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MapMovieClipJune09TrialMarkersB_fla::MainTimeline/showData()[MapMovieClipJune09TrialMarkersB_fla.MainTimeline::frame61:126]

View 2 Replies

ActionScript 2.0 :: Characters Recognized Within Arrays

Jan 13, 2010

What characters are recognized within arrays?

I currently have the number 1-9 and A defined as various objects inside my level, but when I try to define a new object within the array as 'B' it simply refers to the object from A.

View 4 Replies

ActionScript 2.0 :: Buttons Not Working / Recognized?

May 30, 2007

Has anyone come across this?

I've created a button with a rollover state and everything. Popped it on the stage and gave it an instance name of "myBtn_btn".

on root i wrote this:

myBtn_btn.onRelease = function(){
trace("hello world");
}

but nothing happens. I have many other buttons. all do different things and work find. everything has a different instance name. no linkage is the same. I've double checked and triple checked that the name is "myBtn_btn" in the function AND the button. I've even tried recreating a different button with different names and still nothing. It's like I can't make any more button actions.

View 1 Replies

IDE :: No Path Recognized When Loading Swf With The Button On It

Jun 20, 2009

I have this code working on a button.

[Code]...

Works great, but there's obviously no path recognized when loading this swf with the button on it, to an empty movie clip on another swf. (ie: _root.container.bio ...)

View 5 Replies

ActionScript 3.0 :: MovieClip's Children Not Recognized

Aug 4, 2009

I have 2 movieclips on stage; one called 'myMarker_mc', the other called 'myMarker_mcOne') - they both contain 4 children (bt_up, bt_dn, bt_remove ) and myText (a textfield) and they only work properly when it is the 'myMarker_mc' that is being called (called from the xml at the top of the file).

Code:
stop();
import flash.display.MovieClip;
import flash.text.TextField;

[code]....

View 4 Replies

ActionScript 3.0 :: Button Not Being Recognized By E.target.name

Nov 22, 2009

Would you mind taking a look at this and possible you can spot

I am getting the error:

TypeError: Error #2007: Perameter url must be non-null.
at flash.display::Loader/_load()
at flash.display::Loader/load()

[Code]....

View 3 Replies

ActionScript 3.0 :: New Timeline Instances Not Being Recognized?

Feb 15, 2011

I am pretty familiar with Flash and AS3, but I am having a silly issue that I cant seem to overcome. I have a movie clip in my library thats linked to an external class file. I have a layer in my FLA that has an instance of this movie clip on it. Somewhere down the timeline I have a new keyframe (instance) of this same movie clip on the same layer. I do not have any blank keyframes between the first instance and the second instance.

I have a trace line running in the constructor of the custom class that traces back "init". This trace displays in the output for the first instance, but not the second instance. If I remove the second instance from the layer and put it on its own layer, then the trace displays for both instances.

In other words, flash does not appear to be recognizing the second instance as a new instance when its on the same layer and does not have a blank keyframe between it and the previous instance.

I know putting the blank keyframe in isnt that big of a deal, but this is a movie clip thats going to be used over and over in multiple files by myself and other co-workers and I guarantee you people will forget to put a blank keyframe in or use a new layer.

View 5 Replies

ActionScript 2.0 :: XML Video Playlist - Array Not Getting Recognized

Jan 20, 2009

I am trying create a video playlist driven by XML. My problem is Flash doesn't seem to be recognising the array. It comes out perfectly in the trace.

Heres the AS:
PHP Code:
var xm:XML = new XML();//creating XML object
var title_array:Array=new Array()//array objects to hold title data from xml
var creator_array:Array=new Array()//array objects to hold creator data from xml
var location_array:Array=new Array()//array objects to hold location data from xml
var image_array:Array=new Array()//array objects to hold image data from xml
var info_array:Array=new Array()//array objects to hold info data from xml
[Code] .....

View 4 Replies

ActionScript 3.0 :: Negative Random Number Not Recognized?

Aug 15, 2009

I'm working on a AS3 project where users will decide whether a random number is whole number or not.There are three boxes (box1, box2, box3), which will display random numbers. Under each box there are two check buttons (for example: bt1 and bt2).There are also two boxes counting correct and incorrect answers (correct1 and correct2). There is a button generating random numbers again (bt_2).The negative random numbers are not recognized by my conditional. Or I don't know how to handle conditional with negative numbers. Positive or negative numbers display the correct check mark? Here is my AS3

//counters
var i:uint=0; // correct answersvar u:uint=0; // incorrect answers
// making check mark invisibleco1.visible=false; // correctco2.visible=false; [code].....

View 2 Replies







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