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 doing with the code or 
movieClips) ...

function DrawMyStuffOnScreen():void{

  var myMovieClip:MovieClip = new DefinedMovieClip();
 myMovieClip.TextField.text = SomeText;
  myMovieClip.addEventListener(What text, showWhatText);
  
 var myButton:SimpleButton = new DefinedButton();

  myButton.addEventListener(MouseEvent.CLICK,DoSomething);

  addChild(myMovieClip);
addChild(myButton);
}

function DoSomething(e:MouseEvent):void{
/* This is called from the button which will dispatch a 
new event that your movie clip is listening for */

dispatchEvent(new Event(what text));
}

function showWhatText(e:Event):void{
   /* This event fires when the event What text happened */
trace(e.target.TextField.text);
}



1.) Why are you declaring your MovieClip within the function? 
2.) Does that movieClip and button have to be added to the stage at a certain 
time?
3.) Is all of this code on the timeline?

-Gerry


On Apr 22, 2011, at 12:35 AM, Steve Abaffy wrote:

 So basically the only way to make this work is to declare the myMovieClip as
 a global variable??
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry
 Sent: Thursday, April 21, 2011 9:28 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] How to access MovieClip declared in one function
 in an event listener
 
 Steve,
 
 You have some things confused. Like Ross said, read up on event.target.
 
 Your code should look something like this...
 
 Var myMovieClip:MovieClip;
 Var myButton:SimpleButton;
 
 DrawMyStuffOnScreen();
 
 
 Function DrawMyStuffOnScreen():void{
 
   myMovieClip = new DefinedMovieClip();
 
   myButton = new DefinedButton();
 
   myButton.addEventListener(MouseEvent.CLICK,DoSomething);
 
   //Defined Movie clip has several input fields in it
 
   myMovieClip.TextField.text = SomeText;
 
   addChild(myMovieClip);
   addChild(myButton);
 }
 
 Function DoSomething(e:MouseEvent):void{
   
   //What goes in this function to be able to do something like
 
   Trace(myMovieClip.TextField.text); // This show a complier
 error of basically I don't know what myMovieClip is;
 }
 
 
 On Apr 21, 2011, at 9:44 PM, Steve Abaffy wrote:
 
 Hello,
 
 
 
 I basically have the follow:
 
 
 
 Function DrawMyStuffOnScreen():void{
 
   Var myMovieClip:MovieClip = new DefinedMovieClip();
 
   Var myButton:SimpleButton = new DefinedButton();
 
   myButton.addEventListener(MouseEvent.CLICK,DoSomething);
 
 //Defined Movie clip has several input fields in it
 
   myMovieClip.TextField.text = SomeText;
 
   addChild(myMovieClip);
 
 }
 
 Function DoSomething(MouseEvent.CLICK):void{
 
   What goes in this function to be able to do something like
 
   Trace(myMovieClip.TextField.text); // This show a complier
 error of basically I don't know what myMovieClip is;
 
 
 
   Then tried:
 
   Var myMC = new DefinedMovieClip();
 
   Trace(myMC.TextField.text) // this works but is always
 empty
 since it initializes empty. 
 
   So how do you access the textfield that is sitting on the
 stage???
 
 }
 
 Thanks
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 are the items on the stage that stay all the time.
DrawNavigationButtons - These buttons will load the different things on the
screen that change. This is where the EventListeners for the buttons are
defined.
FirstButtonClickedListener - Calls ClearscreenFunction, which clears
the screen of all previous things on the stage that are not to stay all the
time
Then Draw the stage for this Menu Item.
SecondButtonClickedListenr - Cals ClearscreenFunction.
Then Draws the stage for this MenuItem. This screen is a
input form which has a button on it to do something with the information
entered. Declares Listener for this button.
ButtonListener is called and now we can't access any of the
information on the form.

So in my opinion it would be better if you could declare the Listener as
follows:

myButton.addListener(Event,ParamatersToPass,FunctionsToCall); With the
parameter list to be optional if not needed.

