Actionscript 3 :: Substituting Lengthy Display List Paths In Code?
Sep 14, 2010
i would like to make my code easier to read by replacing long paths with variables, or something similar. in my code, i can target an instance many times, but the instance can have a lengthy path deep within the display list. for example: myButton instance could be located at myButtonsPanel.section2.redArea.myButton, or something like that. is it possible to substitue this long path as a variable or constant? something like: var myPath = myButtonsPanel.section2.redArea; therefore, calling the instance would be: myPath.myButton;
I have a container movieclip called cont_mc then inside that I have a series of pins which are called pin1_mc then inside the pins I have a final movie clip the size of the pin head to act as the hit state.You can see what I talking about here: http:[url]... Before I had the pins in the container movie clip I was able to bump them to the top of the display list using this code in the on over function.this.setChildIndex(event.target.parent,this. numChildren-1); Now I have wrapped them in the container mc this code no longer works and I get an error, must be a child of the caller?How can I change this?
I stumbled upon the need to find out (inside Java code) which files are dynamically loaded by an SWF-file. Is there any possibility to get a list of paths of every object referenced inside? I tried out some libraries without proper documentation and gave up. Maybe there is an external tool which can be accessed by Java via command line?
use the mxmlc task of the Flex Ant tasks with a user-definable list of source path or library paths? The idea is that the user can define an arbitrary list of source paths and/or library (swc) paths into an Ant properties file and the build file takes these values and evaluates them for use in the mxmlc task. Just wondering if there are any tricks (maybe utilizing filtering/string replacing) to get this working?
Does anyone know if there is some kind of program that can convert the XML paths to Flash paths. Hmm...what I'm after is some little program that basically lets me open up an XML file, point on a node or attribute and the program will the flashpath to this node/attribute, where the path is something like: his.firstchild.childnode[2].attribute.jadajada
I have a list containing display objects from throughout the application (insertion order). I want to process the list either top-down (parent, child) or bottom up (child, parent). The only requirement is that either a parent is processed before any child or vice versa a child before its parent. What is a good approach? This question is not about sorting a list. It's about retrieving the depth of a particular display object.
Example Display list: A (root) B1 C1 C2 D1 B2 ......
My list: list = [E1, F4, A, B2, B1, C3, ..., N9, N8]
Bottom-up: N9, N8, F4, E1, C3, B2, B1, A
Top-down: A, B2, B1, C3, E1, F4, N9, N8 Does not matter if N9 before N8 or N8 before N9. Important is that any N is before M (first run) or any M before its children N* (second run).
How do I identify all the display objects in the display list in ActionScript, bellow the one that I have clicked? All the other objects are shadowed by the first one. What if other objects have visible parameter as hidden?
I have created a website, in which I have used flash scroller. Now the problem is, that my data is too lengthy and it is not completely viewed in my current scroller. some solution so that I can integrate my whole data in scroller. url of current scroller is :[URL] In this page just click "clientele" button. Here is the scroller in which I am having problem. When you scroll down till last, you will see last entry are overlapping each other.
It's my understanding that a display object cannot be in the display list more that once.So if I add something to the stage shouldn't a second addition of the same object replace the first? for instance:
[code]...
there should now only be one "myDisplayObject" on the stage.
I have some .swf files I want to use in an iphone app for menu changes etc. I have tried to loop through the images(200) to get the same effect, but it doesnt seem to be to my benefit.
I'd like to know how to substitute characters of strings.Let's say I have...
my_str="Hello, Johny!, hello Dolly!";
I want to substitute all "!" characters to "?". How do we do this?I am assuming that first we need to know the character position of the character we want to get rid of.(we would loop this whole 3 step process until no more "!" characters were found in the string)1 my_str.indexOf("!"); returns 12 2) Now...how do I delete that character?3) The next step from there would probably be to use one of the methods String.substring() or String.slice to introduce the new character "?";
Many people install an add on to their browser - such as Flashblocker, or FlashOff - in order to stop annoying advertisements from auto-running. Is it possible to detect that this has been done, and then (obviously) use JScript to put up an alternative if this is the case?
If you cannot do this, then there is really no point to using Flash's higher functions, because the majority of users will see them only if they click a gray panel with a hopeful button in the middle of it. Flash becomes merely a decorative bolt on for web applications.
I have a highly intensive benchmark/testing chore and I'm getting the 15-second timeout error despite my best efforts to keep my script running.Basically I'm making about 1.2 million remote procedure calls (RPCs) over a socket and want to check the results of these rpcs.I can make the calls just fine. The problem I'm having is verifying the results of all these calls once the loop is complete.
Once the calls have all been sent, my flash movie moves to frame 7 which initializes a bunch of variables that I need for my RPC checking loop.Frame 8 does all the work. The first thing it does is stop the playhead for my main movie. Then it sets up a timer to wait for minute or two until any straggling RPC responses come in. [It's been my experience that these are likely to straggle in for several minutes when I'm really pushing the server hard.]
If the timer gets too high, the [b]checkResponse[/b] function returns and the playhead moves to frame 9 which checks to see if I've checked all the RPCs. If not, the playhead returns to from 8 which skips the timer this time and starts checking immediately.The output I'm getting ends up like this:
elapsed time:4985elapsed time:4985Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds. at flash_fla::MainTimeline/checkResponses() at flash_fla::MainTimeline/frame8() at flash.display::MovieClip/gotoAndPlay() at flash_fla::MainTimeline/runDelayedResponseCheck() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()[code]....
I'm having alot of trouble tracking down the name of an object on the display list so i can removeChild Is there a way to trace every object on the display list so i can get its name and remove it? my stage is changing dynmically and i can't jut trace each object through a whole whack of code.
I have a list box in my flash file that I would like to display a string from an xml file that has been run though html entities in php. So for instance I need the string.
Code: Hey "Leonardo£$£$()*%£% '"' [1999] to display as Code: Hey "Leonardo;$;$()*%$% '"' [1999]
I can get this to happen in my dynamic text boxes by using .htmlText to display but I have no idea how I would do this in the list box?
All it returns is 0 and [object MainTimeline]. Is there something wrong with Flash, or did I do my coding wrong? The objects I put on the stage should be on the Display List, right?
How do I removeChild only if it's in the Display List?One button on my stage will addChild(radioButton) and another removes it. If the remove button is clicked first, then it obviously tries to remove something that has not yet been added and an error is returned. I've tried using the DisplayObjectContainer class with the contains() method to no avail.
var t:TextField = new TextField(); t.text = "hello in main"; addChild(t);
However, when I create an instance of a class, and I have that same code in the constructor of that class, the text doesn't show up. I am creating the text field variable at the class level, not the contstructor level, so I think the variable should still hang around.
Do I have to get an instance of the stage, or something?
The documentation for the List component at[URL].. states "A list can also display graphics, including other components," but nowhere can I find an example of HOW to make this happen. Can anyone please point me to a working example, I really need to be able to leverage this functionality, but I cannot for the life of me find anywhere it's being done.
i have this really basic class and all it does is create a button...i have another class called main where i want to put the button on the stage...problem is it all compiles but can't get the button to display..
public class Main extends Sprite { public function Main() {
I'm working on a game that has many elements on stage, so I'm looking to optimize my loops. I know that Vector is faster than looping an array, but I'm also in some cases using:[code]My question is when I use getChildAt, is that accessing an Array or Vector or linked list or other? Should I instead store references to my objects in a Vector and loop through that instead?
Is there a way to make a display object always be at the top of the display list?For example, I know you can set the childIndex, i.e:setChildIndex(myDisplayObject, numChildren-1);But is there a way that an object has sensed that something else has been added to the display list and restack themselves accordingly?
How do i add to a display list thats already has items on it?
this is what I have already
ActionScript Code: public function LotteryDraw() { // get the display list positions for each MC and text field... var startButton = this.getChildAt(0);