Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Gerry
"There is more than one way to skin a cat" - crazy expression but you can do what you want a number of ways in AS3. I guess knowing that you only want to add that movieClip from within the function would change things in the sample I sent. Here's another basic version (not knowing what you are

RE: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Steve Abaffy
Well my basic understanding of programming goes something like this. We call functions to do certain things when we need them to do it, so: Basic flowchart of program. LoadExternalData - This data will be loaded into movieclips to be place on the stage at a later time. DrawTheMainScreen - These ar

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Gerry
Steve, I suggest you read up on eventListeners in Actionscript 3. I provided an example that dispatches a new event called "what text", it doesn't pass that as a string to another function. I did this because you are creating your movieClip within a function so it's scope will only be within th

RE: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Merrill, Jason
>>The only example that seems to work is to make the movieClip a global >>variable, >>which seems to me to violate everything I have ever been taught about >>programming. >>Which is to say that one should use global variables as sparingly as >>possible. >>I have written thousands of lines of

[Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Steve Abaffy
Hello, Why doesn't this work?? In the same function Var Mort:movieClip = new Mort(); addChild(Mort); removeChild(Mort); I get this error The supplied DisplayObject must be a child of the caller. ___ Flashcoders mailing list Flashcod

Re: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Deepanjan Das
Hi Steve, This is because of timing. You are trying to remove an object which has not completed its addChild actions. Hence its not getting the instance when removing. Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com || Om Manasamarthadata Shri Aniruddhaya Namah ||

Re: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Kerry Thompson
Steve Abaffy wrote: > Why doesn't this work?? > > In the same function > > Var Mort:movieClip = new Mort(); > > addChild(Mort); > > removeChild(Mort); > > I get this error > > The supplied DisplayObject must be a child of the caller. > It's likely that Mort hasn't had time to instantiate. Either

[Flashcoders] Why doesn't this work addChild removechild

2011-04-22 Thread Steve Abaffy
Quick update Function{ Var Mort: MovieClip = new Mort(); Try{ removeChild(Mort); }catch(e:Error){ // Do nothing; } addChild(Mort); } This function is called multiple times and each time it adds the child Mort, but I want to remove the one placed there

RE: [Flashcoders] Why doesn't this work addChild() removeChild()

2011-04-22 Thread Merrill, Jason
A couple of things: 1. "Var" should be lower-case "var". You probably have it as "var" in your code and your e-mail client capitalized it for you (or you mis-typed), but if you want is to trouble-shoot, I would post it as it is in your code. If it is "Var" in your code, it should throw a comp

Re: [Flashcoders] CS5, SharedObject & AIR for Android debugging

2011-04-22 Thread Kevin Newman
I've been wondering if SharedObject is the correct storage technology to use on iOS and Android - the biggest question I have (I haven't tried it yet) is what happens to that data when the app is upgraded? I wonder if just writing a file somewhere would be better. That said, I don't have an an

Re: [Flashcoders] What is up with adobes documentation?

2011-04-22 Thread Kevin Newman
I usually just put the class name with as3 into google (LocalConnection as3) - it almost always gives me something useful. I do generally agree that's it's often hard to find anything using Adobe's built in documentation tool - especially using the search field (which is local in CS5). Though

Re: [Flashcoders] Why doesn't this work addChild removechild

2011-04-22 Thread Kerry Thompson
Steve Abaffy wrote: Quick update > > Function{ > > Var Mort: MovieClip = new Mort(); > > Try{ > >removeChild(Mort); > > }catch(e:Error){ > >// Do nothing; > > } > > addChild(Mort); > > } > > This function is called multiple times and each time it adds the child > Mo

RE: [Flashcoders] What is up with adobes documentation?

2011-04-22 Thread Merrill, Jason
I miss the good old days when Adobe's local help was easy to access and find information. I find better results with Google. Jason Merrill Instructional Technology Architect Bank of America Global Learning ___ -Original Message- From: flashcoders-boun...@ch

Re: [Flashcoders] What is up with adobes documentation?

2011-04-22 Thread Gerry
Agreed. On Apr 22, 2011, at 1:55 PM, Merrill, Jason wrote: > I miss the good old days when Adobe's local help was easy to access and find > information. I find better results with Google. > > Jason Merrill > Instructional Technology Architect > Bank of America Global Learning > > > > > >

Re: [Flashcoders] What is up with adobes documentation?

2011-04-22 Thread Kevin Newman
Yeah, I pretty much learned AS2 with Macromedia's little help ? mark button. :-) I'm not really sure why Adobe felt the need to mess with it so much. Kevin N. On 4/22/11 1:55 PM, Merrill, Jason wrote: I miss the good old days when Adobe's local help was easy to access and find information.

[Flashcoders] quick E4X question

2011-04-22 Thread Mendelsohn, Michael
Hi list... With this xml, given an node, I want to find its parent node. // not working var parentT:XMLList = pets..*.(t.contains(cat)); thanks, Michael M. dog> snake cat mouse

RE: [Flashcoders] quick E4X question

2011-04-22 Thread Keith Reinfeld
var pets:XML = dog snake cat mouse var parentT:XMLList = pets..t.(elements().contains(cat)).@n; Regards, Keith Reinfeld Home Page: http://keithreinfeld.home.comcast.net >