actionscript-3

Flash/ActionScript: Draw a display object “onto” another

依然范特西╮ 提交于 2019-12-22 01:43:36
问题 How do I properly draw one vector object onto a specific position of another in ActionScript, accounting for positioning, transparency, etc? My idea (as suggested e.g. here) was to use beginBitmapFill () and drawRect () to draw a bitmap copy (made using BitmapData.draw ()) of one MovieClip onto the . graphics property of the other MovieClip, but this proved more difficult than I thought, mainly for these reasons: Transparency is not preserved : where the source MovieClip is transparent, the

Set width/height of a movieclip in AS3

一世执手 提交于 2019-12-22 01:36:12
问题 I have this Player class which is a movieclip, I'm trying to set it's width and height from it and then make it add itself to the stage, But for some reason, no matter what I do, this.width returns 0 and setting the size only works from the parent class.. why is this happening? public class Player extends MovieClip { public var head:MovieClip = new Head_normal_front(); public function Player(stage:Stage){ this.addChild(head); this.width = 10; this.height = 10; stage.addChild(this); } } Thanks

Math.round() wrong calculation in as3?

不问归期 提交于 2019-12-22 00:30:17
问题 Can anyone explain this? what am I doing wrong? 回答1: Math.Round(x:Number) rounds x to the nearest integer value. In your case 28 is the nearest integer value for 28.499999999999996. So here the behavior is correct. What is weird is that 0.285 * 100 is not 28.5, but that is a consequence of the precision of the Number class in as3. Here is a little more information about this and a possible solution: Innacurate math results Also you can see this SO question: Very strange number operation issue

RegEx to modify urls in htmlText as3

房东的猫 提交于 2019-12-22 00:22:58
问题 I have some html text that I set into a TextField in flash. I want to highlight links ( either in a different colour, either just by using underline and make sure the link target is set to "_blank". I am really bad at RegEx. I found a handy expression on RegExr : </?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?> but I couldn't use it. What I will be dealing with is this: <a href="http://randomwebsite.web" /> I will need to do a String.replace() to get something like this: <u><a

Dynamically Creating Flex Components In ActionScript

你说的曾经没有我的故事 提交于 2019-12-22 00:15:24
问题 Isn't there some way to re-write the following code, such that I don't need a gigantic switch statement with every conceivable type? Also, if I can replace the switch statement with some way to dynamically create new controls, then I can make the code smaller, more direct, and don't have to anticipate the possibility of custom control types. Before: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> <![CDATA[

Adobe AIR SharedObject - Android/iOS - On update not found

孤街浪徒 提交于 2019-12-21 23:47:45
问题 As the title states, my user's on iOS and Android are reporting their save data has been deleted when I push an update to the respected storefronts. The game saves and restores data properly on application load and exit. I have not changed any save information locations or package names... Just mere bug fixes, build, push. Any clarification would be helpful, or proposed redundant data backup scheme's I should pursue to ensure the end-user experience is from henceforth not affected negatively.

as3 video full screen mode

丶灬走出姿态 提交于 2019-12-21 22:37:35
问题 I have created a video player, but need to add a button that, when clicked, puts the video into full-screen viewing mode. I don't want to scale everything on the stage - just the video. I can't seem to find how to do this - I thought it would be easy. 回答1: See if this works: stage.displayState = StageDisplayState.FULL_SCREEN; videoPlayer.x = 0; videoPlayer.y = 0; //save the width and height in temp vars //for restoring them later. videoPlayer.width = stage.fullScreenWidth; videoPlayer.height

FlashDevelop - training materials, tutorials, books (Flex/Flash development without FlexBuilder) [closed]

给你一囗甜甜゛ 提交于 2019-12-21 21:49:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to start Flash/Flex/ActionScript development and got lost with the technologies, documentation and tools available. Searches pointed me to Adobe FlexBuilder and Adobe Flash (Designer, CS3, CS4). Then, I found FlashDevelop, learned that Flex SDK and compilers are free. Also, you can make a complete Flash

Send JSON from Flash to PHP

无人久伴 提交于 2019-12-21 21:34:09
问题 I'm trying to send array of data from Flash to PHP to sending e-mail. I'd like to do that because I must change the php page everytime my form site changes because of client's choice. My answer is, can I send an array of objects like this to php? var message:Array = new Array (); message.push ({field_name:"Name", value:"John Lennon"}); message.push ({field_name:"e-mail", value:"john@beat-less.com"}); message.push ({field_name:"Message", value:"Hello goodbye"}); so, PHP should recive a string

How can I draw dotted line in flex

℡╲_俬逩灬. 提交于 2019-12-21 20:47:57
问题 After some search and reading the Graphics class document, I can't find a way to specify the line style of a line. I mean whether the line is a solid one or a dotted one. Could anybody help me? Thanks! 回答1: Well there is no Dashed or Dotted line in flex. However, you can create your own line or border: http://cookbooks.adobe.com/post_Creating_a_dashed_line_custom_border_with_dash_and-13286.html Try and enjoy! 回答2: You can't, well, not just by using Flex library classes anyway. You can do it