actionscript-3

as3 namespace - get an attribute with a minus sign in it [duplicate]

旧城冷巷雨未停 提交于 2019-12-23 20:07:28
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: e4x / as3: How to access a node with a dash in its name. I've set the namespace for my XML to use SMIL and I'm able to pull the src attribute of an element this way: my.node.@src which gets "this is some URL" However, I have another attr called 'system-bitrate'. Because of the minus sign, I can't do @system-bitrate So I attempted what I normally do which is my.node.attribute('system-bitrate') which isn't working

ASC2.0 and Frame metatag

杀马特。学长 韩版系。学妹 提交于 2019-12-23 19:50:33
问题 Apparently, the new ActionScript Compiler 2.0 no longer supports the old [frame] metatag which allowed you to add preloaders to pure actionscript projects. I've verified this IntelliJ - switching the "Prefer ActionScript Compiler 2.0 for pure ActionScript build configurations" makes a difference between the preloader being instantiated and executed, and the main class being instantiated and executed. Googling yield no result, so is there currently any way around this issue - use ASC2.0 but

Preloader in actionscript 3 - Reference Error on getDefinition()

北战南征 提交于 2019-12-23 19:50:27
问题 I'm writing a preloader: package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.text.TextField; import flash.display.LoaderInfo; import flash.events.MouseEvent; import flash.events.Event; import flash.events.ProgressEvent; import flash.system.System; public class Preloader extends Sprite { private var t:TextField = new TextField(); private var ver:String = "1000"; public function Preloader() { t.y = 570; addChild( t ); t.text = ver; addEventListener( Event

How to detect if the delete key was pressed in Actionscript 3?

强颜欢笑 提交于 2019-12-23 19:20:21
问题 How do I determine if the delete key was pressed using actionscript? addEventListener(KeyboardEvent.KEY_UP, onKeyUp); ... function onKeyUp(event:KeyboardEvent):void { trace(event.keyCode); } The above code yields no value when delete, backspace, enter, and other command keys are pressed. However, arrow keys do yield values. 回答1: this.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed); .... function onKeyPressed(event:KeyboardEvent):void { if (event.keyCode==Keyboard.DELETE) { .....

Flash AS3 - Drag and Drop multiple objects to one target?

有些话、适合烂在心里 提交于 2019-12-23 18:40:49
问题 Title is more or less self-explanatory, I’ve been working through many different tutorials and I’m not exactly too good with AS3 to be perfectly honest. (Image above shows what I'm aiming for) Anyway, what I notice in most of the online tutorials I see, the drag and drop tutorials are either based on one object to one target or multiple objects to multiple targets, so I was wondering if someone is kind enough to help me and explaining how I can get multiple objects to connect to one target.

Is there a way to subclass and override a method that is in a custom namespace?

蓝咒 提交于 2019-12-23 18:04:27
问题 Say I have a class with a method defined in a namespace other than public, protected or internal... package com.foo.bar { import com.foo.my_name_space public class bar { private var _vabc:String private var _v123:String protected function set123(val:String):void{ _v123 = val; } my_name_space function setABC(val:String):void{ _vabc = val; } } } Now I want to extend and override this in a subclass... package com.foo { import com.foo.bar.bar import com.foo.my_name_space public class foo extends

Actionscript 3 and dynamic masks

守給你的承諾、 提交于 2019-12-23 17:56:52
问题 I have a container MovieClip that serves as a content area that I need to mask off. When I create a mask inside this container using a Shape I can't seem to interact with the contents of other containers I create here, like buttons etc. This is what I'm doing in code (I've left out all the import's etc.): class MyContainer extends MovieClip { protected var masker : Shape = null; protected var panel : MyPanel = null; public function MyContainer() { this.masker = new Shape(); this.masker

Custom ContextMenu is not showing, since Display Object is lying “on Top”

纵然是瞬间 提交于 2019-12-23 17:47:13
问题 as a follow up to another question here: i've build a custom contextmenu item in a flash application and had a problem with it not showing sometimes. i found out that the issue was that another sprite was lying "on top" of the item with the custom contextmenu. however, even with the "mouseEnabled" and "mouseChildren" properties set to false for the item "on top" i still cannot get the custom contextmenu to show... any ideas? thanks! ps: here is some code to see the problem: var spr:Sprite=new

How to convert hex to decimal in Actionscript3?

拈花ヽ惹草 提交于 2019-12-23 17:47:11
问题 How to convert hex(in string) to decimal(int) in Actionscript3? 回答1: Number , int and uint class having toString() method which accept radix as arguments. radix Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10. you can convert to any base like octal, hex, binary via Number and uint class. Better way var decimal:int = parseInt("FFFFFF",16); // output : 16777215 Another way var hex:String =