actionscript-3

Flex: How to add a tab close button for TabNavigator component

爱⌒轻易说出口 提交于 2019-12-18 13:25:21
问题 I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks 回答1: You should take a look at the SuperTabNavigator component from the FlexLib project: SuperTabNavigator example SuperTabNavigator documentation FlexLib Component list If you don't want all of the tabs to have close buttons (I understand from the question that you don't

How to draw a continuous curved line from 3 given points at a time

 ̄綄美尐妖づ 提交于 2019-12-18 13:23:13
问题 I am trying to draw a continuous curved line in flash. There are many methods but none of the ones I have found so far quite fit my requirements. First of all, I want to use the flash graphic api's curveTo() method. I DO NOT want to simulate a curve with hundreds of calls to lineTo() per curved line segment. It is my experience and understanding that line segments are processor heavy. Flash's quadratic bezier curve should take less CPU power. Please challenge this assumption if you think I am

Vector graphics flood fill algorithms?

非 Y 不嫁゛ 提交于 2019-12-18 13:00:37
问题 I am working on a simple drawing application, and i need an algorithm to make flood fills. The user workflow will look like this (similar to Flash CS, just more simpler): the user draws straight lines on the workspace. These are treated as vectors, and can be selected and moved after they are drawn. user selects the fill tool, and clicks on the drawing area. If the area is surrounded by lines in every direction a fill is applied to the area. if the lines are moved after the fill is applied,

extending AS3's Array access operators to 'wrap' out-of-bound index values

纵饮孤独 提交于 2019-12-18 12:47:09
问题 I'd really like to be able to make Flash's array access syntax 'wrap' over the array's bounds. Lengthy explanation - var array:Array = ['a','b','c','d','e','f']; To keep things simple, the first index is 0, and its value is the first letter, 'a'. To get that value, we'd do this - array[0]; // returns 'a' As long as the index you're using to access the array is between 0 and array.length (6 in our example,) everything works fine - but if you use an index outside of those bounds, you're shut

How to get/obtain Variables from URL in Flash AS3

风格不统一 提交于 2019-12-18 12:34:07
问题 So I have a URL that I need my Flash movie to extract variables from: example link: http://www.example.com/example_xml.php?aID=1234&bID=5678 I need to get the aID and the bID numbers. I'm able to get the full URL into a String via ExternalInterface var url:String = ExternalInterface.call("window.location.href.toString"); if (url) testField.text = url; Just unsure as how to manipulate the String to just get the 1234 and 5678 numbers. Appreciate any tips, links or help with this! 回答1: Create a

Example of inner classes used as an alternative to interfaces

血红的双手。 提交于 2019-12-18 12:32:47
问题 What I was told, which sparked my curiosity on this topic: Java gui classes can implement hundreds of Listeners and Callbacks and many books teach you to implement all these interfaces in your gui class. Alternatively, these aspects can be implemented in inner classes, so methods called by that listeners do not get mixed up. I'd like to know how to do this in ActionScript, which doesn't have inner classes, but has private classes. But, I don't think I fully realize what inner classes are

Example of inner classes used as an alternative to interfaces

▼魔方 西西 提交于 2019-12-18 12:32:05
问题 What I was told, which sparked my curiosity on this topic: Java gui classes can implement hundreds of Listeners and Callbacks and many books teach you to implement all these interfaces in your gui class. Alternatively, these aspects can be implemented in inner classes, so methods called by that listeners do not get mixed up. I'd like to know how to do this in ActionScript, which doesn't have inner classes, but has private classes. But, I don't think I fully realize what inner classes are

How to control indentation after an open parenthesis in Emacs

断了今生、忘了曾经 提交于 2019-12-18 11:21:30
问题 When I use emacs python-mode, if the last character of a line is an open parenthesis it indents the next line just one step in from the indentation of the previous line. call_some_function( some_very_long_argument_that_I_want_to_put_on_its_own_line) I like that. Now in ecmascript-mode (which I am using for actionscript 3), it always indents to the level of the previous parenthesis. call_some_function( this_is_not_really_saving_me_any_horizontal_space); How can I make ecmascript-mode indent

Why when I Update a 2 dimensional Array it give an “Error #1010”

久未见 提交于 2019-12-18 09:39:44
问题 In my programming class, I need to create a Tiles game with AS3 (like zelda). On a map, the tiles are initialised black in an array and, after that, they are changing randomly each time the leftpick of a song reach a certain value. When the tiles change, I need to update the Array with the new value. Actually, I always get an Error #1010: A term is undefined and has no properties. This is how the tiles are initialised: variable private var grid: MovieClip; private var nbRow: int = 6; private

AS3 - Navigating through array elements

荒凉一梦 提交于 2019-12-18 09:38:23
问题 Hello and thank you for your time. I have an as3 code which randomly picks 5 frames out of 7, no repeats. var mygroup1:RadioButtonGroup = new RadioButtonGroup("group1"); q1a1.group = q1a2.group = q1a3.group = q1a4.group = q1a5.group = mygroup1; var number_array:Array = [8158,8159,8160,8161,8162,8163,8164]; var final_array:Array = []; var count_selected:int = 5; var i:int; for(i = 0; i < count_selected; i++) { if(number_array.length == 0) break; else final_array.push(number_array.splice(Math