Then declare the Function accordingly.

The example of  trace((event.currentTarget).TextField.text);
Here event.currentTarget is the button itself which of course does not have
any textfields associated with it.

Another example was to write two function one that calls is the
eventListener and then have the eventListener call another eventListener
where you are passing What Text where are you getting the value of What
Text? If I could get the value of What Text in this function I wouldn't
need the other function so I am a bit confused as to how that will solve
anything. 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
code in my 30+ years as a programmer and probably only used global variables
once or twice before OOPs programming became the rage.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry
Sent: Friday, April 22, 2011 6:15 AM
To: Flash Coders List
Subject: Re: [Flashcoders] How to access MovieClip declared in one function
in an event listener

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 doing with the code
or movieClips) ...

function DrawMyStuffOnScreen():void{

  var myMovieClip:MovieClip = new DefinedMovieClip();
 myMovieClip.TextField.text = SomeText;
  myMovieClip.addEventListener(What text, showWhatText);
  
 var myButton:SimpleButton = new DefinedButton();

  myButton.addEventListener(MouseEvent.CLICK,DoSomething);

  addChild(myMovieClip);
addChild(myButton);
}

function DoSomething(e:MouseEvent):void{
/* This is called from the button which will
dispatch a new event that your movie clip is listening for */

dispatchEvent(new Event(what text));
}

function showWhatText(e:Event):void{
   /* This event fires when the event What text happened */
trace(e.target.TextField.text);
}



1.) Why are you declaring your MovieClip within the function? 
2.) Does that movieClip and button have to be added to the stage at a
certain time?
3.) Is all of this code on the timeline?

-Gerry


On Apr 22, 2011, at 12:35 AM, Steve Abaffy wrote:

 So basically the only way to make this work is to declare the myMovieClip
as
 a global variable??
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry
 Sent: Thursday, April 21, 2011 9:28 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] How to access MovieClip declared in one
function
 in an event listener
 
 Steve,
 
 You have some things confused. Like Ross said, read up on event.target.
 
 Your code should look something like this...
 
 Var myMovieClip:MovieClip;
 Var myButton:SimpleButton;
 
 DrawMyStuffOnScreen();
 
 
 Function DrawMyStuffOnScreen():void{
 
   myMovieClip = new DefinedMovieClip();
 
   myButton = new DefinedButton();
 
   myButton.addEventListener(MouseEvent.CLICK,DoSomething);
 
   //Defined Movie clip has several input fields in it
 
   myMovieClip.TextField.text = SomeText;
 
   

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 that function...so I added the eventListener
to that movieClip to listen for the dispatched event named what text.

DrawTheMainScreen - These are the items on the stage that stay all the time.
If they are on the screen at all times then you would want to declare those 
outside of that function first so that they can be referenced in 
other placesright? *

It sounds  like you want to display a bunch of objects on the stage that are 
available at all times. So with that said you'd want to 
write the vars for those objects outside of your functionTHEN when you call 
DrawTheMainScreen it sets what those objects are.
Now when you click on that button your click event can fire an event that can 
reference anything that is on the stage*.

*see my first code example. 

Let me know if you're still unclear and I'll send some more code.

-Gerry

On Apr 22, 2011, at 10:24 AM, Steve Abaffy wrote:

 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 are the items on the stage that stay all the time.
 DrawNavigationButtons - These buttons will load the different things on the
 screen that change. This is where the EventListeners for the buttons are
 defined.
   FirstButtonClickedListener - Calls ClearscreenFunction, which clears
 the screen of all previous things on the stage that are not to stay all the
 time
   Then Draw the stage for this Menu Item.
   SecondButtonClickedListenr - Cals ClearscreenFunction.
   Then Draws the stage for this MenuItem. This screen is a
 input form which has a button on it to do something with the information
 entered. Declares Listener for this button.
   ButtonListener is called and now we can't access any of the
 information on the form.
 
 So in my opinion it would be better if you could declare the Listener as
 follows:
   
 myButton.addListener(Event,ParamatersToPass,FunctionsToCall); With the
 parameter list to be optional if not needed.
 
 Then declare the Function accordingly.
 
 The example of  trace((event.currentTarget).TextField.text);
 Here event.currentTarget is the button itself which of course does not have
 any textfields associated with it.
 
 Another example was to write two function one that calls is the
 eventListener and then have the eventListener call another eventListener
 where you are passing What Text where are you getting the value of What
 Text? If I could get the value of What Text in this function I wouldn't
 need the other function so I am a bit confused as to how that will solve
 anything. 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
 code in my 30+ years as a programmer and probably only used global variables
 once or twice before OOPs programming became the rage.
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry
 Sent: Friday, April 22, 2011 6:15 AM
 To: Flash Coders List
 Subject: Re: [Flashcoders] How to access MovieClip declared in one function
 in an event listener
 
 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 doing with the code
 or movieClips) ...
 
 function DrawMyStuffOnScreen():void{
 
  var myMovieClip:MovieClip = new DefinedMovieClip();
 myMovieClip.TextField.text = SomeText;
 myMovieClip.addEventListener(What text, showWhatText);
 
 var myButton:SimpleButton = new DefinedButton();
 
  myButton.addEventListener(MouseEvent.CLICK,DoSomething);
 
  addChild(myMovieClip);
   addChild(myButton);
 }
 
 function DoSomething(e:MouseEvent):void{
   /* This is called from the button which will
 dispatch a new event that your movie clip is listening for */
 
   dispatchEvent(new Event(what text));
 }
 
 function showWhatText(e:Event):void{
   /* This event fires when the event What text happened */
   trace(e.target.TextField.text);
 }
 
 
 
 1.) 

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 code in my 30+ years as a programmer 
 and probably only used global variables
 once or twice before OOPs programming became the rage.

