Menu
  • HOME
  • TAGS

Should I use Actionscript 3.0 or Python or something else for cross-platform programming? [closed]

python,actionscript,cross-platform

Cross-platform Python is very good on cross-platforms. Which is you can use Django for web, Kivy for mobile apps, Pygame for games etc etc. Python is an Open Source Code which is pretty awesome!! Reliable Too broad. It depends on people, too subjective.. Fast Yes, Python is probably faster...

Tell Target code (convert to as3)

actionscript-3,flash,actionscript,adobe

Instead of tellTarget("/something") use (root as MovieClip).something. Instead of on (release) { use addEventListener. import flash.events.MouseEvent; button.addEventListener(MouseEvent.CLICK, buttonClick); function buttonClick(event:MouseEvent):void { (root as MovieClip).incorrect.nextFrame(); } ...

How can I remove button I press in Flex?

arrays,actionscript-3,flex,actionscript

Try following. It will work and remove the button which is pressed. public function removeButton(event:MouseEvent):void { myGroup.removeElementAt(myArray.indexOf(event.currentTarget)); myArray.splice(myArray.indexOf(event.currentTarget), 1); } ...

AS3 How do I make these objects loop endlessly?

actionscript-3,loops,actionscript

If you're trying to get cars to reposition to the top of the screen as @onekidney guessed, you could easily do so by using the % operator: function fl_EnterFrameHandler(event:Event):void { car1.y = (car1.y + 12) % stage.stageHeight; car2.y = (car2.y + 12) % stage.stageHeight; car3.y = (car3.y + 12) %...

AS3 - Menu with textfields

actionscript-3,flash,actionscript

After removing your TextField, you can re-position all other text fields like this : // the menu items container var menu:MovieClip = new MovieClip() addChild(menu); for(var i=0; i<5; i++){ var txt:TextField = new TextField(); txt.x = 20; txt.y = 26*i + 20; txt.height = 24; txt.width = 120; txt.text =...

Sending notifications and/or messages to a Flash/Silverlight/HTML5 player in fullscreen

flash,silverlight,actionscript,html5-video,flash-player

Clearly didn't do my homework, have found that this will be nearly impossible: Are overlays on top of full-screen flash video possible?...

Is it impossible to increment in a for loop by decimal numbers in actionScript 3 and get accurate results?

actionscript-3,flash,actionscript,floating-point

The initial problem, as reported in Hobo Sapiens's comment, is that you have declared i as int, but want it to store fractions. However, even after you have fixed that, you are likely to encounter rounding error issues. Adding up a floating point approximation to 0.1 is not a good...

Flash Buttons Not Working Correctly

actionscript-3,flash,actionscript,flash-cs5

Your problem doesn't come from this code. You just have to put your transparent flash buttons over the icons (they are under them).

List all LocalConnection channels open in the page

actionscript-3,actionscript

No, unfortunately, it's not possible. If your embed swf is AS3 based you can pass LC name to it when swf is loaded (or listen for the name in event from it, not difference), if it's AS2 the only way to pass variables is to load it with Loader by...

How to remove a child from a random array?

arrays,actionscript-3,flash,random,actionscript

Your problem is your nested loop. With each iteration, you add one new dot, and then loop over all of the existing ones, and remove them if it collides with the box. I don't think that's what you intended to do. It looks like you just want to make sure...

TimerEvent Dispatcher Error

actionscript-3,flash,timer,actionscript

Ok, first, you have some invalid code (not sure if that is just a copy paste error or your actual attempted code). Take out: **strong text** & change TimerEenter code herevent.TIMER to TimerEvent.TIMER. Now that that's out of the way, on to your actual error. The error is being cause...

Does AS3 support functions when using the String.replace() with a RegEx?

actionscript-3,actionscript

I found more info here. So while this works in JavaScript: string = string.replace(/\b\w+\b/g, function(m){ return /^[A-Z]/.test(m) ? "Word" : "word" }); We would have to remove the parameter and use the arguments object available to all functions like so: string = string.replace(/\b\w+\b/g, function():String { var match:String = arguments[0]; //var...

Actionscript, how to add a time delay for an object

flash,actionscript

I would add a counter, based upon your framerate (say you have 24fps, 3 seconds is 72frames): var hit = false; var counter; onClipEvent(enterframe) { if (_root.char.hitTest(this)) { hit = true; } if(!hit) { waitcounter = 0; } else { waitcounter++; } if(waitcounter >= 72) { unloadMovie(this); _root.gotoAndStop("StageL2"); } }...

How can I solve a “Type Error #2007 Parameter child must be non-null”?

actionscript-3,actionscript

Your for loop do 21 iterations but your array has only 20 elements, so you should do : ... for (var i:int = 0; i < toyArray.length; i++){ addToys(1200 * Math.random(), 200 * Math.random() * 2) } ... ...

When using the 'Class' datatype, how can I specify the type so I only accept subclass of a specific class?

actionscript-3,class,actionscript,superclass

If you are going to instantiate it anyway, why not accept an object instead which allows you to type it to :SuperClass? careless(SomeClass); //vs. careless(new SomeClass); Not too much of a problem there as far as your code goes. There are a few differences though: The object has to be...

Get dispatchEvent data as a result

actionscript-3,flex,actionscript,flex4.6

The .data property is defined in DataEvent, not Event. But your parameter of the method is of type Event. Change the type of the parameter to DataEvent....

UILoader cover background in ActionScript 3

actionscript-3,flash,background,actionscript,uiloader

Based on the Alsacrations jQuery solution (http://www.alsacreations.com/astuce/lire/1216-arriere-plan-background-extensible.html) : function backgroundCover(){ var image_width:Number = uilBackground.content.width; var image_height:Number = uilBackground.content.height; var over = image_width / image_height; var under = image_height / image_width; var body_width = uilBackground.width; var body_height = uilBackground.height; if (body_width / body_height >= over) { uilBackground.content.width = body_width; uilBackground.content.height =...

Flash Pro Admob Banners

actionscript-3,flash,actionscript,google-play,admob

maybe you can try to run this flash file.it is a file by flash pro cc https://github.com/lilili87222/Admob-ANE/blob/master/demo.fla...

How do I get the degrees of a 360 circle where 12 o clock is 0 or 360 degrees?

javascript,math,actionscript

How about something like the following: function getAngle(y, x) { var angle = Math.atan2(-x, -y) * 180/Math.PI - 90; return angle < 0 ? 360 + angle : angle; // Ensure positive angle } ...

AS3 - Get and Set

actionscript-3,flash,actionscript

The difference is that the set method is implicitly called when you set a property of the same name. You do not have to type the ( ) that do the function call but assign the value via =. player_X = 5; vs. setPlayerX(5); It can help with information hiding...

Actionscript 2.0 Movie clip

flash,actionscript

If you create the movie clip with ActionScript, just call the removeMovieClip method. ant_mc.removeMovieClip(); However, if you create the movie clip in the editor, then you will need to use the swapDepths method first. ant_mc.swapDepths(0); ant_mc.removeMovieClip(); ...

Actionscript 3: Drawing lines and bitmaps the right way

actionscript-3,flash,actionscript

Well, it depends. In Flash, you have the option of relying on the Flash Player's vector rasterizer and rendering system, which will figure out all the redrawing for you. For instance, you can draw once to a Sprite then simply apply transforms to the sprite (set x, y, width, height,...

Displaying the total sum of values from strings

string,actionscript-3,flash,actionscript,flash-cs5

You should be able to string together multiple parseint statements like this: var total:number = parseint(amount1.text) + parseint(amount2.text) + parseint(amount3.text) + parseint(amount4.text) + parseint(amount5.text); output1.text = total; If you go this route, you will need to handle stituations that involve NaN Here is the documentation on parseint if you haven't...

Drag and Drop Text Fields AS3

actionscript-3,flash,actionscript,drag-and-drop

startDrag(); and stopDrag(); are methods of the Sprite class, and also inherited by MovieClip, which is a subclass of Sprite It's a good idea to check the official Adobe documentation to see what classes inherit what methods; Sprite class TextField class Because Sprite and MovieClip are both base classes of...

ActionScript3 Function to hide or show movieclip currently on stage in a different class

actionscript-3,flash,actionscript

Your issue is confusion between object references and instantiation. When you use the new keyword, you are creating a whole new object. So in ConStartMenu when you do this: public var menuDisplay:Menu = new Menu(); You are creating a new Menu object. And, in SideMenu when you do this: public...

Removing itens from a TileList Flex actionscript

flex,actionscript,flex4.5

Simply use removeItemAt(): var i = 2; // or whatever indexed item you actually need to remove tileList.dataProvider.removeItemAt(i); ...

How do I stop the edge of movieclips that extend the stage from entering stage boundaries in AS3?

actionscript-3,flash,actionscript,adobe,flash-cc

Sounds like you want to constrain the object so you can't scroll it to a point where it's edge is seen? In that case, you need to sanitize your value so it doesn't go beyond that point. So, for moving the object down, instead of just subtracting 200 like your...

Linking two arrays in Actionscript 3

arrays,actionscript-3,flash,actionscript

var listAry:Array = []; var orangeJuice:Object = new Object(); orangeJuice.name= "Orange Juice"; orangeJuice.matchingImage=oj; listAry[0]=orangeJuice; ////etc etc There you go buddy. Hope that helps if you have any questions just ask....

Play video files online sequentially without delay/buffering between videos

html5,flash,video,actionscript,ffmpeg

An approach that will work on some browsers currently, and on most browsers going forwards is to use the HTML5 Video Media Source Extension mechanism. This essentially allows you replace a static 'src' file for a video in your HTML5 page, with a dynamic src buffer which you can then...

I cannot solve error #2136 swf contains invalid data

actionscript-3,actionscript

In your Tamagotchi Class you have var food:Food = new Food(); And in your Food Class you have var tam:Tamagotchi = new Tamagotchi(); This seems rather infinite loopy... (One gets created, which creates the other, which creates the first one again, which creates the other again, and so on...)...

ActionScript is activating two buttons at once

flash,actionscript,actionscript-2,flash-8

If you want several arrows btn1, btn2... to disappear one after the other, you can do like that: var a:Array = [btn1, btn2]; var l:Number = a.length; var n:Number = 0; var keyListener:Object = new Object(); keyListener.onKeyDown = function():Void { if (Key.getCode() == Key.UP && n < l) { a[n]._visible...

Don't understanding this instantiate

c#,actionscript

Is this a list of list? Yes. It is. In c# it would be private List<List<Tile>> map = new List<List<Tile>>(); There is a difference (in c# at least) for how you access array elements. If you did a multidimensional array it would look like this: string[,] map2 = new...

ActionScript stage browserZoomFactor error

actionscript,swf,stage

Unless you're on IE, Windows 8, this feature won't work. Other browsers don't report the browser zoom amount, so that property will not be found. http://blogs.adobe.com/flashplayer/2014/09/improved-resolution-of-stage3d-content-on-browser-zoom.html

Simple For loops not working on cs6?

actionscript-3,flash,actionscript,flash-cs6

If you only need the variable i within the loop itself and don't need the variable beyond the scope of the loop, you can also declare it within the loop parameters: for(var i:int = 0; i < 5; i++) { trace(i); } In terms of performance it's a marginal difference,...

ActionScript 3 - Define and construct a class from a variable

actionscript-3,flash,variables,actionscript

You can try: var ClassName:Class = getDefinitionByName('CustomClip') as Class; //DisplayObject/DisplayObjectContainer/Sprite/MovieClip, the base class you are using in your CustomClip var clipToUse:DisplayObject = new ClassName(); addChild(clipToUse); ...

why my code is not working about CameraRoll in android(as3)

android,actionscript-3,actionscript,camera,camera-roll

With the few details mentioned in your questions, I think this is a problem of permissions and the code is fine. Try to add this permission : <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> You can add it directly to your your_app-app.xml, where your_app is the name of your application ( project ), before </application>...

How to migrate SWF plugin panel for InDesign CS4 to InDesign CC2014?

flash,flex,actionscript,indesign,extendscript

The Flash/Flex Panels are deprecated. Take a look at Extension Builder 3. You can build panels for ID CC 2014 with HTML5 and Javascript/Extendscript now. http://labs.adobe.com/technologies/extensionbuilder3/ To your questions. A1) In extendscript you can address InDesign CC like this. You can ommit the target if you want. #target "indesign-10" var...

Parse JSON in ActionScript 3 (Native JSON)

json,actionscript-3,flash,actionscript

To do what you are looking for, you can do like this : function parseJSON(e:Event):void { var parsedJSON = JSON.parse(json.data); // trace('request-time : ' + parsedJSON['request-time']); for(var city_name:String in parsedJSON.data){ // extract data without fixing the city name in the code var city:Object = parsedJSON.data[city_name]; trace('city : ' + city_name);...

Using multiple classes to control a character

actionscript-3,actionscript

You need to add the KeyboardEvent listener to the stage - currently it'll only work if your character has text focus, which it won't ever have. A simple setup that I like, it to have an Input class, that adds the necessary event listeners and you can then use to...

Flex property binded to datagrid dataProivder array

flex,actionscript,mxml

As hinted by Timofei Davydik Adding [Bindable] annotation to the class made it happen: [Bindable] public class SelectRowDataGrid extends DataGrid { ... ...

Actionscript 3.0 Timer doesn't display in text box

actionscript-3,flash,timer,actionscript

You should update your dynamic text field inside the timerHandler like this : function timerHandler(event:TimerEvent):void { trace(upCounter); upCounter++; text_field.text = (upCounter).toString(); } Also, you have to remove this line : myTimer:String; because it is useless....

Action Script 3.0 - MouseEvent Listener + function issues

actionscript-3,flash,actionscript,mouseevent

Disable mouse interaction with children of antwoordBox's: antwoordBox1.mouseChildren = false; antwoordBox2.mouseChildren = false; Register event listener: addEventListener(MouseEvent.CLICK, antwoordboxclick); Inside the event handler: if (event.target == antwoordBox1) trace('antwoordBox1 selected'); else if (event.target == antwoordBox2) trace('antwoordBox2 selected'); ...

Accessing timeline objects from a class, giving null object reference?

actionscript-3,flash,actionscript,flash-cs6

First: You have a syntax error in these two lines: _player.x = MovieClip.(root).character.x + 5; _player.y = MovieClip.(root).character.y + 5; There should not be a period after MovieClip, so it should look like this: _player.x = MovieClip(root).character.x + 5; _player.y = MovieClip(root).character.y + 5; Second: You are always creating a...

Using actionscript Xml.send() to coldfusion 7 stopped working after flash player update

flash,coldfusion,actionscript,flash-player

Turns out that the contentType "text/xml" was deprecated and the newer version of flash player must be more strict about setting it to valid value and updating my value to the default. As soon as I changed it to "text/plain" all started working

ActionScript3 | Object or Array

actionscript-3,actionscript

Objects When we talk about an Object in ActionScript 3, it is important to note that everything inherits Object and that a vanilla Object instance is dynamic (meaning you can freely attach data to it without that data being defined within the class definition). You are able to initialize a...

Actionscript 3 Search for string in array, propblem

arrays,actionscript-3,flash,actionscript

What kind of syntax are you using there and have you even checked the documentation of the Array class? That should be the first thing you check always, as there is a pretty straightforward method for it: var arr:Array = ["1111", "2222", "3333"]; trace(arr.indexOf("3333")); //traces the index: 2 ...

Flex mx:SWFLoader Loads Incorrect SWF File

actionscript-3,flash,flex,actionscript,swfloader

mxml file must be named differently in loaded applications

Get textinput number of character in Flex

actionscript-3,flex,actionscript,flex4.6

According to the manual, maxChars is not checked when text is altered in code. So, you have to manually control the new value of text to not exceed 2 chars. An example: protected function onNumberClick(event:MouseEvent):void { var s:String=txtGuestCount.text; if (s.length==2) s=s.substr(1); // drop first char s+=event.currentTarget.label; // if (s.length>2) s=s.substr(0,2);...

Ways to incorporate dynamic update in flash cc

javascript,flash,actionscript,adobe

Yes it is possible, but its a little more effort as i see your using the timeline animation. Easier way to reference everything is to set up a scope of variables that can be accesses anywhere: In your situation its best to put your whole content movie inside an Empty...

Change Text of spark progress bar in flex

actionscript-3,flex,actionscript,progress-bar

Add event handler to ProgressBar: progress="progressHandler(event)". private function progressHandler(event:ProgressEvent):void { var percent:int = Math.round(event.bytesLoaded / event.bytesTotal * 100); idOfProgressBar.label = "Downloading " + percent + "%"; } ...

Actionscript 3 sprite clear with alpha

flash,actionscript,adobe

May be you should put all the sprite into a Vector and you manualy remove them when you need. private var vec:Vector.<Sprite> = new Vector.<Sprite>(); private function update():void { // reduce the alpha of all other sprites // check all other sprites from the newest to the oldest (so we...

Actionscript 3.0 - detecting multiple instances already placed on stage and adding them to an array

arrays,actionscript-3,flash,actionscript

Make those blocks instance of a custom class (export to as -> custom class). Run a loop on the display list and check if the objects are instances of that custom class, eg: for(var i:int = 0; i < this.numchildren; i++) { if(this.getChildAt(i) is MyCustomClass) { myarray.push(this.getChildAt(i)); } } ...

Android in which thread(GUI or custom) make calculations better?

java,android,flash,actionscript

This really depends on how much work you are doing. Most times, I can use the main thread for small graphical calculations. Im not sure what you are doing, but something like setting a position based on an input sounds like a main thread thing. Generally, if you expect an...

how to set the position of bitmap data in action script?

flash,actionscript

You can center your Bitmap like that: var mybitmap_data:atkbr_jpg = new atkbr_jpg(); var mybitmap:Bitmap = new Bitmap(mybitmap_data); var mysprite:Sprite = new Sprite(); mysprite.addChild(mybitmap); mysprite.x = (stage.stageWidth - mysprite.width) / 2; mysprite.y = (stage.stageHeight - mysprite.height) / 2; addChild(mysprite); ...

How to use string in path to object?

actionscript,actionscript-2

In you case you could access instance you created like this: _parent[nameOfTrails] The point is that you can access an object using string with his name by searching proper object for property with that name. In your example you creating variable with id of nameOfTrails value inside some object which...

Error: Call to a possibly undefined method getRegionNameForCountries through a reference with static type com.framework.model:CountryModel

actionscript-3,flash,flex,actionscript

You can only access static vars/method from the Class object itself (eg. MyClass.method()), or from within the class declaration (static or instantiated). Here is a simplified example: MyClass.staticFunction(); //allowed var myInstance = new MyClass(); myInstance.staticFunction(); //NOT allowed //inside the MyClass.as this.staticFunctionInSameClass(); //allowed What you are trying to do is access...

ActionScript 3 Error when dynamically playing audio

actionscript-3,flash,actionscript,air

Either need a cross-domain or the path to the file is incorrect. Your AIR app is probably not running in the same folder as your mp3. See where your compiled air app is being stored and move the mp3 to that folder. http://www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error/ You may also want to use a...

check file type from FileReference after file load complete

actionscript-3,flash,flex,actionscript

You can check it manually by file signature. You need to read file signature from file raw data (usually first N byte) and compare it with expected file signature. Here is incomplete list of file signatures: http://en.wikipedia.org/wiki/List_of_file_signatures. But if you want to use some specific file format, I am sure...

How to run a range of value in specified seconds in Flash?

actionscript-3,flash,timer,actionscript,range

You need to scale your values to map one range to the other. To go from 0 to 90 in 4 seconds, you'll have 90 / 4 or 22.5 values per second. So on every tick of your timer, you'd increment by 22.5 to go from 0 to 90 in...

Remove duplicate enteries/items from XML in AS3

xml,actionscript-3,flash,actionscript

Here is an example on how to do what you'd like: Using this test XML: var xml:XML = <data> <profile> <first_name>ann</first_name> <last_name> lee</last_name> <photography>sport</photography> <photography>landscape</photography> <photography>still life</photography> <image>img1.jpg</image> </profile>; <profile> <first_name>john</first_name> <last_name> thomas</last_name>...

sending a GET request from a banner

actionscript-3,flash,actionscript,get

I think there are many points in your case that should be clarified : If you want send a URL request to a server, but ignores any response, and I think this is your case because you can't get response, It's better to use sendToURL instead of URLLoader.load(). If you...

Drawing function but only on a certain screen/page (actionscript3)

actionscript-3,flash,actionscript,drawing

To draw something in your stage, you have added some MouseEvent listeners to your stage, so to stop drawing, you have simply to remove these listeners and clear your Graphics object, if you need of course, like this : stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown1) stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp1); stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMove1); Line.graphics.clear(); Hope that can help....

Move a character in flash randomly

flash,actionscript

In your code, XMove is always equal to YMove, and the value of RandomNumber won't change when you call RandomNum(e:ComponentEvent) function.so the character will just move diagonally. Try this. function getRandomNumber():Number{ //return a random number in range. Math.random() * (max - min + 1)) + min; return Math.floor(Math.random() * (5...

Array, Object, Memory. Actionscript

arrays,object,memory,actionscript

The objects stored in arrayOld get garbage collected if there are no other references to them. The ones from arrayNew are not copied - they are referenced by arrayOld after the assignment. It's to say that that after: arrayNew[0].name = 'a random silly text'; arrayOld = arrayNew; arrayOld[0].name = 'another...

If I have a multidimentional array, how can I acsess only the first value of the first dimention?

arrays,actionscript-3,flash,actionscript,flash-cs5.5

In your sample code "Nouns" is actually located at sampleArray[0][0] However you are replacing that with sampleArray[0][0]=["Person","Place","Thing"] Perhaps it would be easier to keep your information in an object. Then reference them that way. Not sure what your end goal is though so that may not work for you. var...

How do I use Jangaroo to convert a single As3 function to javascript?

javascript,actionscript,code-conversion,code-converter

I just updated the documentation on how to use Jangaroo as a command line tool: https://github.com/CoreMedia/jangaroo-tools/wiki/Stand-Alone-Compiler After following steps 1 through 6, you can compile your single class like so: mkdir joo\classes jooc -v -g SOURCE -classpath %JOOLIBS%\jangaroo-runtime.jar -sourcepath . -d joo\classes GACodec.as Note that the generated JavaScript file GACodec.js...

ActionScript: How to call an objects function within an array?

arrays,flash,object,actionscript

A Vector will let you easily call the functions of your objects which are stored in that vector. var vector:Vector.<YourObject> = new Vector.<YourObject>(); vector[0].yourObjectFunction(); http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Vector.html Alternatively, you can cast the members of an Array to a specific type and then call the functions. (array[0] as YourObject).yourObjectFunction(); ...

Object changing layer when going between frames?

actionscript-3,flash,actionscript,adobe,flash-cs6

In AS3/Flash, the bottom most layer is 0. So doing addChildAt(character, 1) would make your character the second to the bottom layer. addChildAt(character, 0) would make it the very bottom/back layer. If you want to make it the top most layer, you do any one of the following: addChild(character); //this...

Add your Stage in a ScrollWindow ActionScript 3.0

actionscript-3,flash,actionscript,flash-cs5,flash-cs4

Your issues is likely these two lines: aBox == stage as MovieClip; aSp.source == aBox ; You're doing a comparison by using two ==, which effectively does nothing in your case. Use a single = to assign a value. This is how I would suggest you approach this: In the...

ArcusNode Cannot set property '1' of undefined

node.js,actionscript,rtmfp

It seems that ArcusNode is no more maintained (last commit is from 2 years ago). You could try MonaServer which is a complete open source and lightweight server. It supports each features of RTMFP (object replication, NetStream, NetGroup...). They are also some samples here : Mona Samples (source codes are...

Load a html file inside Flash

flash,actionscript,actionscript-2

You can't really use that as that is meant for loading media (such as images and other movie clips). Since html files are generally text, you can load in the data using the classes for loading in text files. It's been quite awhile since I've had to think in AS2,...

How can I remove duplicate names?

actionscript-3,flash,flex,actionscript,arraycollection

If you want to remove duplicate entries from the result, you should do like this: public function processorNameFormat(item:Object, column:GridColumn):String { var processorNames:String = ""; if (!(item is ProcessOrderDO)) { return ""; } var d:Dictionary=new Dictionary(); var poDestReqList:ArrayCollection = item.processOrderDestinationRequirementDOList ; for each(var destReq:ProcessOrderDestinationRequirementDO in poDestReqList) { var s:String=destReq.processorName; if (d[s])...

Platformer game hit test

actionscript-3,flash,actionscript,flash-cs6

For player physics, it's more clear approach to make a central ENTER_FRAME handler function that just for calculating the transformations to be applied to player. You can still get information from out, but you just process the final output there. Else, it could be problematic, especially when things gets more...

Which is faster: (i == 0) or (i < 1)

actionscript-3,if-statement,actionscript,boolean

Why? Whichever you do, the compiler will optimise it on whatever platform you are currently compiling on. If you need to check if it's 0, use (i == 0), if you want to know if it's less than zero, use that one instead. Write what you would read out loud....

Making a button display a text field on click in ActionScript 3.0 [closed]

actionscript-3,flash,button,actionscript

learn_button.addEventListener(MouseEvent.CLICK, onButtonClick); textField.visible=false; function onButtonClick(e:MouseEvent):void { textField.visible=true; textField.text = "Three paragraphs of text..."; } ...

Deploy Adobe AIR app in to iOS simulator

ios,actionscript,air,adobe,ios-simulator

To fix this issue we need to update the AIR SDK https://helpx.adobe.com/air/kb/archived-air-sdk-version.html Copy it here: Mac OS X: /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK Windows 7 (64-Bit): C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722\AIRSDK and update the *-app.xml file header to this one: <application xmlns="http://ns.adobe.com/air/application/17.0"> See...

AS3 Error on URLRequest in Flash with HTTPS url with self signed certificate

actionscript-3,flash,actionscript

Problem solved! I added the self signed certificate to my keychain on the Mac and set it to Always Trust. This worked a treat.

Accessing timeline variables from a class?

actionscript-3,flash,actionscript,flash-cs6

From the class you can access a variable like this: MovieClip(root).variable

Flex radioButton Set selected Value via ActionScript

flex,actionscript

I figured out a simple solution and wanted to post here for others who may need it. I created a Boolean variable (btnPhValue) and set it's value based on the value of the field AthleticsFavs in my SchoolList array. Then I set the radioButton.selected value to the Boolean var I...

Get all selected items -

flex,actionscript

One simple solution I found so far is, to iterate my dataprovider checking, if the item is selected or not. And here you go! var tmpList:ArrayCollection = ArrayCollection(dg.dataProvider); var obj:Object; for (var i:int=0; i < tmpList.length; i++) { if (tmpList[i].Selected == true) { //Added to my array collection. } }...

How to write the Flash actionscript to makes this mouse action?

actionscript-3,flash,actionscript

There are several ways to achieve what you are looking for, I recommend you to check also about Touch/Gesture events, also, check this library Gestouch (very powerful and well documented and with several examples) To help you to understand how to start understanding ActionScript and this logic in question, I...

Actionscript 3.0 ; Character Movement Speed is Stacking on top of itself under specific circumstances

actionscript-3,flash,actionscript,adobe,event-listeners

It should be event listeners. To debug if so, add this code: if (e.target is MovieClip) trace((e.target as MovieClip).currentFrame,"in moveChar"); to moveChar function. If the same frame would appear twice in a row in the trace window, you are adding two listeners to one object, they then act separately. A...

Redefining the hitbox of objects?

actionscript-3,flash,actionscript,adobe,flash-cs6

Well yeah flash does that, it needs some time to properly add movieclips to Stage. It's the reason why Event.ADDED_TO_STAGE exists, read this article to understand it better. But I'd say you would be pretty safe to go with a simple if statement making sure shark and shark.hitto are properly...

Is it possible to run html