actionscript-3

onSeekPoint weirdness

牧云@^-^@ 提交于 2019-12-24 14:53:09
问题 I have a NetStream which is put into data generation mode properly... everything works fine and I get onSeekPoint() events when I do something like the following: EXAMPLE 1 public function setupStream() { netStream.client = {}; netStream.client.onSeekPoint = this.onSeekPoint; netStream.client.onMetaData = this.onMetaData; } public function onSeekPoint(... args) {...} public function onMetaData(... args) {...} However, instead of keeping it all in that parent class, I need to create a new

Dynamic UI window drawing in Flash?

痴心易碎 提交于 2019-12-24 14:43:17
问题 Wasn't sure if this question belongs here, but I'll try. So I'm about to move my project from Director | Shockwave Player (if you ever heard of these) to Flash Player for numerous reasons and while I'm thinking how to better start off I got a question which really made me wonder. To the point. Currently in Director each game window in the user interface (like small alerts or large windows with lot of elements in them) is drawn upon need - meaning that the actual window's graphical image is

What is the best way to distribute as3 classes and packages? [closed]

三世轮回 提交于 2019-12-24 14:28:00
问题 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 have a small framework that I would like to put out there. I would love to export these classes as a single file. I know there is a SWC format, but there is not much recent information on how to export build this and I have a feeling this format might be outdated. 回答1: A SWC file is just a ZIP file (with the

movieClip not stopping always looping

 ̄綄美尐妖づ 提交于 2019-12-24 14:03:16
问题 I have a class that gets a movieClip and then using addChild adds it to be displayed. Problem is that I cannot play or stop it at all. Basically I can't interact with the movieClip. Here is the code: public function Avatar(movieClip:DisplayObject) //class constructor { ... avatarSprite = MovieClip(movieClip) addChild(avatarSprite); avatarSprite.gotoAndStop(1); //this is not working trace(avatarSprite.currentFrame) //always returns 1 trace(avatarSprite.isPlaying) // returns false ... } When I

Scale from center point with Tween Class AS3

纵饮孤独 提交于 2019-12-24 13:46:13
问题 I need to scale a dynamic text box from it's center point using Tween class AS3. Basically, I need to scale down to 50% in 300ms or so... and after finish I want to scale up again to 100% and stop animation. I tried to set the center point to the center of the text box but it always scale from left. Well I been trying hard to learn the basics of Tween class and I believe it's missing some good properties and methods like greensock! Thank you. title_txt.text = "Text"; var textScaleX:Tween; var

Add children to HierarchicalCollectionView

南楼画角 提交于 2019-12-24 13:45:49
问题 I'm trying to implement lazy loading on ADG. and I'm stuck in the point where I need to add the returned children to the expanded node. Currently I'm doing: private function childrenloaded(data:*,item:*):void { var len:int = data.length; for(var i=0;i<len;i++) (internalMainGrid.dataProvider as HierarchicalCollectionView).addChild(item, data[i]); } This works fine, but it is slow. (21,990 ms for total: 919 records) is there some way I can speed this up? - like setting children directly Ex: var

Flex - number validation, wont remove red glow if click focus? (example provided)

浪尽此生 提交于 2019-12-24 12:53:51
问题 Reproduce problem: run code click checkbox click on the first input box enter: 100 The red glowing error box should have disappeared, but it will disappear when you focus on another component e.g. the second input box. If you refersh the screen, click the checkbox, and TAB onto the first input box, type 100, the error glow will disappear as I expected. This is what I want for click also. Any ideas? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml

ActionScript - Creating Square, Triangle, Sawtooth Waves From Math.sin()?

限于喜欢 提交于 2019-12-24 12:53:00
问题 is there common code available that produces square, triangle, sawtooth or any other custom waveforms using the math class? below is a basic function that handles a SampleDataEvent and plays a middle-c (440 Hz) sine wave. i'd like to change the tone by incorporating square, triangle and other waves. var position:int = 0; var sound:Sound = new Sound(); sound.addEventListener(SampleDataEvent.SAMPLE_DATA, sampleDataHandler); sound.play(); function sampleDataHandler(event:SampleDataEvent):void {

AS3 FileReference.save() works when testing locally but not in the browser

浪尽此生 提交于 2019-12-24 12:51:33
问题 I have created a painting app and when the user want's to save his drawing he simply hits the save button and a dialog pops up - or should do. When testing locally on dev machine it's no problem but whenever the app is loaded in a browser it won't work. Even if I load the local SWF file in a browser it won't work. The following code is what I use to save the file and as said it works fine locally but whenever it goes into a browser it dosen't.The save dialog simply never pops up. Any

Embedding/importing SWC at compile-time in ActionScript, without setting a library path

吃可爱长大的小学妹 提交于 2019-12-24 12:28:01
问题 Hail, Stack! I'm having a little trouble figuring out how to import a SWC file directly in ActionScript, without setting a library path to the file. To exemplify, I need something like this: package { [Embed(source = 'Library.swc')] // This line won't work, of course... import ClassInsideSWC; public class MyClass extends ClassInsideSWC { public function MyClass() { super(); } } } Besides, I don't want to (I can't, in fact) import the SWC by loading it with Loader class. Well, someone knows a