And you still shouldn't have to. I haven't followed this thread, and don't have 
time at the moment to dig in, but there still should be no need for a global 
variable in your application, if that makes you feel any better.

 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 




--
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary. If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender. Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses. 

References to Sender are references to any subsidiary of Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Attachments that are part of this EC may have additional 
important disclosures and disclaimers, which you should read. This message is 
subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
consent to the foregoing.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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
||http://www.manasamarthyadata.com/
*Think of the environment before printing this email
__
*


On Fri, Apr 22, 2011 at 10:47 PM, Steve Abaffy st...@msmarketing.bizwrote:

 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
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 that, or Mort,
being a local variable, isn't there if you leave the function and call it
again. For example:

public function doMort(add:Boolean):void
{

  var Mort:MovieClip;
  if (add == true)
  {
Mort = new Mort();
addChild(Mort);
  }
  else
  {
removeChild(Mort);
  }
}

Mort only survives while the function is running. He's still on the display
list, but the function doesn't know who Mort is when you call him with
false.

Or, it could be something as simple as using an upper-case Var instead of
var.

Have you looked in the debugger, or with trace statements, to be sure Mort
is being created? If instantiation fails, it won't be a valid MC.

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[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 previously, it works if I add the
two lines right after each other as in the previous email but I really need
it work more like this.

 

 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 compiler error.
2. You are naming your instance name the same as the Class name Mort.  
Instance names are also usually lower case, classes upper case, which helps to 
prevent coding errors like this.
3. You are casting your instance as MovieClip when it is actually Mort.  
Your Mort class may extend MovieClip, but it would be better to cast it as 
Mort.

The following works for me:

import mortsPackage.Mort;

function createAndDestroyMortJustForFun():void
{
var mort:Mort = new Mort();
addChild(mort);
removeChild(mort);
}

createAndDestroyMortJustForFun();


 Jason Merrill
 Instructional Technology Architect
 Bank of America  Global Learning 





___


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steve Abaffy
Sent: Friday, April 22, 2011 1:17 PM
To: 'Flash Coders List'
Subject: [Flashcoders] Why doesn't this work addChild() removeChild()

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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

--
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary. If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender. Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses. 

References to Sender are references to any subsidiary of Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Attachments that are part of this EC may have additional 
important disclosures and disclaimers, which you should read. This message is 
subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
consent to the foregoing.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 answer to your question, but I might later 
(in an iOS context). I'll let you know. :-)


Kevin N.



On 4/21/11 6:02 AM, Glen Pike wrote:

Hi,

I am trying to debug an AIR for Android app in CS5 and am having 
problems with saving shared object data.


Originally it was throwing exceptions - I found a fix to use 
SharedObject.close() after each operation, but it seems that the AIR 
app cannot save to local storage in the IDE.


Tried to google, but not having much luck, can anyone shed some 
light on this?


Thanks

Glen
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 you can just type your keyword into 
Flash's action dialog, or an as document, then click that little ? icon 
- sometimes pulls it right up (after 17 update dialog boxes maybe).


I don't agree with your conclusions about competitiveness based on that 
difficulty, but yeah, it could be better.


Kevin N.


On 4/21/11 1:54 PM, allandt bik-elliott (thefieldcomic.com) wrote:

Hey folks

Every time I do a big search I seem to get a LOT of as2 links and when I add
as3 into the search terms I keep getting links to either a page offering up
a bunch of generic documentation pages (ie not direct links to the class I'm
looking for) or I get class documentation pages that are only half full.
Seriously do a search on the livedocs site for the  flvplayback class, its
shocking especially in light of the fact that there is no longer any local
docs installed with the software any more

What is going on with this? With people (rightly or wrongly) bashing flash
in favour of the yet untried html5 spec, adobe can ill afford this kind of
crap support for the flash platform.

Come on
A
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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
 Mort,
 but I want to remove the one placed there previously, it works if I add the
 two lines right after each other as in the previous email but I really need
 it work more like this.


You have a scope issue. Mort is a local variable, and is no longer there
when you call it the second time. Try moving it up so it's declared in the
class definition, and instantiated in the function.

You have a couple of other problems, too. You have a variable Mort and a
class Mort. You should really make the variable lower case mort, like Jason
suggested.

Also, if that is your entire function, you have other problems. Every time
you call it, you're creating a new Mort (in the variable declaration--var
Mort:MovieClip = new Mort();). That guarantees you that you won't have the
previously created Mort--you just wiped it out on the first line of the
function.

