actionscript-3

Using StageWebView.loadString() to display Google Maps on AIR for iOS

余生长醉 提交于 2020-01-11 14:26:10
问题 I'm trying to use a StageWebView to display a Google Maps map generated using the Javascript API. Is there a reason why it won't render on iOS? It works on Android and in the AIR simulator, but not on iOS devices. I can view the HTML generated in Safari, too, which makes it even odder. Example HTML (I am dynamically generating this in-app, not that it matters): <!DOCTYPE HTML> <html style="width:100%; height:100%; margin: 0; padding: 0;"> <head> <title></title> <script src="https://maps

Bitmap too big as3

强颜欢笑 提交于 2020-01-11 13:30:12
问题 In AS3, I am loading a png from a zip file (nochump's zip library through ByteArray to Loader). The png can be up to 45k pixels wide but only 120 tall. This creates a problem in flash, as images can only be ~8000 pixels wide. A possible solution would be to split the images into 6 columns somehow. This would probably need to be done in the ByteArray state, because the limitation is in Bitmap and Loader. Would this even be possible? 回答1: I believe you should use Alchemy to decode such a large

Clarifications regarding weak references in actionscript listeners

旧时模样 提交于 2020-01-11 12:36:11
问题 I understand how weak references work, but I am bit confused regarding it's use in actionscript event listeners. Consider the example below: public class Rectangle extends MovieClip { public function Rectangle() { var screen:Shape=new Shape(); screen.addEventListener(MouseEvent.MOUSE_OUT, new Foo().listen, false, 0, true); addChild(screen); } } public class Foo extends MovieClip { public function listen(e:MouseEvent):void { trace("tracing"); } } Now here, since there is only a weak reference

JPEG encoder super slow, how to Optimize it?

可紊 提交于 2020-01-11 09:52:57
问题 I'm building an App with actionscript 3.0 in my Flash builder. This is a followup question this question. I need to upload the bytearray to my server, but the function i use to convert the bitmapdata to a ByteArray is super slow, So slow it freezes up my mobile device. my code is as follows: var jpgenc:JPEGEncoder = new JPEGEncoder(50); trace('encode'); //encode the bitmapdata object and keep the encoded ByteArray var imgByteArray:ByteArray = jpgenc.encode(bitmap); temp2 = File

JPEG encoder super slow, how to Optimize it?

别来无恙 提交于 2020-01-11 09:51:30
问题 I'm building an App with actionscript 3.0 in my Flash builder. This is a followup question this question. I need to upload the bytearray to my server, but the function i use to convert the bitmapdata to a ByteArray is super slow, So slow it freezes up my mobile device. my code is as follows: var jpgenc:JPEGEncoder = new JPEGEncoder(50); trace('encode'); //encode the bitmapdata object and keep the encoded ByteArray var imgByteArray:ByteArray = jpgenc.encode(bitmap); temp2 = File

Security Sandbox Violation: Lack of Policy File Permissions

混江龙づ霸主 提交于 2020-01-11 09:35:09
问题 I'm using as3httpclientlib to post data to my web service, but I'm continually getting the following security violation. Does anyone know how to resolve this? My crossdomain.xml file is below the security violation notice. NOTE: I'm using apache to proxy requests to the web service, therefore the target url/port and the url/port serving the applet are the same -- i.e. http://192.168.100.101 . Also, the crossdomain.xml file is located in the root of the web app which serves the applet rather

AS3 - gotoAndStop with immediate action

删除回忆录丶 提交于 2020-01-11 09:03:25
问题 I'm moving from AS2 to AS3 and probably as many ppl before found this incompatibility: I used quite often code like: gotoAndStop(5); trace(box); //where box is a movie on 5th frame What is the easiest way how to do it in AS3. 回答1: There is an easy way to solve this, but it is undocumented: addFrameScript(1, update); gotoAndStop(2); function update() { trace(box); // outputs [object MovieClip] } Please note that the first argument for addFrameScript is the frame number but it's 0-based, i.e. 0

How do I access flashvars in AS3, and add them to an existing text field?

情到浓时终转凉″ 提交于 2020-01-11 08:56:12
问题 Edit: I've come to realize the main problem I'm facing is that I want a text field that already exists in a movieclip or on the stage to take the string from a flashvar. For some reason it will not do that. How do I make a pre-existing text field change to match the flashvar text? Html: <div id="flashContent"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="29px" id="egnewsTicker" align="middle"> <param name="movie" value="egnewsTicker.swf" /> <param name=

Flash ActionScript 3 capabilities lacking in ActionScript 2

我的未来我决定 提交于 2020-01-11 07:32:08
问题 Ever since Adobe introduced ActionScript 3 with Flash Player 9, many of us have been slow to switch over. In short I'd like to know what AS3 as a framework can do, that is simply impossible or significantly difficult in AS2. I'm not talking about readymade components, but built-in classes such as for web remoting, binary data manipulation, XML handling, etc. 回答1: well, actually, AS3 is a language, not a framework ... the flash player API has framework like traits ... but ok, let's not argue

implementing singleton class for Actionscript

一曲冷凌霜 提交于 2020-01-11 07:24:18
问题 I know actionscript does not allowed private contstructor at any time and But if i want to write a sinlgleton class in action script So how to implement it in actionscript. Can anyone provide an sample example of a singleton pattern in actionscript? 回答1: I use something like this: package singletons { [Bindable] public class MySingleton { private static var _instance:MySingleton; public function MySingleton(e:Enforcer) { if(e == null) { throw new Error("Hey! You can't do that! Call