actionscript

Adobe Air - get device name (such as EVO, DROID X..)

心不动则不痛 提交于 2019-12-01 22:43:32
I'm working in Actionscript in Adobe Air, and I want to get a device's model name, such as 'EVO' or 'DROID X'. Has anyone been able to do this? Thanks. Capabilities.os and Capabilities.manufacturer are probably sufficient for identifying an iOS device (iPhone, iPod, iPad, as well as their generation). On Android, the platform you specified, these properties are too general. In my testing, manufacturer is "Android Linux" and os is "Linux" plus numbers indicating the exact Linux version. This is enough for your code to recognize it's running on Android but little else. To access device name on

Differentiate between F5 and browser close event in flex/actionscript

跟風遠走 提交于 2019-12-01 22:31:22
I am using the following piece of code to determine the closure of browser window and it works perfectly. But the issue arises when the user refreshes the page using "F5" or clicking browser refresh button and even in that case the same piece of code is invoked. I would like to know if there is anyway by which i can distinguish between browser close event and refresh event using actionscript package utils { import flash.external.ExternalInterface; public class ExternalInterfaceUtil { public static function addExternalEventListener( qualifiedEventName:String, callback:Function,callBackAlias

Uploading bytearray via URLRequest

淺唱寂寞╮ 提交于 2019-12-01 22:18:19
I'm trying to upload a bytearray, but am struggling to make the content-type go as image/png (it always goes as application/octet-stream no matter what I do.). I've checked the request with Charles Proxy, and can confirm that it indeed always goes as application/octet-stream. My code is: protected function onObjectLoaded(event:Event):void { var byteArray:ByteArray = new ByteArray(); var fileName:String = fileReference.name; var uploadPath:String = serviceURL; var parameters:Object = new Object(); parameters.key = serviceKey; fileReference.data.readBytes(byteArray,0,fileReference.data.length);

Uploading bytearray via URLRequest

好久不见. 提交于 2019-12-01 22:00:42
问题 I'm trying to upload a bytearray, but am struggling to make the content-type go as image/png (it always goes as application/octet-stream no matter what I do.). I've checked the request with Charles Proxy, and can confirm that it indeed always goes as application/octet-stream. My code is: protected function onObjectLoaded(event:Event):void { var byteArray:ByteArray = new ByteArray(); var fileName:String = fileReference.name; var uploadPath:String = serviceURL; var parameters:Object = new

How do I make flex only consume mouse scroll and keyboard events when it's useful, and otherwise pass it on to the browser?

我怕爱的太早我们不能终老 提交于 2019-12-01 21:56:17
This one's been irking me for a while. When I'm using the mouse scroll wheel to scroll up and down in a webpage, and a flash movie comes into the path of the cursor, the scroll wheel stops working. Also, when a flash movie has focus, you can't use browser shortcuts like Ctrl + L or Ctrl + R . I'm writing a flex application now and I'd like to find a solution, so that at least my users aren't plagued by this inconsistency of the user interface behavior. I should think there would be a way to tell flash to propagate such events as the mouse scroll wheel and keyboard input back up to the browser

Listen for my Flash event in Javascript

懵懂的女人 提交于 2019-12-01 21:21:52
I'm trying to build a basic video player with a playlist using the OVP Player. So far I have figured out how to feed in the new video source using ExternalInterface, but I can not figure out how to listen for the Flash event "EVENT_END_OF_ITEM". How do I listen for Flash events in Javascript (and thus jQuery)? OVP has a lot of events defined, but I don't know how to listen for them. For example, here is the EVENT_END_OF_ITEM: public function endOfItem():void { sendEvent(EVENT_END_OF_ITEM); } The OVP documentation is non-existent and their support forum is almost as bad. In the Model.as file

AS3 stage = null?

≯℡__Kan透↙ 提交于 2019-12-01 21:02:08
I've just tried to implement a menu system I saw a tutorial onto a game that I'm working on and it was all smooth sailing until I've now encountered a problem with the stage being set to null and I don't know how to stop it. The line that keeps breaking it is in the AvoiderGame.as file and is the stage.addEventListener(Event.ADDED_TO_STAGE, init); it keeps returning the following error TypeError: Error #1009: Cannot access a property or method of a null object reference. at AvoiderGame()[M:\Users\Andy\Documents\Programming For Fun\Flash\Tutorial - Avoider Game\Classes\AvoiderGame.as:29] at

Hide a Button in AS3?

◇◆丶佛笑我妖孽 提交于 2019-12-01 20:55:49
问题 I have a button called myBtn. In my actions in Frame 1, I have tried both: myBtn.visibility = false; myBtn.enabled = false; Both give me the same error: 1120: Access of undefined property myBtn. 回答1: ok. There are a couple of ways that you can do this. The first just involves using the timeline. Method 1 - Timeline Step 1. Go to Window tab, then select components. Drag a Button instance onto the stage. Step 2. In the properties panel, where it says 'Instance Name', replace with "myBtn" (make

Safari WIndows and Transparent Flash

自闭症网瘾萝莉.ら 提交于 2019-12-01 19:02:41
问题 // Edit: The issue now appears to be confined to Safari for Windows. Around the time Safari for Windows 4 came out I started hearing from users that wmode=transparent was no longer working in Safari. I have googled this many times but have not come up with any answers. I have tried reducing interference by using tags as opposed to scripts to embed the Flash but with no success. An example is here: http://hiv411.org/safari.php alternately embedded with script at http://hiv411.org/ All videos

how to kill a setTimeout() function

独自空忆成欢 提交于 2019-12-01 18:42:16
I use the setTimeout() function through my application but when its time to garbage collect. the method still runs and calls on a function. How do I stop it from calling on a certain function. I tried setting it to null but it doesnt work setTimeout returns an reference to the timeout, which you can then use when you call clearTimeout . var myTimeout = setTimeout(...); clearTimeout(myTimeout); See: clearTimeout() I had a similar situation and it drove me crazy for a couple of hours. The answers I found on the net didn't help either but eventually I found that calling System.gc() does the trick