actionscript-3

Filtering data in an array.

Hi all, I have an array that has 30 date objects. The date objects are indexed in the array from the minimum date value to the maximum date value. What I would like to do is retrieve only 7 dates from the array. Out of the 7, the first one should be the minDate and the last should be the maxDate, with 5 dates in the middle. The 7 number...

comparable function to print_r in as3

In php we have the method print_r(). Is there anything similar in as3 to print out an object/array? ...

Adobe Air: Is it possible to save files to a network path (osx)

I was wondering if it would be possible to write a file, not to the local system, but to a connected server or other network path. Would i have to use an external php interface for this or can i entrust this to the AIR framework? I'm pretty sure that AIR has certain security precautions to prevent this. Thanks a bunch! Regards ...

looping through object property names in actionscript

I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this obj...

Adding time zone hours difference to time

I know there's a much better and correct way to do it, but i need a temporarily solutions. I need to add in extra hours to the time, and the day will change automatically too. How should I change the code below? package { public class getTime { private var today:Date=new Date(); private var hour:uint=today.getHours(); privat...

Changing the background color and border color on selection on a tilelist??

Hi friends , I am using a tilelist I want to change the border color and the background color of the tile on selection. Is it possible ???? Thanks in advance Prashant ...

In ActionScript, Is there a way to check if an input argument is a valid Vector of any type?

In the following code: var a:Vector.<int> ... var b:Vector.<String> ... var c:Vector.<uint> ... var c:Vector.<MyOwnClass> ... function verifyArrayLike(arr:*):Boolean { return (arr is Array || arr is Vector) } verifyArrayLike(a); verifyArrayLike(b); ... What I'm looking for is something like _var is Vector.<*> But Vector.<*> is n...

Providing raw MP3/AAC data to Flex/Flash from a custom container

Having had a quick look at the Flex docs I can't seem to find any reference to providing audio content to be played from a custom (possibly encrypted - don't worry, it's not that evil) container format. Is this possible and if so, could someone point me in the right direction. Or if that's not possible, some way to hook into the disk/ne...

Is it possible to move the stage in actionscript 3.0?

Hi to keep it short and simple let's say I have a stage with 400x400 size in pixels, but I've drawn a map of 1000x1000 size in pixels. I want my player to be able to "walk" about the stage, but it appears stage.x and stage.y are read-only? Is there any method or way to have the stage "scroll" about, without having to move each object o...

Basic help with DataGrid

Hello, I want to get data from mysql db, slightly change it and display in datagrid. Mysql data is like this: Id | data | privateData I am getting it using AMFPHP. I dont want privateData to show in datagrid (but i still want to use it in program). I want to add button to every row of datagrid (clicking it should call function with param...

flash movie plays itself when you call any, even unnamed, function in the bytesLoaded==bytesTotal if clause

I actually don't need help, i just want to know your opinion about that weird Flash CS4 (AS3) behavior. there should be something i missed. 1) what happens: flash movie plays on any (even non-existent) function call between if(bytesLoaded==bytesTotal), and doesnot play on commented-out or blank line there. 2) what should be seen instead...

Delays in ActionScript (Flash)? Alternatives to setInterval

While setInterval is handy, it's kind of limiting. Every time I want to add a Tween I have to add a new method. I do not want to alter the structure of my code just to add in some delays. Isn't there any way to say this without making methods for A and B? // do A // wait N seconds // do B I don't want to use a while loop with Dates be...

link in SWF should open a new page, but doesn't

Hi, I have some images floating around in my SWF. The SWF holds several buttons, linked to those pics etc. The buttons have actions: on(release) { getURL("http://domain.com/sub/folder/page.html/"); } When clicking on the image I would like a new page to open in which the link is executed. How come the current code isn't working? thank...

PBE: (Tutorial2) Problem with spatialManager variable

Hi! I've just started with PBE. Now trying to follow few first tutorials. Have problem with the second one(http://pushbuttonengine.com/docs/Lesson-02.html). E.g. this line of code: spatial.spatialManager = PBE.spatialManager; throws the: Attempted access of inaccessible property spatialManager through a reference with static type Clas...

Flex special characters not embedding

Hi, I am using the following code to embed Arial into my application: [Embed(source='../assets/fonts/Arial.ttf',fontFamily='CustomFont',fontWeight='regular', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+2...

Preloader stalling flash movie in IE

This is only a problem in IE. the following actionscript is for a simple preloader for a movie i'm working on. It works fine in Firefox but the movie stops on the first frame of the preloader when opened with Internet Explorer. Has anyone had this problem before? stop(); addEventListener(Event.ENTER_FRAME,checkLoad); function checkLoa...

Aligning Movieclip with root/stage Movieclip

How do you align a dynamic movie clip position with another movie clip which is in the root stage? I tried to get the mc in root x,y position, but the starting point of the class that loads the dynamic MC does not seems to be accurate. (Meaning at the root stage, the x,y is 0,0 but at the dynamic class, its somewhere like 100,20 for the ...

Can't use static const as param in function call within binding tags in Flex 3

I'm having a problem in flex 3 where if a static const I have defined is used as the parameter to a function call within binding tags I get a "1120: Access of undefined property NodePropertyMatrix". _propMtx is a ArrayCollection. <mx:HBox visible="{_propMtx.getItemAt(NodePropertyMatrix.srcParent)}"> Above code throws the error, but th...

[FLEX] Images won't dynamically refresh

I am writing a Flex application to receive xml from an httpservice. That works because I can populate a datagrid with the information. The xml sends image pathnames. A combobox sends a new HttpService call onChange. This repopulates the datagrid and puts new images in the folder that flex is accessing. I want to dynamically change the i...

trigger animation, if else conditions, as3

How do I trigger the animation in sync with my timer?My timer and flip animation work, but they are out of sync with each other. I'm lost with the IF ELSE statements. Each time the value of my textfield changes, my number needs to flip. See example. Example //IF ELSE FUNCTION function theFlip(event:TimerEvent):void { count++; if (count...