Work with the debugger, Steve. Set some break points, and look at the state
of the variables, follow the logic flow. You'll find you can solve problems
like this more quickly if you understand what's happening in your code.

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Newman
Sent: Friday, April 22, 2011 1:52 PM
To: Flash Coders List
Subject: Re: [Flashcoders] What is up with adobes documentation?

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 you can just type your keyword into Flash's action dialog, or 
an as document, then click that little ? icon
- sometimes pulls it right up (after 17 update dialog boxes maybe).

I don't agree with your conclusions about competitiveness based on that 
difficulty, but yeah, it could be better.

Kevin N.


On 4/21/11 1:54 PM, allandt bik-elliott (thefieldcomic.com) wrote:
 Hey folks

 Every time I do a big search I seem to get a LOT of as2 links and when 
 I add
 as3 into the search terms I keep getting links to either a page 
 offering up a bunch of generic documentation pages (ie not direct 
 links to the class I'm looking for) or I get class documentation pages that 
 are only half full.
 Seriously do a search on the livedocs site for the  flvplayback class, 
 its shocking especially in light of the fact that there is no longer 
 any local docs installed with the software any more

 What is going on with this? With people (rightly or wrongly) bashing 
 flash in favour of the yet untried html5 spec, adobe can ill afford 
 this kind of crap support for the flash platform.

 Come on
 A
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

--
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary. If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender. Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses. 

References to Sender are references to any subsidiary of Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Attachments that are part of this EC may have additional 
important disclosures and disclaimers, which you should read. This message is 
subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
consent to the foregoing.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 
 
 
 
 
 
 ___
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com 
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kevin Newman
 Sent: Friday, April 22, 2011 1:52 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] What is up with adobes documentation?
 
 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 you can just type your keyword into Flash's action 
 dialog, or an as document, then click that little ? icon
 - sometimes pulls it right up (after 17 update dialog boxes maybe).
 
 I don't agree with your conclusions about competitiveness based on that 
 difficulty, but yeah, it could be better.
 
 Kevin N.
 
 
 On 4/21/11 1:54 PM, allandt bik-elliott (thefieldcomic.com) wrote:
 Hey folks
 
 Every time I do a big search I seem to get a LOT of as2 links and when 
 I add
 as3 into the search terms I keep getting links to either a page 
 offering up a bunch of generic documentation pages (ie not direct 
 links to the class I'm looking for) or I get class documentation pages that 
 are only half full.
 Seriously do a search on the livedocs site for the  flvplayback class, 
 its shocking especially in light of the fact that there is no longer 
 any local docs installed with the software any more
 
 What is going on with this? With people (rightly or wrongly) bashing 
 flash in favour of the yet untried html5 spec, adobe can ill afford 
 this kind of crap support for the flash platform.
 
 Come on
 A
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 --
 This message w/attachments (message) is intended solely for the use of the 
 intended recipient(s) and may contain information that is privileged, 
 confidential or proprietary. If you are not an intended recipient, please 
 notify the sender, and then please delete and destroy all copies and 
 attachments, and be advised that any review or dissemination of, or the 
 taking of any action in reliance on, the information contained in or attached 
 to this message is prohibited. 
 Unless specifically indicated, this message is not an offer to sell or a 
 solicitation of any investment products or other financial product or 
 service, an official confirmation of any transaction, or an official 
 statement of Sender. Subject to applicable law, Sender may intercept, 
 monitor, review and retain e-communications (EC) traveling through its 
 networks/systems and may produce any such EC to regulators, law enforcement, 
 in litigation and as required by law. 
 The laws of the country of each sender/recipient may impact the handling of 
 EC, and EC may be archived, supervised and produced in countries other than 
 the country in which you are located. This message cannot be guaranteed to be 
 secure or free of errors or viruses. 
 
 References to Sender are references to any subsidiary of Bank of America 
 Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
 Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
 Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
 Government Agency. Attachments that are part of this EC may have additional 
 important disclosures and disclaimers, which you should read. This message is 
 subject to terms available at the following link: 
 http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
 consent to the foregoing.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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. I find better results with Google.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] quick E4X question

