actionscript-3

Connecting lines (while dragging) in Flex/Actionscript

喜欢而已 提交于 2020-01-04 17:26:25
问题 I have a mx:Canvas element that contains several mx:Panel elements. I want to be able to draw a line connecting two such mx:Panel's in such a way that the line continues to connect the two mx:Panels when one or both get dragged around. It seems like something that should be trivial to do, but I haven't been able to figure it out. In effect, this is the problem. alt text http://img150.imageshack.us/img150/5656/ishot1eu3.jpg Since the updates only occur when the Panel reaches it's final

Determine a computer ID in Flash/AIR game

风流意气都作罢 提交于 2020-01-04 14:04:10
问题 I'm creating an online multiplayer game in which I want to prevent players from joining a game using multiple clients/accounts on one computer. I can't simply do a server sided check for the IP-address because I still want e.g. people in the same office to be able to play together. Therefore I'd like to generate some kind of computer ID/hash on the client which it sends along to the server. I know that is easily hackable, but it will stop at least those "cheaters" who can't or won't change

Validation and Invalidation in flex

不羁的心 提交于 2020-01-04 13:06:21
问题 I am new in flex and recently read about Validation and Invalidation in components . May somebody explain what it's mean and when it's use, may be some good article. 回答1: I think the chapter "About creating advanced components" from the Adobe Flex LiveDocs will be a good starting point. Take notice of the subchapter "About the invalidation methods". 回答2: some links for you to learn http://livedocs.adobe.com/flex/3/html/validators_2.html http://blog.flexexamples.com/2007/08/13/validating-flex

Validation and Invalidation in flex

此生再无相见时 提交于 2020-01-04 13:06:18
问题 I am new in flex and recently read about Validation and Invalidation in components . May somebody explain what it's mean and when it's use, may be some good article. 回答1: I think the chapter "About creating advanced components" from the Adobe Flex LiveDocs will be a good starting point. Take notice of the subchapter "About the invalidation methods". 回答2: some links for you to learn http://livedocs.adobe.com/flex/3/html/validators_2.html http://blog.flexexamples.com/2007/08/13/validating-flex

how do I find the number of xml children in AS3

蹲街弑〆低调 提交于 2020-01-04 09:19:33
问题 so live docs says this for calling .lenght() on an XML object For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an XMLList object that contains only one value. i called it on an xml that looked like this: <xml> <picture>1</picture> <picture>2</picture> </xml> i tried myXML.lenght() and it reallt returned 1. how do i get the number of children in my xml? 回答1: Try var length:int = myXML.children().length(); Also, this is

how do I find the number of xml children in AS3

只谈情不闲聊 提交于 2020-01-04 09:18:21
问题 so live docs says this for calling .lenght() on an XML object For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an XMLList object that contains only one value. i called it on an xml that looked like this: <xml> <picture>1</picture> <picture>2</picture> </xml> i tried myXML.lenght() and it reallt returned 1. how do i get the number of children in my xml? 回答1: Try var length:int = myXML.children().length(); Also, this is

Seedable random number generator, actionscript

*爱你&永不变心* 提交于 2020-01-04 08:27:33
问题 I am looking for a random number generator in actionscript 3.0 that i can seed. The Math.random() does not have this functionality. Thanks. 回答1: Here you go http://gskinner.com/blog/archives/2008/01/source_code_see.html 回答2: I mostly use this seeded random function, which is very fast. var seed:int = 777; const MAX_RATIO:Number = 1 / int.MAX_VALUE; const MIN_MAX_RATIO:Number = -MAX_RATIO; function random():Number { seed ^= (seed << 21); seed ^= (seed >>> 35); seed ^= (seed << 4); if (seed > 0

How to change your app's target API using flash CS6

[亡魂溺海] 提交于 2020-01-04 07:51:50
问题 I tried uploading APK to google play but get this error: Your app currently targets API level 21 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 26 How would one change the API level in Flash CS6? 回答1: To specify an Android target SDK for your Adobe AIR Android application you need to add the uses-sdk node to your manifest additions in your application descriptor. You can add

Serialize circular object networks using writeObject / readObject

怎甘沉沦 提交于 2020-01-04 07:35:10
问题 I'm about to implement public function writeExternal( output:IDataOutput ):void {...} public function readExternal( input:IDataInput ):void {...} to make a set of object serializable. Although I'm pretty sure, that I implemented all correctly, readExternal(..) at a certain point complains about too few data left to read: RangeError: Error #2006: The supplied index is out of bounds. at flash.filesystem::FileStream/readObject() I wonder, if I have a circular object network like A = { left -> B,

Can I create EventListener in AS3 from one Object and remove it from another Object?

梦想与她 提交于 2020-01-04 06:50:36
问题 I spent lots of time trying to resolve this issue. So, basically I have an class (addadd) that contain function which can create eventListener and remove eventListener. And I have another two objects (Symbol1, Symbol2) that tell the function what to do - create or remove. package { import flash.display.*; import flash.events.Event; import fl.motion.MotionEvent; import flash.events.MouseEvent; public class addadd { var stanishev:stanishev_line = new stanishev_line; public function addadd() { /