RE: [Flashcoders] Flash writing/reading database on MS SQL server
Thanks Karl, I will look into that. Personally I like to use MySQL and PHP, but I am asked to create some app which communicates with MS SQL server. Regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: donderdag 21 april 2011 3:27 To: Flash Coders List Subject: Re: [Flashcoders] Flash writing/reading database on MS SQL server Hi Cor, There a lot of easy to implement php scripts out there. That is what I use. PHP and MySQL. But here is a simple connection script for php to MSSQL for you to try if you'd like. Have not tested myself. FYI. http://www.jonasjohn.de/snippets/php/mssql-example.htm Best, Karl On Apr 20, 2011, at 3:05 PM, Mattheis, Erik (MIN-WSW) wrote: I use Flash remoting with ColdFusion. There's examples for many server side scripting languages that come up when searching for flash femoting as3 [your preferred server thing]. On 4/20/11 2:31 PM, Cor c...@chello.nl wrote: Hi List, I am looking for a way to read/write to a database in a MS SQL server. What do I need to do? What is the best approach? Do I need server side scripting, PHP or ASP? Is there anyone who can help me with a little example? TIA! Regards Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ _ _ Erik Mattheis | Weber Shandwick P: (952) 346.6610 M: (612) 377.2272 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ 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] Test if class is attached to document or symbol?
Micky Hulse skriver: Basically, I needed a way to test if my class was assigned to the FLA as a Document Class, or, if it was assigned to movieclip/sprite in library (export for actionscript) and added to stage manually. You are missing two cases: The first one is if it was never added to any symbol. The second one is if it is assigned to a symbol that has a timeline instance. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] CS5, SharedObject AIR for Android debugging
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
RE: [Flashcoders] Test if class is attached to document or symbol?
Basically, I needed a way to test if my class was assigned to the FLA as a Document Class, or, if it was assigned to movieclip/sprite in library (export for actionscript) and added to stage manually. This is one of those occasional questions where I would ask, even if you could do this, why would it really be necessary from an architectural point of view? I see what you are trying to accomplish technically from in your original post, but the broader architectural question comes into play and something may be off if you're trying to go this route. That's just my thought. 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] video fast forward button
Hi I need to use fast forward button in ns stream video code. How I can forward video to the last point of the video that has been already loaded? Thank you in advance ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
Hi Henrik, thanks so much for the reply/feedback, I really appreciate it. On Thu, Apr 21, 2011 at 1:22 AM, Henrik Andersson he...@henke37.cjb.net wrote: The first one is if it was never added to any symbol. Ah, interesting. Good point. I am thinking that maybe I could check if typeof is object? This could also be where I use a try/catch? The second one is if it is assigned to a symbol that has a timeline instance. Another good point. After I posted my code, I changed this line: public class Test extends Sprite { ... to this: public class Test extends MovieClip { I assume that is how I would account for a timeline instance? Thanks again for the feedback! Cheers, Micky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
Micky Hulse skriver: After I posted my code, I changed this line: public class Test extends Sprite { ... to this: public class Test extends MovieClip { I assume that is how I would account for a timeline instance? Nope. Timeline instances can, but doesn't have to, be Sprites too. And the change is in fact useless for the purpose of detecting this scenario. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
Hi Jason! Thanks so much for the constructive feedback, I really appreciate it. :) On Thu, Apr 21, 2011 at 5:49 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: This is one of those occasional questions where I would ask, even if you could do this, why would it really be necessary from an architectural point of view? I see what you are trying to accomplish technically from in your original post, but the broader architectural question comes into play and something may be off if you're trying to go this route. That's just my thought. Great points/observations. In this case, I am working with a box ad sent by a client... Sometimes they forget to add a clickTAG to their code. I have a different approach for AS 2 FLAs, but sometimes the clients send FLAs that need/utilize AS3... Long story short, occasionally, I have to crack open their FLA and add AS3 clickTAG support. I would say that 99% of the time the client will not be using a document class, so I can easily assign my class to the document and publish. The other one percent of the time, they might have a document class already assigned, so I would just create a MC in the lib and assign my class to that. But, you are right; I should write two classes (one for the different situations). TBTH, I thought I was being cool by trying to handle two situations in one class. :D Anyway, thanks again for the feedback! I will take your advice and change my code. Note: If only these Flash ad designers could remember to add their own clickTAG code, then I would not be making myself look silly in front of all you pro Flash gurus! :D Have a great day! Cheers, Micky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
On Thu, Apr 21, 2011 at 9:50 AM, Micky Hulse mickyhulse.li...@gmail.com wrote: I assume that is how I would account for a timeline instance? Ah, I think I know what you mean now. I could do something like: public function Test($this:Object = null) { ... and use the passed-in value if one has been provided. I have updated my code to use the above concept. Is that what you mean? Like I said to Jason, I think I am going to refactor my code for only one type of situation, but I am still having fun learning new stuff from you folks... Feel free to critique me if I am not fully understanding your suggestions. :) Thanks again! Have a great day! Cheers, Micky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
On Thu, Apr 21, 2011 at 10:03 AM, Henrik Andersson he...@henke37.cjb.net wrote: Nope. Timeline instances can, but doesn't have to, be Sprites too. And the change is in fact useless for the purpose of detecting this scenario. Ah, interesting. Thanks for the clarification! I appreciate the help. :) Have a great day! Cheers, Micky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Test if class is attached to document or symbol?
On Thu, Apr 21, 2011 at 10:18 AM, Micky Hulse mickyhulse.li...@gmail.com wrote: I have updated my code to use the above concept. Is that what you mean? Sorry, here's the url: https://gist.github.com/933493 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] What is up with adobes documentation?
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
Re: [Flashcoders] What is up with adobes documentation?
What does documentation that you, as the developer, use have to do with HTML5? It's a search issue that has absolutely nothing to do with Adobe's PR. On Thu, Apr 21, 2011 at 10:54 AM, allandt bik-elliott (thefieldcomic.com) alla...@gmail.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] What is up with adobes documentation?
went to google put this into the search field FLVPlayback adobe livedocs First link at the top: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html perhaps your not putting in the correct words into google? On Thu, Apr 21, 2011 at 2:30 PM, Bob Wohl bob.w...@gmail.com wrote: What does documentation that you, as the developer, use have to do with HTML5? It's a search issue that has absolutely nothing to do with Adobe's PR. On Thu, Apr 21, 2011 at 10:54 AM, allandt bik-elliott (thefieldcomic.com) alla...@gmail.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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] in AS2, what is the correct way to update a DataGrid's dataProvider
I have a screen with a DataGrid that displays live data, that is, data which is constantly changing. It's not a very large amount of data, so I just make a query to the server every 2 seconds to get the new data. When the new data comes in, the easiest thing to do would be to simply set the dataProvider of the DataGrid to the new data, but this is really crude. For starters, if over-writes imports properties such as how the array is sorted and which items are selected. So, to correct for these problems, what I do is iterate through each item in the dataProvider of the DataGrid, find the corresponding item in the new data and copy its properties to the item in dataProvider, remove any items from the dataProvider that are not in the new data, and then add any items from the new data that aren't in the dataProvider. Needless to say, this is terribly inefficient. So, what should I be doing? This has to be done in AS2 because it is being incorporated in a legacy application. Thanks! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] What is up with adobes documentation?
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 I use Livedocs quite a bit - mostly for ColdFusion - and if you do searches directly from Google you tend to get older Livedocs content just because it's been around longer. For example, if I just type a CFML tag into a Google search, the first Livedocs hit will likely be for CF 7 or even 6 - the current version is 9. And this isn't just an issue with Adobe's documentation. I see it all the time with other documentation - even Google's own documentation. I do a lot of work with the Google Search Appliance, and my first documentation hit for a search on that typically goes to a pretty old version of the appliance. Fortunately, a little Google-fu goes a long way here. You can use helpful search operators to help filter your search to newer document sets. For example, with CF, I can add this to my search: site:livedocs.adobe.com/coldfusion/9 And of course, you can automate this pretty easily in a variety of ways. 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. I think you're making a big leap from one thing to the other here. Flash detractors don't care about the state of Adobe's documentation. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] What is up with adobes documentation?
I agree with this. Also, any professional worth their salt is going to have direct links to any documentation required to do their job. Ross P. Sclafani Design / Technology / Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Apr 21, 2011, at 6:47 PM, Dave Watts dwa...@figleaf.com wrote: I think you're making a big leap from one thing to the other here. Flash detractors don't care about the state of Adobe's documentation ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] How to access MovieClip declared in one function in an event listener
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
Re: [Flashcoders] How to access MovieClip declared in one function in an event listener
read up on event.target. 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
Re: [Flashcoders] What is up with adobes documentation?
Personally I find searching google almost always gives me what I want as long as I use quotation marks around a key phrase, and I must agree that Google's results are not Adobe's fault. To talk about the state of Adobe documentation, I must say that I do find it lacking substance in many key areas; however, it is far better than what I have seen from many other companies. If I had to gripe, I would gripe about the stupid community help interface that, more often than not, gives double scroll bar screw-ups, and even though you select local only, searches the web, unless you go into the settings. Buggy to say the least, and it is quite the memory hog too. Air apps can be done well; yet, I find that anything done with Flex SWCs, or has a super ultra fantastic design, is too slow to work well as a Help window or some other app you could be keeping open for several hours at a time. On 4/21/2011 7:24 PM, Ross Sclafani wrote: I agree with this. Also, any professional worth their salt is going to have direct links to any documentation required to do their job. Ross P. Sclafani Design / Technology / Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Apr 21, 2011, at 6:47 PM, Dave Wattsdwa...@figleaf.com wrote: I think you're making a big leap from one thing to the other here. Flash detractors don't care about the state of Adobe's documentation ___ 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
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
Re: [Flashcoders] in AS2, what is the correct way to update a DataGrid's dataProvider
Hi Andrew, Try this logic. So have an object which holds the sorting details, and another object/array which holds the unique ID/s of the selected rows. Now just implement the dataProvider of the new set on each data load. Then set the sorting and select the ID with try catch as the ID which you already selected might not be in the list. I guess, this will be faster and optimized based on sorting procedures as well. 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 1:52 AM, Andrew Sinning and...@learningware.comwrote: I have a screen with a DataGrid that displays live data, that is, data which is constantly changing. It's not a very large amount of data, so I just make a query to the server every 2 seconds to get the new data. When the new data comes in, the easiest thing to do would be to simply set the dataProvider of the DataGrid to the new data, but this is really crude. For starters, if over-writes imports properties such as how the array is sorted and which items are selected. So, to correct for these problems, what I do is iterate through each item in the dataProvider of the DataGrid, find the corresponding item in the new data and copy its properties to the item in dataProvider, remove any items from the dataProvider that are not in the new data, and then add any items from the new data that aren't in the dataProvider. Needless to say, this is terribly inefficient. So, what should I be doing? This has to be done in AS2 because it is being incorporated in a legacy application. 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
RE: [Flashcoders] How to access MovieClip declared in one function in an event listener
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
Re: [Flashcoders] How to access MovieClip declared in one function in an event listener
Steve, You can also track by using event.currentTarget, like this: function DoSomething(e:MouseEvent):void{ trace((event.currentTarget).TextField.text); } -- Greetings! Hope this message of mine finds you in best of health and spirits. On Fri, Apr 22, 2011 at 10:05 AM, Steve Abaffy st...@msmarketing.bizwrote: 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