actionscript-3

AS3 create a trail of movieclips following each other

北城以北 提交于 2019-12-14 03:14:11
问题 So, I'm trying to get a few movieclips to follow it's precursor and have the last one follow the mouse. The problem is I'm creating them from code instead of using the interface and, since I'm not an expert, I can't get them to work. All I have in the library is a MovieClip(linkage:"LETRA") which contains a textField inside(instance name:"myTextField"). Here's what I have: import flashx.textLayout.operations.MoveChildrenOperation; import flash.display.MovieClip; import flash.events.Event; /

MXMLC compiler missing filesystem library

陌路散爱 提交于 2019-12-14 03:11:44
问题 I've had not trouble until this point directly from MXMLC command line. While compiling Actionscript 3 code I ran into a dependency problem. import flash.filesystem; and I get Error: Definition flash:filesystem could not be found There are another or two file-related libraries such as filestream. Where can I find these standard libraries and how might I add them to my MXMLC library PATH? 回答1: What are the specific classes you are trying to use? If you want to import all of the classes in the

Flash ‘wMode’, AS3, arrow key focus on Internet Explorer, stacking order and a possible solution

痞子三分冷 提交于 2019-12-14 03:00:35
问题 When ‘wmode’ in instigated and a user is playing a Flash game requiring arrow keys, on Internet Explorer the browser window also moves. Seemingly, the only way round this is to remove the ‘wmode.’ But, if the ‘wmode’ is removed the Flash game rises to the top of the stacking order and all other elements such as expandable banners or dropdown menus go behind the Flash. No amount of iFrames or CSS resolves this issue. I have found a solution that lets the ‘wmode’ remain, whilst also enabling

Make my AS3 code go fetch information on a website that I don't own

我的未来我决定 提交于 2019-12-14 02:53:31
问题 There is this website : http://www.swellmap.co.nz/ and I'd like to make my AS3 code go fetch some infos and displays it flash. Is it possible if I don't own the website ? Exemple : I want to display these infos in my AS3 code. Is this possible ? How can I do ? Thx for your help, EDIT Thx to the full answer of VC.One I've managed to paste infos in a String. Here's what I did : var myString:String; var request:URLRequest = new URLRequest("http://www.swellmap.co.nz/ajr.php?r=plugin&a=Surfing&s

Auto size text field with Actionscript 3

拜拜、爱过 提交于 2019-12-14 02:53:25
问题 I am not sure if this is possible, so, please, help me out a little bit over here: I have an image loaded into the stage: var miC:Loader = new Loader(); miC.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); miC.load(new URLRequest("coverph.jpg")); function onComplete(e:Event):void { miC.width = stage.stageWidth; miC.height = stage.stageHeight; miC.x = 0; miC.y = 0; addChild(miC); trace(miC.width, miC.height); } And this way the image auto size itself to perfectly match the

key_down delay action script 3

血红的双手。 提交于 2019-12-14 02:53:22
问题 When you hold down the key After first pressing the next press is delaying but I don`t know why. public function KeyboardControl(event:KeyboardEvent):void { keySpeed=5 if(event.keyCode==Keyboard.RIGHT||event.keyCode==Keyboard.D) { if(_Vx<0) { _Vx=0; } _Vx += (keySpeed/mass); } if(event.keyCode==Keyboard.LEFT||event.keyCode==Keyboard.A) { if(_Vx>0) { _Vx=0; } _Vx -= (keySpeed/mass); } } 回答1: For more responsive behaviour, structure it like this: private var _Vx:Number = 0; private var keySpeed

AS3 Scale parent mc's center to child mc's center

倖福魔咒の 提交于 2019-12-14 02:50:23
问题 The following code centers the parent clip "mapcontainer.themap" on the state Georgia on load. However, when i try to scale mapcontainer.themap, it doesnt scale around Georgia's center. How do i keep Georgia in the center when scaling? //This sets the parent clip so it's centered on the child "georgia" clip on load var yValue:Number = mapcontainer.themap.georgia.y; var xValue:Number = mapcontainer.themap.georgia.x; var xDiff:Number = mapcontainer.themap.width/2; var yDiff:Number =

MovieClip assets SWC from Flash inaccessible in Flash Builder using getDefinitionByName

瘦欲@ 提交于 2019-12-14 02:42:48
问题 I need to access MovieClips from an SWC created in Flash using getDefinitionByName() in Flash Builder. I know I have to add in the full package name whilst doing this, like so, with the package name being 'com.fusepump': var className:String, assetName:String, obj:Class, i:uint; for (i = 0; i < Config.ASSETS.length; i ++) { className = String('com.fusepump.' + Config.ASSETS[i]); assetName = String(Config.ASSETS[i]).charAt(0).toLowerCase() + String(Config.ASSETS[i]).substr(1, String(Config

modify xml generated by flash?

送分小仙女□ 提交于 2019-12-14 02:38:07
问题 I am new to flash and actionscript. I want to modify the xml file of flash once it generated. You can see this tutorial http://www.webwasp.co.uk/tutorials/A_IntAct-02-drag-drop/index.php here when i change the position i want new xml file with update. Any Help is greatly Appriciated. Thanks, 回答1: Not having mostly any idea what exactly your asking for, I created an example with a square that can be dragged and dropped. When its dropped it writes xml to an xml file with the x and y co

AS3 - Move MovieClip across screen

谁都会走 提交于 2019-12-14 02:26:02
问题 I've 3 different MovieClips that I need to move at the same time across the screen. (From bottom to top) What is the best way of doing this without using a tweening class like Caurina? Thank you for tips. 回答1: You could add an event listener to the parent container of the display objects which listens for the Event.ENTER_FRAME event. On each Event.ENTER_FRAME event you simply decrement the y property of the display objects like in the following example. package { import flash.display.Sprite;