FAQ Database Discussion Community


Deploy Adobe AIR app in to iOS simulator

ios,actionscript,air,adobe,ios-simulator
I'm trying to run a simple test app on a iOS simulator but I'm getting this error: Error occurred while packaging the application: [Fatal Error] :1:1: Content is not allowed in prolog. java.io.IOException: PLIST generation failed due to SAX error:org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog....

ActionScript 3 - Define and construct a class from a variable

actionscript-3,flash,variables,actionscript
I'm trying to easily add in some dynamic attributes to a few variables that I construct at the beginning of my movie clip. The variable is called with the line: var clipToUse:CustomClip = new CustomClip(); I need to replace the CustomClip class (which is created in the library) with a...

Change Text of spark progress bar in flex

actionscript-3,flex,actionscript,progress-bar
I think this is easy but get stuck while implementing. I added progress bar in my project which will show the download process. I am going to change text of progress bar from loading 20% to Downloading 20%. I make following changes in my code as i seen somewhere. <mx:ProgressBar...

Flex mx:SWFLoader Loads Incorrect SWF File

actionscript-3,flash,flex,actionscript,swfloader
I'm fairly new to Flex and am having an issue where I have a main Flex program (let's called it "Parent.swf") attempting to load another Flex application (Child.swf) via the SWFLoader class/component. Environment is Flex 4.6 on FlashDevelop. The call appears to work correctly (i.e. no IO or sandbox errors...

TimerEvent Dispatcher Error

actionscript-3,flash,timer,actionscript
I've got an Error when I run this code var timer4:Timer = new Timer(6500);**strong text** timer4.addEventListener(TimerEenter code herevent.TIMER,onTimer4); timer4.start(); function onTimer4(e:TimerEvent):void{ var bg2:Bg_2 = new Bg_2(); bg2.x = 470; bg2.y = 470; addChild(bg2); TransitionManager.start(bg2, {type:Fade, direction:Transition.IN, duration:2, easing:Strong.easeIn}); removeEventListener.(TimerEvent.TIMER,onTimer3); } Can anybody help me understand why I'm getting this: TypeError:...

Actionscript 3 Search for string in array, propblem

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...

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

actionscript-3,flash,actionscript
Hello lovely Actionscript peoples. I am having a bit of a problem creating a button using AS3 that can hide or show a specific movieclip that is being called by a different class. I think, honestly, that my problem is that I don't fundamentally understand OOP / classes as they...

Tell Target code (convert to as3)

actionscript-3,flash,actionscript,adobe
This is the code which I used in AS2 on (release) { tellTarget ("/incorrect") { nextFrame(); } } How do I do this in AS3 (AIR) ? Thank you....

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

actionscript-3,flash,actionscript,drawing
How do I make a drawing function to function only on one page/screen of an app? For example, the drawing function should only happens on page 15. What should I do in order for the "drawing"/drawing function to not be stuck on the screen when it goes to other pages?...

How can I add setInterval() in actionscript?

actionscript
I am receiving a image from server through Action Script. I want to receive the image in a continuous manner. I am new to this Action Script and write the following code I am writing in Flash how can I add `setInterval() to it. var my_pb:mx.controls.ProgressBar; my_pb.mode = "manual"; this.createEmptyMovieClip("img_mc",...

Actionscript 3: Drawing lines and bitmaps the right way

actionscript-3,flash,actionscript
I'm just getting started with Flash/ActionScript and it seems to be the general consensus to create Sprites, Bitmaps, MovieClips, etc for various objects in order to represent pictures and other graphics. However, the way I'm used to writing games and whatnot in other languages is to just loop repeatedly and...

Actionscript, how to add a time delay for an object

flash,actionscript
I have stocked on a problem with adding a time delay for an object. The main idea is that i want to change the level of the game to the next when the player hit a specific object. But i do not want this to happen immediately, so i want...

Stop the main timeline from within a Class function

actionscript-3,flash,actionscript,stage
I need to stop the movie at the first frame using a function from a class, I know I can use stop(); or this.stop(); but how do I stop the main timeline from within a class function? package { public class myApplication { public function myApplication(stageRoot:Stage) { stop(); // this...

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

actionscript-3,flash,actionscript
I'm using Actionscript 3 and loading a URL that returns JSON data. It works fine when requesting from an HTTP URL, but when I use an HTTPS URL I get a IOErrorEvent.IO_ERROR error. But I only get the error when testing the application in Flash - when the application is...

ActionScript 3 Error when dynamically playing audio

actionscript-3,flash,actionscript,air
I am writing a game for Air iOS. I have an audio file, saved in the same directory as my .fla file. Here is the code I am using to play it: import flash.net.URLRequest; var snd:Sound = new Sound(new URLRequest("507560_-BlastProcess-.mp3")); snd.play(0, 40); This is the error I get when testing...

Reverse Engineering - Find Missing Values

variables,actionscript,reverse-engineering
In the following function, I need to find the values for "a" and "b" or "a" and "toliau". Maybe it's because it's early, but I can't figure this out. Currenty I have solved for the following, but it appears to be incorrect: a = vrt vrt = 'LBLUVTBXQ' b= "xxx9xx8"...

How to remove a child from a random array?

arrays,actionscript-3,flash,random,actionscript
I have an array that randomly creates 10 dots. However there's a certain area where I do not want them to be created. How can I achieve this? My code gives me error 2025. "The supplied DisplayObject must be a child of the caller." It will occasionally output the totalDots...

Flex property binded to datagrid dataProivder array

flex,actionscript,mxml
I have the following datagrid in my application mxml: <event:SelectRowDataGrid id="resultDG" dataProvider="{model.EventDTOs}" ... <event:columns> ... SelectRowDataGrid is my extension of the Flex DataGrid: package xx.xx.xx.xx.event { import mx.controls.DataGrid; public class SelectRowDataGrid extends DataGrid { private var _checkedItems:Array; public function SelectRowDataGrid() { super(); _checkedItems = new Array(); } public function get...

How can I remove button I press in Flex?

arrays,actionscript-3,flex,actionscript
When I try this it doesn't remove the right button. Could you please point me in the right direction in finding what's wrong. private var myArray:Array = []; private var myButton:Button; public function addButton():void { var i:uint = myArray.length; myButton = new Button(); myButton.label = "New Button"+ String(i); myButton.id= "myButton"...

Remove duplicate enteries/items from XML in AS3

xml,actionscript-3,flash,actionscript
I'm getting duplicate results from an XML file. I want to delete the excess ones but am having trouble achieving this using splice and indexOf. Can someone point me in the right direction?? var xmlLoader:URLLoader = new URLLoader(); var xmlReq:URLRequest = new URLRequest("data.xml"); xmlLoader.load(xmlReq); var background:bkg; var textvar:TextField = new...

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
If I have a multidimentional array, how can I acsess only the first value of the first dimention. I will Explain: sampleArray=new Array[]; sampleArray[0]=["Nouns","Adjectives","Verbs"]; sampleArray[1]=["Colors","Time","Sound]; sampleArray[0][0]=["Person","Place","Thing"] I would just like to get the word Nouns but when I try to get the value ofsampleArray[0][0] it will just result Person, Place,...

ArcusNode Cannot set property '1' of undefined

node.js,actionscript,rtmfp
My problem is the one discribed in this issue - https://github.com/OpenRTMFP/ArcusNode/issues/5 ArcusNode is dumping the same error for me when I try to stream video to client with RTMFP. The streamer part is in this repository: https://github.com/JanisGruzis/RtmfpStreamer The receiver part is in this repository: https://github.com/JanisGruzis/RtmfpVideoPlayer Those are FDT ActionScript projects....

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

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) ...

Linking two arrays in Actionscript 3

arrays,actionscript-3,flash,actionscript
Very new to actionscript, Im trying to link two arrays. Basically I have a word array of 8 words and I have a movie clip array of 8 movieclips. My aim is to link the two arrays so that the user must click the right movie clip that matches the...

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
I can't seem to find an answer for this anywhere online, but this for loop, although seemingly valid, creates an infinite loop because actionscript does not seem to recognize 0.1, 0.2, 0.3, and so on. This for loop will just trace 0, 0, 0, and so on infinitely. Can anyone...

How can I remove duplicate names?

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...

UILoader cover background in ActionScript 3

actionscript-3,flash,background,actionscript,uiloader
I'm using ActionScript 3 and the UILoader component to show a .jpg image. I would like a "covered background" result, like the css property : background-size : cover; I tested the parameter scaleContent (true or false): uilBackground.scaleContent = true; But the result is not a true "covered background". I think...

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

arrays,flash,object,actionscript
In Java it is possible to set the datatype of an array, and by setting the datatype to the object I am using, I can call the methods and variables of that object. For instance: ArrayList<Object> name = new ArrayList<Object>(); name.add(new Object(variables)); name.get(0).method; Is there any way I can do...

How to use string in path to object?

actionscript,actionscript-2
I need to use string in path to object. var nameOfTrails:String = "trail"+this.getDepth(); _parent.createEmptyMovieClip(nameOfTrails,this.getDepth()+1); _parent.nameOfTrails.beginFill(FillColor,FillAlpha); How to do this in ActionScript 2.0?...

Move a character in flash randomly

flash,actionscript
I have a character imported to my stage, but I want a button called "Random" that when hit, moves the character either up down left or right, every time you click it. Here's what I tried, but the character will just move diagonally. //import the code to use the components...

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

actionscript-3,flash,button,actionscript
I am trying to make a button in ActionScript 3.0 that, when clicked, displays a text field that contains three paragraphs of text. I have a dynamic text field named textField. I have a button on stage named learn_button. import flash.events.MouseEvent; import flash.display.DisplayObjectContainer; import flash.text.TextField; learn_button.addEventListener(MouseEvent.CLICK, onButtonClick); function onButtonClick(e:MouseEvent):void {...

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
I've got a method that accepts a parameter of type Class, and I want to only accept classes that extend SuperClass. Right now, all I can figure out to do is this, which does a run-time check on an instance: public function careless(SomeClass:Class):void { var instance:SomeClass = new SomeClass(); if...

Play video files online sequentially without delay/buffering between videos

html5,flash,video,actionscript,ffmpeg
Is it possible to play video online that's made of two or more video files? Since my original post wasn't clear enough, here's expanded explanation and question. My site is hosted on Linux/Apache/PHP server. I have video files in FLV/F4V format. I can also convert them to other available formats...

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

javascript,math,actionscript
I am using this JavaScript/ActionScript code to figure out the angle given two x and y values but it is incorrect: var deltaX = 10; var deltaY = -10; var angleInDegrees:int = -(Math.atan2(deltaY, deltaX) * 180 / Math.PI); trace(angleInDegrees); // 45' The results at a different points: clock x y...

Get dispatchEvent data as a result

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...

Ways to incorporate dynamic update in flash cc

javascript,flash,actionscript,adobe
Currently i'm working on a flash game where i want a certain value to appear on the right side when the user types in a value on the left side. Where the default amount is 0 and when the person types a number, the price(on the right will update accordingly....

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

java,android,flash,actionscript
I heard that making calculations in the GUI thread is a bad idea, so what I've thinked about is this: float someX; float someY; Thread t = new Thread(new Runnable() { //making calculations here, setting someX, someY }) this.runOnUiThread(new Runnable() { setX(someX); setY(someY); }); thus they are working parallel AND...

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

arrays,actionscript-3,flash,actionscript
Right now I'm trying to make a game with dozens of the same, identical block being on stage and when the player hits the block, it stops. Right now, I've figured out how, using arrays, I can create multiple versions of the block automatically in code and place them on...

Get textinput number of character in Flex

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)"/>...

Displaying the total sum of values from strings

string,actionscript-3,flash,actionscript,flash-cs5
My project is a simple shopping game where the user types in the quantity amount, and the value of the individual prices appears and then a total sum can appear below. I have managed to create the part of displaying the individual product price but i am confused on how...

Action Script 3.0 - MouseEvent Listener + function issues

actionscript-3,flash,actionscript,mouseevent
I'm working on a project that has multiple clickable objects on the stage. However, when I create the following function, I getting the last defined eventlistener . // Event listeners antwoordBox1.addEventListener(MouseEvent.CLICK, antwoordboxclick); antwoordBox2.addEventListener(MouseEvent.CLICK, antwoordboxclick); function antwoordboxclick(event:MouseEvent):void { trace (event.currentTarget.name); // traces 'antwoordBox2' , whether I click any of the buttons....

How to check what is inside an input textbox in Adobe Flash CS5.5

flash,actionscript,actionscript-2
I am making a game with multiple levels in flash and I want to have it where each level has its own 4 digit code, which can be used to return to that level. I have created an input textbox, and a button. If I want it to run the...

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
I have a background image that extends the stage, top and bottom, that's position is controlled by key presses which tweens the image. I want to stop the edge of the image at the top or bottom of the stage depending on which way the image is moving. I want...

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

actionscript-3,flash,flex,actionscript
Trying to figure out why I can call this function from a instantiated version of this class. The error I get is this: Error: Call to a possibly undefined method getRegionNameForCountries through a reference with static type com.framework.model:CountryModel. The error comes from this code: public static function territoriesFunction( item:Object, column:DataGridColumn...