actionscript-3

Passing data/variable from a Visual Basic form to a Flash Object

别等时光非礼了梦想. 提交于 2019-12-30 13:59:07
问题 I'm pretty sure that this can be answered somewhere here on stackOverflow but I'm out of options with this. I have a VisualBasic form with an button object on it. I would like that button to have an onClick procedure so that clicking it passes a variable or other command to another window which has a Shockwave Flash "movie" running. (For example, there is a function on the ActionScript of the Flash file to display some text in the Flash Video running when invoked.) What am I missing to make

Flex Datagrid - how to obtain item for mouse x/y coordinates?

怎甘沉沦 提交于 2019-12-30 12:25:29
问题 my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen. We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands. I have managed to get the right click event into my Flex app with the help of this site. Further progress so far has been to obtain the DataGrid instance via var objects : Array = this

Flex Datagrid - how to obtain item for mouse x/y coordinates?

微笑、不失礼 提交于 2019-12-30 12:25:11
问题 my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen. We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands. I have managed to get the right click event into my Flex app with the help of this site. Further progress so far has been to obtain the DataGrid instance via var objects : Array = this

AS3: Getting the scale of a Matrix object

十年热恋 提交于 2019-12-30 11:33:10
问题 Most often, questions are asked about how to scale a DisplayObject, and the answer is usually to use a Matrix. My question is, how to you GET the scale of a Matrix (scaleX and scaleY)? There's a Matrix.scale method to set the scaleX and scaleY, but it doesn't return a value, and no other properties exist to read it back. The reason I ask, I'm using object burried deep down into a Display list, and each may be transformed. So I use the child object's sprite.transform.concatenatedMatrix getter,

AS3: beginGradientFIll() doesn't make me a gradient!

*爱你&永不变心* 提交于 2019-12-30 11:29:28
问题 I'm trying to render a circle with a radial gradient but I can't seem to figure it out. var bkgdGrad:Shape = new Shape(); bkgdGrad.graphics.beginGradientFill(GradientType.RADIAL, [0x0000FF, 0x00FF00], [1, 1], [0, 255],null,"pad"); bkgdGrad.graphics.drawCircle(0,0,r+200); bkgdGrad.graphics.endFill(); this.addChild(bkgdGrad); The above code renders a solid green circle for me. If I change the array after the colors to [1,0] (the alpha array) I get a transparent fill. I can't seem to get flash

Actionscript memory management, garbage collection

我与影子孤独终老i 提交于 2019-12-30 11:18:10
问题 This blog (and others) state that you should set object references to null inside your dispose() methods when cleaning up objects. However, Actionscript 3 (with Flash Player 9) uses mark and sweep to clear out circular references for you. So I am wondering: is there really any reason to null out your object references? 回答1: I never do - as long as you do the obvious: Break all reference to the object (remove from arrays, set variables storing the object to null, remove from display list)

Flash toggle button

非 Y 不嫁゛ 提交于 2019-12-30 10:29:41
问题 I need a button in Flash/AS3 that toggles between on and off. So I was glad to see that the Button class has the toggle property that lets me have that behavior. I was less happy to see that what I get when I make something a "button" in the Flash file is an instance of SimpleButton class, which does not have that option. Is there a way to either get a Button instance from the .fla, or get the SimpleButton to behave as a toggle? 回答1: Here's how I coded my way around this: private buttonState

Flash & Flex SDK/AS3 - How to keep keyboard focus?

我的未来我决定 提交于 2019-12-30 09:54:07
问题 I'm writing a flash application in Flex/AS3, and I can't seem to assign keyboard focus to it. I was mindful of this problem early on in development and added a splash screen with a "play now" button, to entice the user to click. However, the user must then click a second time on the application for the keyboard to work! To make matters worse, I have an in-game shortcut that returns you to the main menu. If you return to the main menu then click the "play now" button, the SWF loses focus again

Instantiate a class from a string in ActionScript 3

此生再无相见时 提交于 2019-12-30 09:51:15
问题 I've got a string which, in run-time, contains the name of a class that I want to instantiate. How would I do that? I read suggestions to use flash.utils.getDefinitionByName() : var myClass:Class = getDefinitionByName("package.className") as Class; var myInstance:* = new myClass(); However, that gives me the following error: [Fault] exception, information=ReferenceError: Error #1065: Variable className is not defined. 回答1: The easiest method I've come up with is to simply write the classnames

XML data can't be read by swf file when i publish it

陌路散爱 提交于 2019-12-30 07:44:08
问题 I am trying to read data from a URL http://localhost:15979/default.aspx .The output of the url is : <?xml version="1.0" encoding="utf-8"?> <GALLERY> <IMAGE TITLE="abs">image1.jpg</IMAGE> <IMAGE TITLE="iron">image2.jpg</IMAGE> <IMAGE TITLE="shop">image3.jpg</IMAGE> </GALLERY> I fetch this values into adobe flash cs with this code: var myXML:XML = new XML(); var XML_URL:String = "http://localhost:15979/default.aspx"; var myXMLURL:URLRequest = new URLRequest(XML_URL); var myLoader:URLLoader =