actionscript-3

Does setting properties in AS3 prevent timeline tweens?

让人想犯罪 __ 提交于 2019-12-20 02:58:10
问题 If I have a movieclip that has a class assigned to it and I change a property of that movieclip in code, it seems that the property can no longer be tweened on the timeline. For example, if my class sets this.x = 100, and later on the timeline I tween the position of the object, that timeline tween will not occur. Changing either scaleX or scaleY property also seems to stop timeline tweens from happening. Has anyone else experienced this, and if so, is there a way around it? 回答1: You have it

upload a zip file using HTTP POST via actionscript 3.0

房东的猫 提交于 2019-12-20 02:52:24
问题 I have a zip file that is created using drag and drop on a view in my desktop Flex 4.6 app. This triggers a service that will automatically upload the zip file. I am able to use the following code to send metadata about the zip file to the server. var urlRequest:URLRequest = new URLRequest(PUBLISH_ZIP_FILE_URL); // set to method=POST urlRequest.method = URLRequestMethod.POST; var params:URLVariables = new URLVariables(); params['data[File][title]'] = 'Title1'; params['data[File][description]'

ActionScript MXML <mx:> vs <s:>

≡放荡痞女 提交于 2019-12-20 02:34:27
问题 Looks like I can use components for both <mx:> or <s:> . So, which has more advantages? 回答1: As other posters have mentioned, the spark (s:) namespace refers to the new components introduced with Flex 4, while the halo/mx (mx:) namespace refers to the older components. They can be used together, which is necessary since there are not spark equivalents for all of the mx components (notable omissions are DataGrid, Tree, DividedBox, among others.) Some of the motivations for the new spark

Flex: HTTP request error #2032

不羁的心 提交于 2019-12-20 02:04:24
问题 In Flex 3 application I use HTTPService class to make requests to the server: var http:HTTPService = new HTTPService(); http.method = 'POST'; http.url = hostUrl; http.resultFormat = 'e4x'; http.addEventListener(ResultEvent.RESULT, ...); http.addEventListener(FaultEvent.FAULT, ...); http.send(params); The application has Comet-architecture. So it makes long running requests. While waiting a response for this request, other requests can be made concurrently. The application works in most cases.

Flex: HTTP request error #2032

别等时光非礼了梦想. 提交于 2019-12-20 02:04:18
问题 In Flex 3 application I use HTTPService class to make requests to the server: var http:HTTPService = new HTTPService(); http.method = 'POST'; http.url = hostUrl; http.resultFormat = 'e4x'; http.addEventListener(ResultEvent.RESULT, ...); http.addEventListener(FaultEvent.FAULT, ...); http.send(params); The application has Comet-architecture. So it makes long running requests. While waiting a response for this request, other requests can be made concurrently. The application works in most cases.

AS3: Using string as variable

时光总嘲笑我的痴心妄想 提交于 2019-12-20 01:11:59
问题 Is there a possibility to extract variable name from string and using it as variable var myvar:String = "flash"; var flash:Number = 10; trace( myvar as variable ); something like that 回答1: You can use it as a property of an object. public dynamic class MyClass { function MyClass(propName:String, propValue:*) { this[propName] = propValue; } } or var myvar:String = "flash"; var o : Object = {}; o[myvar] = 10; trace(o.flash); //10 If you don't know what property name is going to be, then you

How to expose a method in an interface without making it public to all classes

牧云@^-^@ 提交于 2019-12-20 01:05:31
问题 I have a issue where I'm working with a particular interface for quite a lot of things. However, I have a particular method that I want to be available only to a particular group of classes (basically, an internal method). interface IThing { function thisMethodIsPublic():void; function thisMethodShouldOnlyBeVisibleToCertainClasses():void; } The problem is, there is no way to add access modifiers (i.e. public, private, internal) in an interface - at least not in ActionScript 3.0. So I'm

How to stop Mouse Out event on Flex Canvas firing for child elements

人走茶凉 提交于 2019-12-19 21:48:39
问题 I am using a Canvas itemRenderer for a container I use to display images. See pseudo code below. image = new Image(); image.source = data.@thumb; this.addChild(image); this.addEventListener(MouseEvent.MOUSE_OVER, enlarge(image)); this.addEventListener(MouseEvent.MOUSE_OUT, shrink(image)); When I mouse over the canvas, the enlarge function is called. However as soon as I move the mouse onto the image, or another child element, the MOUSE_OUT event is fired. Can anyone point me in the direction

Change A Character In A String Using Actionscript

混江龙づ霸主 提交于 2019-12-19 20:01:42
问题 What is the opposite of String.charAt() ?? If I Have a string: var Str:String="Hello World"; How do I change the 5th character, for example, from a ' ' to an '_'? I can GET the 5th character like this: var C:String=Str.charAt(5); But how do I SET the 5th character? Thanks in advance. 回答1: There are many ways to skin this cat. One, off the top of my head, would involve String.substr: var Str:String="Hello World" var newStr:String = Str.substr(0,5) + "_" + Str.substr(6); or, the same as above,

Change A Character In A String Using Actionscript

扶醉桌前 提交于 2019-12-19 20:01:06
问题 What is the opposite of String.charAt() ?? If I Have a string: var Str:String="Hello World"; How do I change the 5th character, for example, from a ' ' to an '_'? I can GET the 5th character like this: var C:String=Str.charAt(5); But how do I SET the 5th character? Thanks in advance. 回答1: There are many ways to skin this cat. One, off the top of my head, would involve String.substr: var Str:String="Hello World" var newStr:String = Str.substr(0,5) + "_" + Str.substr(6); or, the same as above,