actionscript

Flex : Is it possible to stop a remote call?

孤人 提交于 2019-12-01 11:41:44
I search for a long time, but I still not found the answer. In common case, we keep the token of a remote method call, Flex -> Java for example. But, if the client know that the current call is not needed anymore, how stopping the server processing ? With an asyncToken, is it possible to stop a remote call ? Thanks for your answer. As I understood it, an AsyncToken just provides extra data for some operation. You'll need to access that operation to cancel. IF you're calling an HTTPService , you use the cancel() method. If you're using a WebService , you should be able to call getOperation()

Flex/Flash Shoutcast player

被刻印的时光 ゝ 提交于 2019-12-01 10:58:25
I am trying to build a flash player for my company's Shoutcast server, and have seen a few articles about it on the 'net, including this SO question here . However, I can't seem to get the audio stream to actually play. It seems to be connecting alright, but calling stream.play() doesn't seem to do anything. I have tried the code in the SO question I have linked to, and have also tried something similar to this (sorry i don't remember the exact syntax): public function stream() { private var url:URLREQUEST = "my.domain.com"; private var sStream:Sound = new Sound(); sStream.load(url); sStream

AS3/AIR: If phone use portrait, if tablet use landscape?

末鹿安然 提交于 2019-12-01 09:56:01
问题 Ok, I've written myself a simple DeviceCapabilites class to be able to check if the device is a phone or tablet etc. But I need to be able to say that if the user is on a phone, it should be in portrait mode, and if on tablet I only wanna use landscape mode... Any ideas? EDIT: To make it clear, I want to lock the orientation to portrait mode on phones and then use landscape on tablets. 回答1: Something like this? stage.autoOrients = false; if(YourDeviceCapsClass.isTablet) stage.setOrientation

Pass arguments from an array to an Actionscript method with …(rest) argument

核能气质少年 提交于 2019-12-01 09:14:27
my question is the Flex transposition of this question : Can I pass an array as arguments to a method with variable arguments in Java? That is, I have an Array in some Actionscript code and i need to pass every object indexed in the array into a method method(...arguments) . Some code to make it clear: private function mainMethod():void{ var myArray:Array = new Array("1", "2", "3"); // Call calledMethod and give it "1", "2" and "3" as arguments } private function calledMethod(...arguments):void{ for each (argument:Object in arguments) trace(argument); } Is there some way to do what the comment

Flex/Flash Shoutcast player

故事扮演 提交于 2019-12-01 09:08:28
问题 I am trying to build a flash player for my company's Shoutcast server, and have seen a few articles about it on the 'net, including this SO question here. However, I can't seem to get the audio stream to actually play. It seems to be connecting alright, but calling stream.play() doesn't seem to do anything. I have tried the code in the SO question I have linked to, and have also tried something similar to this (sorry i don't remember the exact syntax): public function stream() { private var

Multithreading or green threading in actionscript?

删除回忆录丶 提交于 2019-12-01 08:25:06
I was wondering if there are any code or class libraries out there on how to implement multithreading or "green threading" in ActionScript. As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago event. Regards Niclas Here's a Green Threading lib from Drew Cummins: http://blog.generalrelativity.org/?p=29 There's no built-in way to do green threading in ActionScript. You have to write code to handle it. Make a function that performs one iteration of whatever operation you want to do.

Where can I find a yacc grammar for ECMAscript/Actionscript/Javascript [closed]

回眸只為那壹抹淺笑 提交于 2019-12-01 08:04:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . My compilers class requires us to find a yacc grammar for one of these languages and combine it with the tokenizer we wrote. Presumably this is something easy to Google but I can't find it and my classmates are

flash as3 - how do I find an object's index in an array

时光怂恿深爱的人放手 提交于 2019-12-01 07:39:42
how do you find an object's index / position within an array in flash actionscript 3? I am trying to set a conditional up in a loop where, if an object's id is equal to the current_item variable, I can return its position within the array. Something like this might help you - this example returns the position of the value 7: private var _testArray:Array = new Array(5, 6, 7, 8, 9, 8, 7, 6); public function ArrayTest() { trace (_testArray.indexOf(7)); //Should output 2 } so for your needs: item variableToLookFor = 9 // Your variable here private var _testArray:Array = new Array(5, 6, 7, 8, 9, 8,

Ruby-like Question: Make this function shorter (ActionScript 3)

孤街浪徒 提交于 2019-12-01 06:49:07
I just wrote this incredibly verbose code to turn numbers like 2 into 02. Can you make this function shorter, please (maintaning the functionality)? public static function format(n:int, minimumLength:int):String { var retVal:String = n.toString(); var stillNeed:int = minimumLength - retVal.length; for (var i:int = 0; i < stillNeed; i++) { retVal = "0" + retVal; } return retVal; } Please use types for variables. Extra points (good-vibe points, not SO points) if there's already a built-in function that I don't know about. If anybody wants to post some extremely short equivalent in some other

Flash trace output in firefox, linux

不羁的心 提交于 2019-12-01 06:47:30
I'm developing an applications which I've got running on a server on my linux desktop. Due to the shortcomings of Flash on Linux (read: too hard) I'm developing the (small) flash portion of the app in Windows, which means there's a lot of frustrating back and forth. Now I'm trying to capture the output of the flash portion using flash tracer and that is proving very difficult also. Is there any other way I could monitor the output of trace on linux? Thanks... Hope this helps too (for the sake of google search i came from): In order to do trace, you need the debugger version of Flash Player