actionscript-3

Sending ByteArray through as3 to PHP

送分小仙女□ 提交于 2019-12-13 04:55:29
问题 The BLOB field (pic) is turning out as 0 Bytes when trying to send ByteArray through as3 to PHP, so i assume the PHP script or the HTTP_RAW_POST_DATA isn't working. I think the Flash part is working, I have set a trace() to see if the bitmapdata is coming through and it seems it is, so I'm assuming its my php side. I'll post both parts of the code in hope someone here can fix it for me. Thanks. AS3 private function export():void { var bmd:BitmapData = new BitmapData(600, 290); bmd.draw(board)

Can there be multiple rendering worker threads

痴心易碎 提交于 2019-12-13 04:51:38
问题 I've recently come across the Worker & WorkerDomain classes available to AS3, however there doesn't seem any mention of how each thread interacts with whats being rendered on screen. Is there a way to render to the screen on one thread, then after an event switch rendering to the other thread? My initial assumption is threads apart from the "Primordial" thread should only be used for background processing, but I'm hoping that may not be the case. 来源: https://stackoverflow.com/questions

Character boundaries of text field based on parent

▼魔方 西西 提交于 2019-12-13 04:47:50
问题 I have a text field inside a container. I'm wondering is it possible to find the boundaries of each character based on the container and not the text field. Here is a sample screen shot: And normal state would be like this: With this I can find the bounds of each character based on text field, But I need it based on the container: var rect:Rectangle = new Rectangle(); for (var i:int = 0; i < textField.length; i++){ rect = textField.getCharBoundaries(i); } Is there anybody whom has an

Fire event from one object to notify end of frame

筅森魡賤 提交于 2019-12-13 04:47:28
问题 I am relatively new to AS and want to know how I can notify that an object I imported has reached it's final frame. Basically I want to create a .fla with a class file maybe and import the .swf as a movieclip in an other fla and maybe have multiple instances of that imported movieclip. Now I would like to know how I can get notified that one instance of the imported movieclip has reached the final frame. Thank you 回答1: You can fire event with dispatchEvent(new Event("eventname")) . Write

I have a var in as3 and I want to get its name in a string

老子叫甜甜 提交于 2019-12-13 04:45:48
问题 Example: public var myVar:Object; // now I want to get the myVar string // myVar is not instanced* public var whatINeedIsThisVar:String = 'myVar'; thanks 回答1: There is no way to do that, and when you are working in release mode (i.e. not debuuging a swf) local variable name didn't exist anymore. But if it's a public field name of a class you can use describeType to found the name. package { import flash.utils.describeType; class Foo extends Sprite { public var bar:Object; function Foo(){

Get a ByteArray from BitmapData in AS3

若如初见. 提交于 2019-12-13 04:45:21
问题 I would like to get a ByteArray from a BitmapData in AS3. I tried the following: var ba:ByteArray = myBitmapData.getPixels(0,0); It didn't work and I got this error ArgumentError: Error #1063: Argument count mismatch on flash.display::BitmapData/getPixels(). Expected 1, got 2. : 回答1: As Adobe said about BitmapData.getPixels : " Generates a byte array from a rectangular region of pixel data... ", so your parameter should be a Rectangle object. Take this example from Adobe.com : import flash

Garbage collection question (display list + actionscript)

旧时模样 提交于 2019-12-13 04:42:53
问题 If I add an object that extends a MovieClip or a Sprite to the stage, and I remove that object from the stage, do I need a destroy method if: There aren't any event listeners attached to that object I added display objects to that object? (obj.addChild(whatever) --> do I need to remove "whatever" when I remove object from the display list or is that redundant?) Any instance variables associated with that object - do I need to null those? 回答1: If you remove all references to a parent object,

Can the ENTER_FRAME event be missed or received delayed by the listener?

你离开我真会死。 提交于 2019-12-13 04:41:12
问题 Is ENTER_FRAME always received, even if another process occupies the CPU, OR the listener might miss one or more ENTER_FRAME events -then receive several of those events delayed in a batch as usually happens in Windows? (I'm using pure AS3 and Stage3D with 3D GPU rendering -no 2D display objects, Flash timeline, movieclips etc). 回答1: ENTER_FRAME depends on frame rate. And frame rate is not a constant - it depends on a lot of factors, few of which are CPU and GPU. The listener won't miss

flex-iframe error: This content cannot be displayed in a frame

僤鯓⒐⒋嵵緔 提交于 2019-12-13 04:40:00
问题 I have a simple flex application that I created for testing. I download "flex-iframe-1.4.6.zip" library and using this library I am trying to display a url. But it does not show the web page instead it shows an error: "This content cannot be displayed in a frame". <flexiframe:IFrame id="mapIFrame" visible="true" source="http://www.google.com" width="500" height="500" label="Google"/> How can I solve this problem? 回答1: The message "This content cannot be displayed in a frame" is coming from

flash Actionscript 3 and php image upload

我的未来我决定 提交于 2019-12-13 04:39:50
问题 recently i am going through a project of badge-builder with action-script and flash.now i need some help for image uploading from the flash interface to the server and showing it back in the flash interface, the back-end programing language is php and i am using action-scrip 3 and flash cs5 can anyone please give me a right direction how to achieve this job. Thank you very much. 回答1: Here is the AS3 code, it's just some quick and dirty timeline code: var fileRef:FileReference = new