actionscript-3

Flex to HTML5 - what for presentation layer (canvas, div, ???)

天涯浪子 提交于 2019-12-24 02:00:43
问题 My question is about migration from Flex3 to HTML5. I want do migrate myself not application actually. The question is, what direction is the best and most similar to flex knowledge. Maybe I will reimplement some custom components I already have in my flex library. I think that some of useful flex components I will have to implement myself in HTML5 - e.g. AdvancedDataGrid or Tree. Now I can see 2 possibilities: assume page (or big DIV) as application master class, and implement other

Display unicode character in Actionscript

这一生的挚爱 提交于 2019-12-24 02:00:10
问题 I have the following unicode for a char: 0x023D2A How do I display it using: textField.text = ???; I have have the name of the character. Can I reference it by name? 回答1: Try this: textField.text = String.fromCharCode(0x023D2A) 回答2: textField.text = "Adobe\u00ae" should give you "Adobe®". Replace your Unicode as required. (Note: I don't have Flash with me where I am; I am posting the above untested.) 回答3: Tested whybird's syntax: it works. You can use \u plus the unicode value in hex inside

How can pause / play embed sound in AS3 flash

北慕城南 提交于 2019-12-24 01:58:19
问题 I have a sound with a length of 1:30 min. I embedded it into my swf and set it to sync with the frame. I need is to be able to pause and play this sound via ActionScript. Does anyone have any idea how to do this? 回答1: //number that is redefined when the pause button is hit var pausePoint:Number = 0.00; //a true or false value that is used to check whether the sound is currently playing var isPlaying:Boolean; //think of the soundchannel as a speaker system and the sound as an mp3 player var

How to access stage in a class that is not a DisplayObject?

久未见 提交于 2019-12-24 01:57:30
问题 How do I access the stage in Actionscript 3 in a class which is not my main class and not a displayobject? 回答1: the easiest way is to use a global object http://github.com/inruntime/AS3-Global-Object this page has examples of how to set and retrieve objects from any class. 回答2: The easy way, you can keep it in a static var for example: public class MyMain extends Sprite { public static var STAGE:Stage; public function MyMain() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE,

Flash AS3 Crossdomain bypass issue

回眸只為那壹抹淺笑 提交于 2019-12-24 01:56:10
问题 I'm currently hosting a flash game on my website which is https: . I've added a crossdomain file that specifies I only allow access from this website that my flash application is hosted on. If I download the swf file and try to run it from my local computer, it wont let me (which is what I wanted), however, if i go to flash -> global settings -> Advanced -> trusted location settings , and add the file that I've downloaded to the trusted locations, It will ignore the crossdomain and let me

Download/Save/Write a file on the client's hard disk using flash/flex

自古美人都是妖i 提交于 2019-12-24 01:44:07
问题 I wonder how can I download/save/write a file from my server to a client's computer using flash or flex. An example of what I'm looking for is avilable on http://www.flexdownloads.com Sign up Sign in Click on the ("FREE") button placed on the right of the page. (the orange button) Choose any product (won't cost you anything) Press "BUY NOW" then you'll see a confirmation popup for the download, then you choose where do you want to save the file, and the flash movie saves the file! 回答1: Use

Prevent certain child(ren) from affecting MouseEvent hitbox

不打扰是莪最后的温柔 提交于 2019-12-24 01:39:30
问题 I've got a movieclip that I'm using as a button. Within this movieclip is a large shadow that shows when the button is moused over. My problem is that this shadow is effecting the mouseovers and causing a much larger "catch" area for the mouseOver and mouseOut events than I want. I've tried disabling mouse events on that child and as many combinations of mouseEnabled and mouseChildren I can think of. Is it possible to prevent certain elements effecting the mouseover properties of it's parent,

Applying blur filter to BitmapData

≯℡__Kan透↙ 提交于 2019-12-24 01:19:51
问题 Here's the code I am using to blur an image using BitmapData. The function is called on a Slider_changeHandler(event:Event):void event and the value of the slider is passed to the function as blurvalue. The problem is the function works but seems to be cummalative (if that's the correct word!), that is, suppose I slide it to the maximum and after that try to reduce the blur by sliding it back towards the front the blur still keeps increasing. How do I make it to work so when I will slide it

actionscript 3 stretching and rotating a movieclip arrow with drag

﹥>﹥吖頭↗ 提交于 2019-12-24 01:17:07
问题 I am quite new to actionscript, and a bit stuck now. I am trying to make an arrow that is fixed at one end, but the pointy end should be draggable with mouse drag, thus streching and rotating the arrow. It would be also great if I could keep the triangle tip of the arrow from changing size while dragging it. I thought about making a movieclip composed of the tip and of the line separately, the line doing all the "stretching" while the tip simply follows around. I am just not sure how. Most of

How to change the pixels in an image

China☆狼群 提交于 2019-12-24 01:07:25
问题 i actually try to do the following: I have loaded an external image in a bitmapdata object and create a bitmap from it which i attach it to a sprite/MovieClip in order to have mouse events on it. Now under the previous logic i loaded two images (let's say circles) of the same size one that has a particular color and is covered by its black foreground circle. When i press left mouse button and hold it down i want while the mouse is moved to erase the foreground circle's pixels and so the