FAQ Database Discussion Community
actionscript-3
i want to reload a gun. When R pressed. I want it to wait 3 seconds before loading the gun. Is there a simple way to do this? example: if (event.keyCode == Keyboard.R) { //wait(4 seconds) // start reloading } ...
actionscript-3,flash,button,event-bubbling,event-propagation
I have a container_mc, with lots of child_mcs inside. I want the child_mcs to have full button-like behaviors (click-able, cursor effects). I am not interested in putting individual mouse listeners on every child. ... I would like to simply have one listener on the parent container, though the parent would...
xml,actionscript-3,flash,e4x
I don't understand why I can't parse these datas : <places yahoo:start="0" yahoo:count="1" yahoo:total="1" xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"> <place yahoo:uri="http://where.yahooapis.com/v1/place/23424819" aaa:lang="en-US" xmlns:aaa="http://www.w3.org/XML/1998/namespace"> <woeid>23424819</woeid> <placeTypeName code="12">Pays</placeTypeName> <name>France</name> <country type="Pays" code="FR"...
arrays,actionscript-3
I've got this array : var usersArray:Array = new Array("this is array1 and it's a good array","this is array2", "this is array3", "this is array4", "this is array"); usersArray.push(usersArray.splice(usersArray.indexOf("UserID"), 1)); var companion:String = usersArray[Math.floor(Math.random() * (usersArray.length - 1))]; trace(companion); Is it possible to class the array with letter or number...
actionscript-3,flash
how to zoom stage to rectangle area in as3 (Action Scripts 3)? i have a text, when mouse over the ever word, color changed. now, when click the word i need to zoom to this word and hide the other word?...
arrays,actionscript-3,flash
I have 2 array having objects of different length var arr : Array = [{name : "aa", id : "0"}, {name : "bb", id : "1"}, {name : "cc", id : "2"}]; var arrTemp : Array = [{name : "ee", id : "0"}, {name : "hh", id : "1"}, {name...
actionscript-3,if-statement,actionscript,boolean
I recently heard that: //This: val1 * 0.5; //Is faster than this: val1 / 2; So I wonder if there is anything else like that, and so I ask: var val1:uint = 0; //Is This: if (val1 == 0) //faster than this?: if (val1 < 1) ...
arrays,actionscript-3,date
How to find the most recent date from an array like the one below? Tue Jun 2 17:59:54 GMT+0200 2013 Tue Jun 5 18:00:10 GMT+0200 2013 Tue Jun 1 12:27:14 GMT+0200 2013 Tue Jun 3 17:26:58 GMT+0200 2013 Tue Jun 9 17:27:49 GMT+0200 2013 Tue Jun 1 13:27:39 GMT+0200 2015...
actionscript-3,flash,audio
I have a problem with my background music. So I added this code on frame 1: var bmsound:Sound = new backgroundmusic(); var channel:SoundChannel; channel=bmsound.play(0,10000); And it works like a charm. The problem is, when I navigate to other frames and go back to frame 1 again, the music plays again,...
function,actionscript-3,flash-cs6
I'm a little lost in understanding this kind of function, i get the feeling this has been asked a thousand times but cannot find an explanation of what the code is doing. Basically i just want a movie clip with instance name box to do something, then reuse the function...
php,actionscript-3
I'm doing a fan Transformice map editor, but I've a question, "How can I do a preg_replace in Flash AS3?"... This is something like <? $mapXml = "<C><P /><Z><S><S L="304" H="65" X="175" Y="355" T="6" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>"; $mapXmlDisplay = preg_replace('<S L="(.*)" H="(.*), etc..."', 'someThing', $mapXml); ?> It's possible? Thanks...
actionscript-3,flash,settimeout
In JavaScript: setTimeout("document.write('example')", 200); I want to know how I can do a setTimeout in Flash (AS3). I know there's the Timer() class, but I want a more simple way to do this....
javascript,jquery,actionscript-3,flash
i made a custom slider and everything seems to be fine, but I am trying to create a seek function to make the slider move using this.mySlider.sliderTrack.mouseX position from width:1000px I just need help figuring out how the math to make mouseX the new channel.position var newPercent = this.mySlider.sliderTrack.mouseX =...
actionscript-3,flash
I'm incredibly rusty at Flash having not touched it in probably 10 years and can't seem to figure this out, or find it online: I have a MovieClip with two layers, each having a Shape Tween. Basically its a Door that opens and closes. I dropped it onto the main...
arrays,actionscript-3,flash,cs4
I'm using a tutorial I found on Google - which works well. However, I have a few issues to make it work how I would like. This code uses a MovieClip for the card faces with the back of the card on frame1 and 2-17 different pictures or movieclips. The...
actionscript-3,flex,model-view-controller,parsley
I posted a question last night that after reading back sounded awful, so I deleted it and have come back to try again, this time properly. I have a Flex Mobile App, that uses Parsley, everything works as expected but I am trying to do use a decoupled result handler...
c++,c,actionscript-3,dll,air
I am working on an AIR Native Extension (ANE) for Windows desktop. The point of this extension is to be able to call out to a third-party C library, which consists of two .h files defining the method signatures/typedefs, and a .lib file. Before including the third party library in...
arrays,actionscript-3,exception,runtime-error
I'm trying to create a collision code involving an array of bullets and an array of zombies. But when it tried this code: for(var bu:int = 0;bu < bullets.length; bu++){ for(var zo:int = 0;zo < zombieCount.length; zo++){ if(bullets[bu].hitTestObject(zombieCount[zo])){ stage.removeChild(zombieCount[zo]); zombieCount.splice(zo, 1); stage.removeChild(bullets[bu]); bullets.splice(bu, 1); trace("hot hit") } } } I...
actionscript-3,flex,actionscript,flex4.6
I have textinput in flex we application. <s:TextInput id="txtGuestCount" maxChars="2" editable="false"/> Where i limit maxChars to 2. It works when i remove editable="false" from textinput and type using keyboard. Problem: But same thing is not works when i do using button click like: <s:Button width="50" height="50" chromeColor="#ffffff" label="1" buttonMode="true" click="onNumberClick(event)"/>...
actionscript-3
hello, I want to get whole number after division. x = 3/2; //results x = 1 and not 1.5 how to do this in as3??...
actionscript-3,class,extending
The DisplayObject class can be extended but the extended class cannot be instantiated. Class: package{ import flash.display.DisplayObject; class Extended extends DisplayObject{ public function Extended(){ super() } } } Main timeline: var e:Extended=new Extended(); addChild(e); Error: ArgumentError: Error #2012: Extended$ class cannot be instantiated. ...
actionscript-3
I have a button that starts the game, it initializes the game when you click it startButton.addEventListener(MouseEvent.CLICK, onStartButtonClick); I also have a firing thing, it's supposed to shoot AFTER you start the game by clicking the start button and THEN shoot when you click. stage.addEventListener(MouseEvent.CLICK, fire); However, it fires right...
arrays,actionscript-3,boolean
I'm in need of creating multiple dynamic arrays and seem to have found exactly what I need at https://jadendreamer.wordpress.com/2012/05/06/flash-as3-tutorial-how-to-create-2d-or-3d-dynamic-multi-dimensional-arrays/ Example 1: var multiDimensionalArray:Array = new Array(); var boolArray:Array; var MAX_ROWS = 5; var MAX_COLS = 5; //initalize the arrays for (var row = 0; row <= MAX_ROWS; row++) { boolArray...
actionscript-3
I am making my first as3 game and am taking a username and password field from a MySQL server. The array gets split into each user, but I would also like to split it from username to password. I am then checking if the username and passwords from the database...
actionscript-3
I'm using Flash AS4 and Ive created and array that holds xml data which works fine with the following loop for(var i:int = 0; i < uNavXML.length(); i++){ navArray.push(uNavXML..navRef.text()[i]); The XML data is actually the names of movie clips that I have on stage: xmlLIST :<uNav> <unavNavID>1</unavNavID> <navRef>navBtns.nav01</navRef> </uNav> <uNav>...
java,actionscript-3,flex
I am using Flerry as Java-Flex bridge for my Flex Desktop Application. How to convert List in Java to ArrayCollection in Flex Flex Code:- [Bindable]public var screenList:ArrayCollection; <flerry:NativeObject id="windowControllerObj" source="ls.window.EnumAllWindowNames" singleton="true" fault="windowControllerObj_faultHandler(event)"> <flerry:NativeMethod id="getWindowNames" name="getAllWindowNames" result="windowControllerObj_resultHandler(event)" fault="getWindowNames_faultHandler(event)"/>...
actionscript-3,flash,button
I'm having a serious problem that is getting me nervous: I've made a button _btn that includes ROLLOVER and ROLLOUT animations with coding (an nested movieclip instance called barra that increases to half alpha when you hover over and decreases when you hover out). [Here it should go a descriptive...
arrays,actionscript-3,flash,actionscript
I have a problem with searching for strings in an array. I want to search for one word and if it exists, I want to trace the position of the string in the array. I believe it should be something like this: if (myArray contains "11111111") { trace("*position*") } else...
actionscript-3,user-interface,flash
I have designed a menu in Flash CC which consists of several cloned buttons and an MC containing the text that is supposed to stay above the buttons. Each time a user switches the menu's page, AS commands the clip to switch to appropriate frames, therefore changing the text above...
actionscript-3
Both of them, do the same. so, are they completely same as each other or there is difference?
actionscript-3,flash,text
I'm working with TextFlow and EditManager in AS3 (flashx.textLayout) I want to know how get ActivePosition pointer "Y" position, I know I can get activePosition from EditManager but it's returns character position. I want to count if activePosition out of screen, then scroll down (text is larger and its out...
actionscript-3,events,tooltip,mouseevent,mouseover
I created a tooltip class. When the mouse over on MovieClip it enable and when it out it disable. The movieclip containt some other movieclips. My code is that: to.addEventListener(MouseEvent.MOUSE_OVER, showTip); to.addEventListener(MouseEvent.MOUSE_OUT, hideTip); to.addEventListener(MouseEvent.MOUSE_MOVE, MoveTip); and the functions is that: private function showTip(evt: MouseEvent) { if (tip != null &&...
actionscript-3,flash,bitmap,bitmapimage
I was experimenting with bitmaps and created an alpha mask. When i test the program in full screen, it works fine however when I re-size the screen, the bitmap alpha masks doesn't seem to scale correctly. Below are illustrations of my issue. The bitmap alpha mask is shown as a...
ios,actionscript-3,flash,fonts,embedded-fonts
So I have an annoying issue that I can't solve. I am creating an app in Flash Pro/AS3 for iOS. I have a button whose label font I want to change: var ButtonTextFormat:TextFormat = new TextFormat("Showcard Gothic", 120); //ButtonTextFormat.size = 120; //ButtonTextFormat.font = "Showcard Gothic"; //ButtonTextFormat.embedFonts = true; ButtonTextFormat.color =...
actionscript-3,for-loop,flash-cs6
Hey Everyone So I know this has to be really Simple I am over complicating it and can't figure out how to do it. So I have these stars moving in the background in my startScreen and I want to remove them when the Game starts. Here is How I...
arrays,algorithm,actionscript-3,for-loop
so I'm currently making a quiz game with Actionscript 3.0, and I wanna shuffle the questions with this Fisher-Yates Shuffle Algorithm: This is my code: var questions:Array = [1,2,3,4,5,6,7,8,9,10]; function ShuffleArray(input:Array) { for (var i:int=input.length-1; i>=0; i--) { var randomIndex:int = Math.floor(Math.random() * (i+1)); var itemAtIndex:int = input[randomIndex]; input[randomIndex] =...
actionscript-3,flash,flex,canvas,layout
I use BitmapData.draw to make a snapshot of a graph canvas. On the canvas located some children in random positions (including negative positions). I should to define in some way what rectangle bounds to shoot. SO, for example, i have 3 nodes in the view (canvas): {10x10, (-5; -3)} {20x20,...
actionscript-3,flash,video,timer
I want to make a timer that will show text at my panelText (dynamic text box) at specific time, actually I have a video that I want to have subtitles, and I want to use timer, my video is 3 minutes and 37 second long, and I have script that...
actionscript-3,flex
I often have the requirement to dispatch a flash.events.Event with soem custom String text, like: protected function mouseClicked(event:Event) { //here I'd want to notify anyone interested in the button click, //and also transfer the name of the button (or whatever) that was clicked - assume some dynamic value dispatchEvent(new Event("myMouseEvent"),...
string,actionscript-3,replace,find
I want to find the "(*" string in another string and then replace it with the < and / one but the method replace() can not do it. Sorry, but I can not write the string in the description together :D Here is my code: //Call the method like.. trace(searchandreplace("(*Foo)"));...
android,ios,actionscript-3,flex,air-native-extension
I have two ane file for video recorder. One is for android and another is for ios device. Both have different package name and methods. Now, i import both Native Extension in single project. And detect ios and android device following way: if(Capabilities.version.indexOf('IOS') > -1) //for ios device And if(Capabilities.version.indexOf('AND')...
actionscript-3,variables,scope
Is it possible to set a global variable from within a function that takes that same variable name as an argument? var a:int = 0; function test(a:int) { a *global* = a *local*; } test(1); trace(a) // traces 0 but I'd like it to trace 1 (The reason why I'd...
actionscript-3,flash
I have a folder which is full of .as files, theres one .as file who is the "main" which has a ui (buttons) etc. i need to compile all into a swf file, or a way to debug it. these are the files: https://github.com/amitp/mapgen2 I have like 3 days trying...
actionscript-3,floating-point
This question already has an answer here: Is floating point math broken? 18 answers In my program, I have a score multiplier variable of type 'Number' When I try to add 0.1 to it, I have a problem. Here is the code: scoreMultiplier += 0.1; trace(scoreMultiplier); scoreMultiplier is originally...
actionscript-3,flash
this is my first time using AS3 so I apologise if the cause of this problem is painfully obvious. I'm making chess and I've got a class for each piece on the board. When it's player 1's turn, all the black pieces should wait to be clicked, but when I...
actionscript-3,events,flash-builder,mxml
I have a popup screen in which the player enters their name and clicks OK. When OK is clicked I want the player's name to be passed to the main XML. How can I do this? Here is the function in the main XML that handles the popup: private function...
actionscript-3,flash
Okay, wasn't sure about the title. But here's what I am trying to achieve: Basically i am trying to do something like a quiz, where you can drag and drop the answers into a field. And if they are correkt it should snap the answer field position. It should be...
actionscript-3,flash,resizable
Not sure if this is possible but going to ask: is there a way of being able to resize a symbol (in this case, a movie clip) in an swf file by clicking and dragging it with your cursor? One of the things I need to do is have a...
actionscript-3,flash
With following code I import an external swf file. When I try to reach a movieClip that is named as temaResim in imported swf, Flash gives me error ,cant find the movieclip. I am pretty sure that I have temaResim in imported swf file, any help will be very useful....
actionscript-3,flash
This question already has an answer here: As3: Draw overlapping rectangles to a sprite and apply alpha 1 answer It seems that when I set alpha on a DisplayObjectContainer, then it works on each individual child separately and not on the container as a whole. Consequently I start seeing...
actionscript-3,timer,typeerror
hi i have been searhing the net for hours and have not found a solution to my problem and i have no idea how to fix it as i am only new to flash so if you know anything that might help me just comment below please all help is...
actionscript-3
It was a while since I programmed AS3. Now I have a problem where I need to merge the two images where the upper image is a png that must retain its transparency. The upper image is an area that must pass through the lower image. A bit like a...
actionscript-3,flash,flash-cs6,uiloader
I'm using a Loader to display a SWF. I have a button to load the SWF and I want that same button to close or hide or unload the SWF. Here's part of my code: var so:Boolean = false ; glossary.addEventListener(MouseEvent.CLICK, glossaire) function glossaire (e:MouseEvent) { var myLoader:Loader = new...
actionscript-3,flash,flex
I'm trying to load an image from the internet with AS3 following this tutorial. When I try to compile the application I get the following error: Call a possibly undefined method load through a reference with static type Loader. my_loader.load(where, loaderContext); ^ Here is the code I'm using: package {...
php,actionscript-3
Well, I want to do a Flash AS3 Chat. When the user send a message, the message will be created as a row in mysql with PHP, but if it be so, the mysql server will be very busy, then the row must be temporary. Someone can help me? ^^'...
javascript,actionscript-3,flash,scorm2004,scorm1.2
I lately posted this and unfortunately I couldn't figure it out why. Furthermore I haven't any solution for that. Today I realised I can switch between NORMAL and FULL_SCREEN without SCORM parts of the content (connect/disconnect, get/set, etc.). But when I check both Flash wrapper and Mike Rustici's edited API...
actionscript-3,flash,printing,air,desktop
I am trying to create an air application using flash profession cc. I have functions called show bill and print bill in it. When i print directly with out showing the bill adobe air application works correctly. But when i try to use the show bill function and then try...
actionscript-3,addchild
My issue is that i get an error when my function addSpotlight is called. TypeError: Error #1010: A term is undefined and has no properties. at BubbleBoy_fla::MainTimeline/addSpotlight() at BubbleBoy_fla::MainTimeline/policeHeli() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() My code is this: //Adding Helicopter function addHelicopter(xLocation: int, yLocation: int, passSpeedX, passSpeedY): void { var helicopter:...
actionscript-3,ruby-on-rails-4,join,left-join
If after reading my question you have a suggestion for a better title, please add a comment. I was having trouble succinctly saying what I wanted. I have a situation like this. class Artist < ActiveRecord::Base has_many :album_artists has_many :albums, :through => :album_artists end class Album < ActiveRecord::Base has_many :album_artists...
actionscript-3,class,flash,return
I made my own AS3-DialogBox-class. It has 2 Buttons ("Yes" and "No") Within the class there is a listener that starts a function when one of the Buttons was pushed. And within this listener-function I can get and trace the Buttons label ("Yes" or "No") by calling event.currentTarget.MyButtonTextfield.text. So my...
actionscript-3,flash,optimization
I'm using GreenSock's TweenMax to fade in a TLFTextField with a DropShadowFilter applied. The framerate drops to about 8fps when I try to do this. Without the shadow, the transition is a consistent 24fps. I know Flash is redrawing the shadow each frame - is there any way I can...
actionscript-3
If I want to change the graphic quality display of the swf file by right click and click quality. Is there a type of code to apply this in-game when a button is pressed? If there is, please help! Thanks!...
arrays,actionscript-3,flash
Ok, so I have some experience with as3 and some of the basics. But this problem has been stumping me for so long. I tried to do a workaround based on what I currently know about as3. But somehow either i get an error message or it just doesn't do...
actionscript-3,flash
After switching to my 2nd scene, the keyboard event does not work until I left-click the screen. How to avoid that left click so that I can trigger my keyboard event directly right after moving to my 2nd scene? More details you may need: 1st Scene btnStart.addEventListener(MouseEvent.CLICK, initGame); function initGame(e:MouseEvent)...
actionscript-3,events
I have a dropdown menu that lets you select an item to be placed on the stage. The item is drag and droppable so I use event.currentTarget.startDrag(); to start the drag. Ok, everything works fine so far. However, I also need to be able to rotate the item while it...
actionscript-3
i'm trying to make a top down shooter game, and have been following tutorials here: http://gamedev.michaeljameswilliams.com/2008/09/17/avoider-game-tutorial-1/ and here: as3gametuts.com/2013/07/10/top-down-rpg-shooter-4-shooting/ i've managed to get shooting and movement, but i need to get a hit test object to register when the bullet (defined in its own seperate as class file) and the...
actionscript-3,flash
I need help with AS3 make downloading MP3 files in the background mode. Man goes to my site and it will automatically load MP3 file on his computer and plays it. I read these examples here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html but do not know how to do it? Prompt what code and how...
actionscript-3,timer
I have a "clock" counting down the time of the game (from 9 seconds to 0 seconds). I have a button that pauses the game, so I want to freeze de clock and when I click to play, the game continuos from that second that I frozen. But I don't...
actionscript-3,flash
So in my code I was attempting to make it where you had two players, each player had their own key down and key up handlers, clearly labelled in my attached code, and in their I handle the movement, player one has WSAD and player two uses the Left, Right,...
actionscript-3
I am making a simple math game with four frames. In the first frame you can choose the math operation you want to practice. In the second frame you are presented with a randomly generated math question. If you enter the correct answer, the application outputs "correct answer", and skips...
actionscript-3
Every single tutorial says to do it like this, which used to work: [Embed(source="/../images/MyImage.png",mimeType="image/png",smoothing="true")] private static var ImageClass:Class; //[...] var bitmap:Bitmap = new ImageClass(); Again, this used to work, but now (when I use PNGs) it gives me Error #1034: Type Coercion failed: cannot convert [email protected] to flash.display.Bitmap. Note that...
actionscript-3
if I make a dynamic text on the stage, name it something like "output" And I write in the enterframe. output.text = "Something"; It doesn't even show up in the stage, and the text box is blank....
php,mysql,algorithm,actionscript-3,flash
I'm trying to send encoded data for a bitmap image to a server and back to the( or a separate) client. There's probably an easier way to do this with sockets or something, but I'm a very casual and still a pretty new programmer and I had trouble understanding other...
actionscript-3,flash
I want to change the text in the text box when different images is dragged. However, I'm not so sure how to do the function for it. If anyone can help me an example of this, that'd be greatly appreciated. Thank you. So far I only have the var of...
actionscript-3,geometry,displayobject,angles
I want to make a symbol rotate to point at the mouse. I'm using this function, but it doesn't work below the symbol's pivot. The inverse tan function has a range of 180 degrees right? So how can i get 360 degrees of movement? Would I need to add an...
arrays,actionscript-3,flash,for-loop
Lets say that mySaveNewT.data.myNText = 20, and in a for loop, 20 MovieClips (tbox) are populated on the stage. When a tbox instance gets clicked I want to change its visibility to false. How do I reference an individual MovieClip that gets clicked, without having to set every MovieClip's visibility...
actionscript-3,flash,collision,detection
I am trying to get my character to collide with the walls I have created but I am having difficulties doing so, I have tried using solutions in other threads but none have worked. help please. Essentially I got collision detection working, however it only activates upon clicking, with a...
actionscript-3,flash,variables,dynamic
Is dynamic variable naming like this possible in ActionScript 3? for (var xz=0;xz<10;xz++){ var this['name' + xz]:Number = xz; } ...
javascript,actionscript-3,flash,escaping,swf
I have an embed tag that will be used to store a SWF object. I've been following this documentation here https://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html I need to create a parameter with a name equal to FlashVars. I need to store an API token in the value attribute. The problem is there is an...
actionscript-3,flash,video,centering,stagevideo
I've a brief question that I'm sure some AS3 genius knows. I'm surprised I haven't seen any other topics on this after 30 minutes of Google-fu, StageVideo seems to be largely silent. So I've been trying out the StageVideo API in place of traditional Videos for better video playback. This...
actionscript-3,flex,actionscript,flex4.6
Here i am working on native extension in which i send/dispatch data in the dataevent like: public static const PASSING_VIDEO_URL : String = "PASSING_URL"; dispatchEvent( new DataEvent( PASSING_URL,true,false,level) ); Now on eventlistener cd.addEventListener( CD.PASSING_URL, onURL ); protected function onURL(event:Event):void { txtUrl.text = event.data; txtUrl.text = event.text; } I got that...
actionscript-3,flash,air
I'm building an AIR app that sends text string to a swf-file. When I export the sender and reciever apps to swf and run them in Flash players, everything works well. But when publishing the sender app to AIR things don't work anymore. I think the connection works, because there...
actionscript-3,flash,arguments,kiosk
I have here, some AS3 that is used to create a 19 button interactive kiosk. It calls 20 different video_files to be played in an FLVPLayer. When one button is clicked, it draws the player and specifies the source. Whats happening is on our PC, is our crazy-kid-test, where we...
jquery,html5,actionscript-3
I need some feedback! So if any help, Thank you! I'm a developer for a digital signage company. We built a platform in Flash (ActionScript 3) and it has been running really smooth for a few years now. We've been talking about trying to move to HTML5, JQUERY and PHP...
actionscript-3,flash,playlist
Help me please I need my AS3 FLVPlayback component sequentially play one play list xml and that this is repeated indefinitely, until the moment I got this code, which only lets you choose which video you want to play but do not go to the next automatically only stops... I...
actionscript-3
I have called a setInterval on TouchEvent.TOUCH_END and I want to clear it when ever screen is touched. Here is my code: import fl.motion.MotionEvent; import flash.display.MovieClip; import flash.utils.*; Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin); stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd); function onTouchBegin(evt:TouchEvent) { clearInterval(MovieClip(root).myInterval); } function onTouchEnd(evt:TouchEvent) { MovieClip(root).myInterval =...
actionscript-3,flash
To be clear, I want to check a class, not an instance of that class. public function changeScene(newScene:Class):void { if(newScene isExtending Scene) //... } It's a variable of type Class. Edit: More details. What the function does (simplified): public function changeScene(newScene:Class):void { currentScene.finish(); //Finish the scene that is about to...
php,actionscript-3
Hey guy's so am trying to convert this as3 code to php but its not working correctly i need it like the as3 one generating thanks! PHP: print(floor(rand() * 1000) + 3000); Result:28240000 AS3: var intCID = Math.floor(Math.random() * 1000) + 3000; var strSessionId = String(intCID); trace(strSessionId); Result:3330...
php,actionscript-3,flex3,wav,riff
I recorded voice samples from my microphone using Adobe Flash Builder 4.6 / AIR, voice recorded successfully. I first converted voice data(byte array) to base64 format in actionscript then I converted that base64 data to WAV file using my PHP code. but that WAV file throw file corrupted issue in...
arrays,actionscript-3,flash
Using an array, I've created a MovieClip made up of tiles. I need to create the grid dynamically as there are multiple size options. If the user selects a different grid size, I need to remove the grid currently in place before adding the new grid - that is where...
arrays,actionscript-3,flash
I have an array of platforms that I'm hitTesting against a player. I also have a boolean variable called onGround that is attached to the player. I need to be able to toggle onGround based on whether or not the player is hitting a platform in the array. It's been...
actionscript-3,flash
So I have this motion script which I copied from Cs6 as "Copy Motion as AS3". It works fine until I tried to control it with a mouse event function. So what am I missing? it works fine outside the function but not at all inside. import fl.motion.AnimatorFactory; import fl.motion.MotionBase;...
actionscript-3,hittest
I have a game where player moves forward over (semi)random tiles. I want a hittest for when the player hits a certain tile. However when the char hits one of the spawned in floor2's nothing happens. I think this is because there are multiple 'floor2' movieclips on the stage ?...
actionscript-3,flex,flex4
Is there a class in AS3 or Flex that tells you the type of protocol a URI or URL is part of? I was sure there was a class that broke a URL into various parts and grouped it into usable data. For example, if the URL is, "mailTo" it...
file,actionscript-3,air,lan
I'm using FileStream to read files in two computers that are connected in a Local Area Network (LAN). I have no problem to read the files when the others computers are connected. I'm checking if the directory exists before writing the file I'm checking if the directory AND the file...
actionscript-3
I am having trouble googling for the expected behavior of the is operator in AS3. What I need to know is what should happen if the left side is null. I know it is possible to test, and get empirical results, but I need to know what the specification says,...
actionscript-3,flash
i am trying to create a list in runtime but couldn't make it work. Here is my code : var mc:MovieClip = new MovieClip(); addChild(mc); grpList.source = mc; for(var i = 0;i<count;i++){ var img:Bitmap = new Bitmap(new listbitmap(0,0)); var mvc:MovieClip = new MovieClip(); mvc.height = img.height; mvc.width = img.width; mvc.x...
actionscript-3,flash,flex,actionscript,arraycollection
Consider the follwoing code: The follwoing code print processorName in this format: DC5,DR2,DR3 But when it comes to duplicates it prints as DR3DR3. I need to remove the duplicate processorName. I am not able to figure it out, how can I do this? public function processorNameFormat(item:Object, column:GridColumn):String { var processorNames:String...
arrays,actionscript-3,removechild
This is similar to a question I asked a couple of weeks ago, but different code and previous solution is not working. In a nutshell, I'm creating an array of tiles, the size of which can be selected via a dropdown menu. I want the previous grid to be removed...
actionscript-3,loops,mp4
import fl.video.FLVPlayback; import fl.video.VideoEvent; mcV2.autoRewind = true; mcV2.autoPlay = true; function Loop(event:fl.video.VideoEvent):void { mcV2.play(); } mcV2.addEventListener(fl.video.VideoEvent.AUTO_REWOUND, Loop); Its a good solution for looping mp4 video files, thx. How can I use 2 (or more) videos with this code for loop? etc: mcV1, mcV2, ../.....