2011-04-22 Thread Mendelsohn, Michael
Hi list...

With this xml, given an a node, I want to find its parent t node.
// not working
var parentT:XMLList = pets..*.(t.contains(acat/a));

thanks,
Michael M.

pets
t n=moe
adog/a
/t
t n=larry
asnake/a
acat/a
/t
t n=curly
amouse/a
/t
/pets


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] quick E4X question

2011-04-22 Thread Keith Reinfeld
var pets:XML = pets
t n=moe
adog/a
/t
t n=larry
asnake/a
acat/a
/t
t n=curly
amouse/a
/t
/pets

var parentT:XMLList = pets..t.(elements().contains(acat/a)).@n;

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net

 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-
 boun...@chattyfig.figleaf.com] On Behalf Of Mendelsohn, Michael
 Sent: Friday, April 22, 2011 2:42 PM
 To: Flash Coders List
 Subject: [Flashcoders] quick E4X question
 
 Hi list...
 
 With this xml, given an a node, I want to find its parent t node.
 // not working
 var parentT:XMLList = pets..*.(t.contains(acat/a));
 
 thanks,
 Michael M.
 
 pets
   t n=moe
   adog/a
   /t
   t n=larry
   asnake/a
   acat/a
   /t
   t n=curly
   amouse/a
   /t
 /pets
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders