ActionScript 2.0 :: If Statement Alternative?

Mar 17, 2004

I was reading through various source codes, trying to teach myself more and more AS as usual... and some things brought me to ask this question.let's say I place a movie clip on the stage, called gun. would:if (_root.gun) {} return a true statement, simply because a MC called gun exists on the stage?

View 1 Replies


Similar Posts:


Actionscript 3.0 :: Alternative To Key.isDown Conditional Statement?

Oct 19, 2010

I have a logic-sorta question about finding an alternative to an if/else statement that controls key.isDown detection.(NOTE: I am using senocular's KeyObject class, the utility found on his website senocular.com, that returns key.IsDown functionality to AS3)

typically in most game/character movement tutorials I see this:

Code: Select allif (key.isDown(Keyboard.RIGHT))
moveRight();
else if (key.isDown(Keyboard.LEFT))

[code]....

The problem im having with this code is the fact that theres an order it checks the keys due to the if/else statement.For example, if I was holding down the LEFT key and then simultaniously began holding down the RIGHT key, the RIGHT key's function would execute and override whatever the LEFT key's function was doing, since the RIGHT key is the first thing checked in the if/else statment.

The only work-around i can think of is making all the keys a single If statement, and a switch statement that controlls the movement. Which im having a lot of trouble getting to work at the moment...

View 1 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

ActionScript 3.0 :: Write Another "if Statement" Inside Another If-else Statement?

Sep 22, 2010

I have a script which is giving me a lot of trouble since I have no idea how to write another "if statement" inside another if-else statement. I keep getting errors, I guess I don't know where to put the braces exactly...

example:
if(bla == bla) {
<------------how would I write another if statement here?
}else if (bla == bla){
}

View 3 Replies

Can't See Alternative Content

Dec 17, 2010

[code]...

iphone safari can't see <a id="alternative" target="_blank" href="#">iphone can't see me</a>

But PC's safari,firefox can see the alternative.

View 2 Replies

ActionScript 2.0 :: If Then Else Alternative?

Nov 7, 2006

I made a script which will tile dynamic mc in a way that after a number of clips (say 5) in a row, i would like the 6th mc to position on the next row below the first row, like this:

1 2 3 4 5
6 7 8 9 10

i was able to do it thru series of if-else if statements but the thing is that i was wondering if there's a better logic in doing this, i was thinking of using switch statement but is there a way to type "i>=9 && i<=20" into a case parameter? here is the code and i have also attached the fla if anyone would like to see:

Code:
if (i>=20 && i<=25) {
item._x = item._width+275;
yVal = (i-20)*(item._height+5);[code].....

View 2 Replies

ActionScript 2.0 :: Better Alternative Than XML?

Oct 25, 2007

I have created a Flash application for a "big" client which communicates heavily with the server. Flash app is initially loaded with a big XML file, which is retrieved by an aspx file. Then every 5 seconds, it calls a different aspx file to update. There are 3 asp files, which also sends back XMLs, that it calls periodically on top of the aspx file. Buttons on the app calls 4 different asp files with data being sent via querystring, but, uses the XML.sendAndLoad commands since we want the communication being done behind the scene.

During testing on development and live sites, we noticed no problems. We had sporadic complaints about the application being slow, but, they were so rare that we let it slide.

Now, it seems more frequent. I went back to the application and tried utilizing the built-in garbage collection by deleting all temporary variables, but, that didn't seem to improve much.

Given this scenario... is there anything I could try to improve the speed of server communications?

View 1 Replies

Get Alternative Export Codecs For CS3?

Sep 5, 2009

I have an application requiring exporting of Flash animations to run on an embedded media player. This accepts a number of video formats. The most reliable I have found so far is DivX. The player supports DivX versions 3.11, 4.x & 5.x. The export codec in CS3 is DivX 6.8.5 which is not compatible with the player.The player also supports MPEG2 but the quality is not very good. Other options are Xvid Mpeg4 video (doesn't work) and MS Mpeg4 video codec V2 & V3 (also not supported in CS3).I have tried downloading a variety of alternative second source file converters but frankly tied myself in knots. Any idea how I can get around this problem and get a DivX 5.x codec to work natively within CS3?

View 2 Replies

ActionScript 1/2 :: Alternative To LocalConnection?

Sep 23, 2009

I'm having huge bug issues with LocalConnection that nobody seems to be able to find errors in my code/files. So... I'm looking for an alternative. I need a main swf file to load an external swf including the ability to have it move from one frame to another. If this isn't a possibility, I can also just have the main swf hide/reveal a div or just an image in the html.

View 9 Replies

Flex :: Alternative (free) IDE For It?

Jun 27, 2009

I am an Adobe Flex developer and I am sick of Eclipse. Is there an alternative (free) IDE for Flex? I am aware of Tofino, but I can't get that to work on my MSVS Express editions, and I don't want to buy the whole thing.

View 5 Replies

Flex :: Get Good Alternative IDE?

Mar 24, 2011

Good alternative Flex IDE? I am interested in free editions mostly but I will also take under consideration the paid ones.

View 2 Replies

Php :: Xcode As An Alternative Of Flash?

Dec 20, 2011

We have developed a magazine reader which is basically PHP application. Admin panel is built in PHP but when any user wants to read a particular magazine, it is handled by Flash i.e. we are embedding the .swf object with HTML in PHP page. But flash is not supported in iPad/iPhone. So we want to create this application in Xcode so that user can read the magazine in iPhone/iPad also. There is confusion how it can be accomplished.

View 1 Replies

ActionScript 2.0 :: Alternative To AttachMovie??

Apr 16, 2007

Is there an alternative to attachMovie that I can use to put my movieclips on to the stage. Here is my problem, I have 2 frames total in my fla file, and in each frame I have buttons that when you click on them it attaches the corresponding image from the library. Problem is when you click to go to the next frame, the attached image stays.

I basically want it to stay attached only until you hit the next frame.

View 4 Replies

ActionScript 3.0 :: Alternative To TileList?

Mar 9, 2009

I'm looking for a lightweight alternative to the TileList component. I'm currently designing and developing an MPU Ad Creative that references an XML doc and pulls in four FLVs and their appropriate meta data. These videos will then be playable in the merch window, and there will be some opt-in data capture going on as well.

I've got a prototype going at the moment that grabs the XML and populates a TileList, and then uses ListEvent Listeners to add functionality to each of the ImageCells. All working fine, except that the file size is already at 47k without any of the data capture form fields in there. This is already over the TZ polite-load limit, and I've only added maybe 60% of the functionality. When I remove the TileList class, the swf shrinks down to 3k (a much nicer size ), and even after adding the remaining 40% I can't see this going much above 15k.

So, anyone know of anything I could use to replace TileList? I thought about creating my own class that holds all the information for each Video I need, but I thought I should check first to see if there are any other alternatives.

View 1 Replies

ActionScript 3.0 :: Alternative To Drawing At Runtime?

May 7, 2009

I need to have the ablity to create 3000+ sprites so they can be interact. In this case it is a bunch of booths at trade show.  I have done a lot of experimentation about how to create/draw these in the quickest possible manner.I have used timers, loops, enter frame events and I am still not satisfied with speed.My new idea is to create a seperate swf before hand that has everything drawn out so this doesn't have to be done at runtime, the swf can just be downloaded.  So my question is.... What would be the best way to develop a module that draws out everything into a swf file so that at runtime, I am not drawing anything, I am just uploading the file.

View 19 Replies

Professional :: Flash Interface CGI Alternative?

Mar 2, 2010

I would like to have a flash app on a website where:A user can input some values Those values are then sent to a server which has an executable fileThe exe is run with the user's settings and then sends some data back to the userThe data is displayed in the flash app.Is it doable with CGI or is there a better alternative to this?

View 2 Replies

ActionScript 3.0 :: OnComplete Alternative For URLRequestMethod.GET In IE7?

Feb 13, 2012

I'm trying to use URLRequestMethod.GET to get some xml from our website.In ie7 the onComplete never fires so it gets stuck but it works great in every other browser. I know that to fix a similar problem with preloaders you change the onComplete to a ProgressEvent and check to see if bytesLoaded == bytesTotal.This doesn't seem to work for URLRequestMethod.GET because when bytesLoaded = bytesTotal it doesn't mean that you have your data. Is there another way to check to see when the data is finished?

View 7 Replies

Alternative To Sitepal (text To Speech)

Feb 26, 2008

Are there any alternatives to sitepal with the same or close the same quality of text to speech engine?

View 1 Replies

Flash 10 :: Alternative For Adobe AIR And Zinc?

Nov 27, 2009

I'm making a Flash app in Flash 10 and ActionScript 2.0 and need support for calling an EXE with some params and minimizing/close the application.

Neither Adobe AIR nor Zinc don't seem to support some code I made and I'm looking for a very simple alternative? Does anyone know about any?

View 3 Replies

Flash :: Looking For An Alternative To PTViewer For 360 Panorama

Dec 4, 2009

I've been using PTViewer but it is causing some issues with looking for the ptdefault.html everytime and I'm wondering what other options are out there?

View 2 Replies

Php :: Free Opensource Amfphp Alternative

Dec 17, 2009

is there any other framework that does the same as amfphp? I dont want to use amfphp because it hasnt been updated in years and looks like it's no longer under development, I have to use PHP so I'm looking for a PHP alternative.

View 2 Replies

Documentation - Flash CS4 Have An Alternative To ASDoc?

Mar 16, 2010

Does anybody know of a tool that will allow me to create ASDoc style documentation with a Flash CS4/AS3 application? From what I hear ASDoc only works with Flex.

View 2 Replies

Flex :: Free Alternative For BlazeDS?

Sep 28, 2010

Do you know any free alternative for BlazeDS? It's working fine here, but we're looking for alternatives to check wich one is better.

View 3 Replies

Actionscript 3 :: Alternative Way For Positioning Objects?

Jan 6, 2011

I'm looking for an alternative way to position a bunch of objects.

Here is my code:

private var orderContainer:Sprite;
private var currentOrder:uint = 1;
private var orderArray:Array;

[Code].....

View 1 Replies

Flash Alternative For FileReader HTML 5 API

Feb 20, 2011

I want the content of a local text file to become available inside JavaScript. I've achieved that using HTML 5 FileReader API, but this works only in Mozilla Firefox and Chrome now. I know that it is possible to create a cross-broswer solution using Flash. Is there any open-source project that do that?

View 1 Replies







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