Re: [Flashcoders] Testing before removing a child
If I understand properly what you mean, the contains method is what you're looking for. if (loader_clip.contains(ldr)){ loader_clip.removeChild(ldr); } http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html#contains%28%29 On Wed, Nov 18, 2009 at 8:25 PM, Gregory Boland breakfastcof...@gmail.comwrote: try .numChildren property On Wed, Nov 18, 2009 at 4:48 PM, Alan Neilsen aneil...@gotafe.vic.edu.au wrote: I am using loader_clip.removeChild(ldr); to remove child objects from my loader clip, and I want to test if a child object is there before removing it. I thought it would be something like if (loader_clip.child !=0) { // or !=, or !=null, or ==true, or something like that loader_clip.removeChild(ldr); } But when I trace (loader_clip.child) it comes back undefined whether the child is still there or not. What can I use to test this so loader_clip.removeChild(ldr); doesn't produce an error if the child has already been removed? Alan Neilsen This message is for the named person’s use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or; lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. GOULBURN OVENS INSTITUTE OF TAFE and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of any such entity. # This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal # ___ 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] Overriding the trace command
As everyone else mentioned, I don't think there's a way to override the trace function in as3. However, if you put a public function in the unnamed package, your application will be able to reach this function from anywhere, so if you're willing to use something else like log() or debug() as a method name instead of trace(), then you can replicate the trace function's behavior and add your own customizations. I've been using this to route my traces to AirLogger, for example. As a quick demo, this would just route your arguments to the trace function. Just put the following code in a file called debug.as in the root of your classpath. package { public function debug(...args):void { trace.apply(null, args); } } Hope this helps! On Tue, Jul 15, 2008 at 10:08 AM, Juan Pablo Califano [EMAIL PROTECTED] wrote: I'm afraid you can't extend the trace builtin function . Using another function or logging class and then redirecting the trace to some logger console or even the trace() function, if at some point you need it, is the way to go. MTASC handles that trace replacement through a compiler switch, like a preprocessor macro, making textual substitutions to trace calls in the AS. The thing is that trace function is not compiled into a call to an actionscript function, but it's embedded directly with its own bytcode in the swf. That's why you can't change its behaviour from AS code. Cheers Juan Pablo Califano 2008/7/15, Adam Jowett [EMAIL PROTECTED]: Hi all, A very quick one, I haven't had to over-ride or extend built in classes since the good old days of prototyping in AS1, specifically this time I want to extend the built in trace() statement with some conditions etc. Can this be done? or do I need to do my own custom logger such as those out there at the moment? Cheers Adam ___ 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] FitFlash - smart flash resize script
Sweet, glad to hear this. The auto-scrollbar feature was one of the main reasons I started this project over 2 years ago. BTW, I've moved the project to google code a while ago. http://code.google.com/p/swfin/ On 10/19/07, Izaias | Grafikonstruct [EMAIL PROTECTED] wrote: I like it so much! I have seen on a lot of websites where simply not is possible navegate using a small browser window. I'm using another great solution to resolve it: The swfIN, created by http://nectere.ca. Izaias Cavalcanti - Grafikonstruct http://www.grafikonstruct.com.br -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de Ruy Adorno Enviada em: quinta-feira, 18 de outubro de 2007 20:40 Para: flashcoders@chattyfig.figleaf.com Assunto: [Flashcoders] FitFlash - smart flash resize script A friend o'mine made a javascript that automatically resizes flash to 100% wid/hei when the browser window is greater than the minimum desired size and resizes flash to the minimum desired size when the browser window is smaller... it makes the default browser scroll appears and make the content more accessible.. i think it's very useful for flash sites that uses 100% wid/hei.. http://fitflash.millermedeiros.com/ Ruy Adorno ___ 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] Photoshop CS3 breaks Flash development workflow
Hey Steven, you can always go another route to have the same result. At the bottom of the History palette, there's a button called Create new document from current state. You could use this and then flatten the image. I'm not sure if you're using this action to export to PNG/JPG, but I've been using an action to do this that I'd like to share, it's been incredibly useful for me. I've mapped it to F2, so I can just set the desired selection and hit the shortcut. 1. Create new document from current state 2. Crop (it will remember the previous selection) 3. save (with prompt) 4. close (no save) Try it out here: http://www.nectere.ca/ps_actions.zip F3 is mapped to the same behavior, but it also expands the canvas with an additional 2 pixels transparent border ( oldschool bitmap shift fix ). On 9/5/07, Andreas Rønning [EMAIL PROTECTED] wrote: Specific to yours anyway. Regardless, i can definitely see the frustration. I'm more keen on Adobe fixing the ridiculous issues with the Flash CS3 UI though. The insane depth sorting of windows (i love it when my library tab comes out underneath the output window) and how CS3 basically crawls whenever i drag a window (nice fancy transparency effect there) really, really, really detract from the other benefits of upgrading. Thank god i only script in Flashdevelop. I'm surprised the new actions record clipboard dimensions for copy actions. That's pretty incredible. - Andreas R - Original Message - From: Steven Sacks [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Thursday, September 6, 2007 1:16:31 AM (GMT+0100) Europe/Berlin Subject: Re: [Flashcoders] Photoshop CS3 breaks Flash development workflow It's not OT because it's specific to Flash development. Glen Pike wrote: Someone broke mine by changing the Back and Forward functionality in Thunderbird - now reading threaded mails from Flashcoders is a nightmare - I have to close thje one I am reading and click on the next one because the new Previous Next buttons are broken. Coupled with OT messages, my RSI is starting to get really bad... :) Steven Sacks wrote: And I'd like to also add that if you set the Make action (new document) to have a Modal dialog pop-up so you can set the dimensions manually during that step of the action, the option in the drop-down to choose Clipboard is disabled. That's right, the default Photoshop behavior is disabled! For no reason! WTF??? Steven Sacks wrote: So I upgraded to CS3 and Flash development workflow is broken. Photoshop CS3 actions do not work like all previous versions of Photoshop. I have an action I've used in Photoshop for YEARS which I call Breakup. All this action does is 1. Copy Merged 2. Create New Document 3. Paste The default behavior in Photoshop when you copy and then create a new document is to use the size of the clipboard to determine the dimensions of the new file. In Photoshop CS2 and prior, if you record an action with these three steps, it does not hard-code the dimensions of the new document and instead INTELLIGENTLY defers to Photoshop's DEFAULT BEHAVIOR of using the clipboard to determine dimensions. In Photoshop CS3, it records the specific dimensions of the clipboard when you recorded the copy merged action and you cannot alter this AT ALL! As far as I'm concerned, this is BROKEN. The reason it is BROKEN is because ALL VERSIONS BEFORE CS3 did not behave this way. The reason it is BROKEN is because it stupidly overrides Photoshop's INTELLIGENT DEFAULT BEHAVIOR for no reason. I am now forced to uninstall Photoshop CS3 and use CS2 until this is fixed. Who do I complain to? This action is critical for me to do breakup for Flash without wanting to quit and join a monestary. The Photoshop import in Flash CS3 is not good enough to make up for this kind of broken behavior and now I can't use Photoshop CS3 which means I wasted money on a product I can't use. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf
Re: [Flashcoders] Runtime shared library loading problem
All relative paths in any swfs loaded in your application will use the HTML page as their base path, not their own personal location. Like you already mentioned, you can change this base path by using the base param while embedding. You just need to make all external assets loading to always be relative to the HTML page or the specified base path. Hope this helps On 7/28/07, Kannan Bharadwaj [EMAIL PROTECTED] wrote: Hi, I have a flash movieclip container that I use to load all my swf files. I use SWFObject to load this flash container inside the html file and I pass my swf filename as a variable. This works fine as long as my swf files do not contain objects that need to be loaded at runtime. When I have such objects, they do not seem to get loaded. If I load my swf file directly using SWFObject and specify base param to indicate the path to the runtime files, it works fine. The problem happens only when I load my swf file through a container. Any help would be really appreciated. Thanks Kannan ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash movie background color not showing in Firefox browser...
Here's a wild guess: Could you be using both an embed and an object tag when you're embedding? Maybe you're defining the bgcolor attribute in the embed tag only and not in the object? Firefox would use the embed tag and IE the object tag. That's really the only thing that could be browser specific I can think of. If that turned out to be the problem, you should take a look at the different javascript embedding solutions out there to make this process less painful (SWFObject being the most common solution). Hope this helps, - Francis On 7/22/07, Arul Prasad M L [EMAIL PROTECTED] wrote: you dont have wmode set to transparent, do you? ~Arul Prasad. On 7/23/07, BOYD SPEER [EMAIL PROTECTED] wrote: Yes I did check the html and the color is correct there (#99)... but as a workaround I will add a layer to insure the movie appears the same in each browser. I am surprised that flash would behave in such a manner - re-loading the adobe flash player did not make any difference and the problem looked the same on both my, and my client's computers. If anyone can think of the cause of this problem I would really appreciate your thoughts on it Thanks guys, -Boyd - Original Message - From: Marc Hoffman [EMAIL PROTECTED] Date: Sunday, July 22, 2007 4:39 pm Subject: Re: [Flashcoders] Flash movie background color not showing in Firefox browser... To: flashcoders@chattyfig.figleaf.com Make sure the bgcolor in the html code for embedding the flash movie is correct. I can't think of any other reason you'd have these symptoms. Marc Hoffman At 01:52 PM 7/22/2007, you wrote: Hi, You probably want to create a bg layer in you flash movie that has the correct color! A:)= On 7/22/07 11:48 AM, BOYD SPEER [EMAIL PROTECTED] wrote: Is there any special setting that would affect the movie background color when displayed in Firefox as opposed to Internet Explorer? My webpage looks fine in IE but the background color in Firefox changes to white instead of the #99 dark red (that it shows in IE). This means the white text becomes invisible! Thanks, -Boyd ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Arul Prasad http://arulprasad.blogspot.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Skewing text
I'm actually working on something similar for AS3 at the moment since using papervision / having a Z axis would only complicate things for nothing in my situation. I've found a very nice snippet of AS1/2 code from senocular on the topic: http://www.actionscript.org/forums/showthread.php3?t=128444page=2 Hope this helps! On 7/2/07, Zeh Fernando [EMAIL PROTECTED] wrote: I need to skew some text to give the impression it is going off into the distance (think opening text on Star Wars, though without movement). I know this effect can be done using the triangular method as used in Papervision. However I'm not creating a 3D scene here, I just want the skewing. Can this be easily done with Papervision, or can anyone recommend any other resource (AS2 only)? I understand the principles behind the technique, I just don't want to re-invent the wheel by implementing from scratch. The effect is not just skewing. It *is* 3d, in the meaning that the perspective is distorted because the middle points are moved away depending on the angle. So yes, your faster/best bet would be to use any 3d class such as Papervision3D. It should be fairly simple as you'll just need a rotated plane with the content of a movieclip projected on it. Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Francis Turmel Personal: [EMAIL PROTECTED] Business: [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Inserting FLV Message events
This is what you want: http://www.buraks.com/captionate/ Fixes metadata, insert cuepoints properly, export/import xml data file containing cuepoint infos, etc. There's no demo, but trust me, it really saved me on a project and is absolutely worth it. Good luck On 12/21/06, Chris McFadyen aka Grayson Carlyle [EMAIL PROTECTED] wrote: Is it possible? I've seen programs that can manipulate cue points, but I don't know the least bit about message events in an flv. Specifically what I'm looking for is the ability to copy them out of one flv and insert into another. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Global sound control ...
You can also just skip the _root param and leave the constructor empty like this: var s:Sound = new Sound(); On 10/15/06, Paul Neave [EMAIL PROTECTED] wrote: The best way to turn sounds off isn't to use stopAllSounds() as that will only stop the sounds at that moment, not mute them permanently. If you're using timeline-based code, you can do this: s = new Sound(_root); s.setVolume(0); and to un-mute the sound: s.setVolume(100); Simple. Of course, it uses _root (which is evil) but I think this is forgivable in this instance. Best, Paul. On 11/10/06, Stephen Ford [EMAIL PROTECTED] wrote: I have an interactive demo that consists of one main SWF file that loads in other SWF files depending on what the user clicks on in the main SWFs navigation. Within this main SWF and within all the seperate SWFs are numerous movies each with their own timeline doing it's own thing. In numerous place on timelines throughout this set of SWFs, sound effects have been hardcoded onto their respective timeline (i.e: not loaded dynamically using the sound object). So is there any way to turn off sound globally regardless of where it's located on whatever timeline within whatever SWF. So I can just create an on/off button for the main SWF that will control sound globally ??? Thanks.___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Francis Turmel Personal: [EMAIL PROTECTED] Business: [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] movieclip._y = textField._height
Interesting. In my experience though I didn't have to wait a frame for the fix to work. Two consecutive references to the textHeight would make the second one give the proper value, but I'd love to get to the bottom of this and understand why this is happening. If I can find a minute I'll dig up some old files and do some testing. - Francis On 9/29/06, John Grden [EMAIL PROTECTED] wrote: Keith Peters just told me about an old issue that _width is the actual last property set on a movieclip. So, when width was ready, then it was fully initialized. I assume that's why waiting until frame2 works. if you were using MovieClipLoader, you could do your calcs when onLoadInit() fires and safely set your coordinates. I know I'm late to the discussion on a solution ;) PS cussing doesn't bother me - it's the reason WHY I cuss that bothers me ;) Developers cuss. That's a fact. They just do it off list ;) On 9/29/06, Lieven Cardoen [EMAIL PROTECTED] wrote: It looks more like you have to wait a frame to get the correct height. Strange thing is that most of the times, getting the height works fine, but once in a while it fails. Lieven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francis Turmel Sent: donderdag 28 september 2006 20:09 To: Flashcoders mailing list Subject: Re: [Flashcoders] movieclip._y = textField._height I wrote my solution to this a couple weeks ago (never got any answers if it worked for the person who asked though). take a look here: http://chattyfig.figleaf.com/pipermail/flashcoders/2006-August/170985.ht ml It seems that the first use of a text height in actionscript can be unreliable but from the second time you reference it it looks fine. So if my theory holds its ground, your first use (the trace()) would print out the wrong value, but your assignment afterwards will be ok. Remove the trace and it shouldn't work. I'd love to have some feedback on this, its an intriguing one. hope this helps, - Francis On 9/28/06, vic [EMAIL PROTECTED] wrote: Haha, I would seriously take that bet. You have to listen to what he is saying, xray will trip you out; not only can you control anything in your swf at runtime but you can also view all of its properties. I am new to it so i don't know all it can do but I KNOW it can help you with _height. V - Original Message - From: John Grden [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, September 28, 2006 9:17 AM Subject: Re: [Flashcoders] movieclip._y = textField._height sure it does (xray) - it has a logger too and it includes a timestamp (which trace does not) - so, I would say it's actually a bit stronger of a tool for timing issues ;) I got $20 that says he figures out the problem in under 10 minutes with xray. :) On 9/28/06, Brian Williams [EMAIL PROTECTED] wrote: A trap I often fall into when debugging flash is missing the obvious. Take for example, If I put movieclip._y = 60 , it works fine If I put movieclip._y = textField._height , it doesn't work fine and then trace(textField._height) prints 60, yes. then my question would be - did you trace at the same point in time that set _y? i.e. does your code look like trace(textField._height); movieclip._y = textField._height; if that prints 60, and the movieclip ends up at 0, then what that means, most likely, is that you set it 60, but then set it to 0 somewhere else. I've often lost an hour trying to debug similar issues. It traces out to something and I set it to that, but it doesn't work. Well, maybe it did, and then some other point of the code changes the _y value. Or you had a typo, etc. Maybe the textField's height is 60 once it has text in it, but you're setting the y position before you put in the text. And so on. Xray is a great tool for inspecting the program's run-time state, but it doesn't help as much with debugging timing dependencies. --Brian ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders
Re: [Flashcoders] movieclip._y = textField._height
I wrote my solution to this a couple weeks ago (never got any answers if it worked for the person who asked though). take a look here: http://chattyfig.figleaf.com/pipermail/flashcoders/2006-August/170985.html It seems that the first use of a text height in actionscript can be unreliable but from the second time you reference it it looks fine. So if my theory holds its ground, your first use (the trace()) would print out the wrong value, but your assignment afterwards will be ok. Remove the trace and it shouldn't work. I'd love to have some feedback on this, its an intriguing one. hope this helps, - Francis On 9/28/06, vic [EMAIL PROTECTED] wrote: Haha, I would seriously take that bet. You have to listen to what he is saying, xray will trip you out; not only can you control anything in your swf at runtime but you can also view all of its properties. I am new to it so i don't know all it can do but I KNOW it can help you with _height. V - Original Message - From: John Grden [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, September 28, 2006 9:17 AM Subject: Re: [Flashcoders] movieclip._y = textField._height sure it does (xray) - it has a logger too and it includes a timestamp (which trace does not) - so, I would say it's actually a bit stronger of a tool for timing issues ;) I got $20 that says he figures out the problem in under 10 minutes with xray. :) On 9/28/06, Brian Williams [EMAIL PROTECTED] wrote: A trap I often fall into when debugging flash is missing the obvious. Take for example, If I put movieclip._y = 60 , it works fine If I put movieclip._y = textField._height , it doesn't work fine and then trace(textField._height) prints 60, yes. then my question would be - did you trace at the same point in time that set _y? i.e. does your code look like trace(textField._height); movieclip._y = textField._height; if that prints 60, and the movieclip ends up at 0, then what that means, most likely, is that you set it 60, but then set it to 0 somewhere else. I've often lost an hour trying to debug similar issues. It traces out to something and I set it to that, but it doesn't work. Well, maybe it did, and then some other point of the code changes the _y value. Or you had a typo, etc. Maybe the textField's height is 60 once it has text in it, but you're setting the y position before you put in the text. And so on. Xray is a great tool for inspecting the program's run-time state, but it doesn't help as much with debugging timing dependencies. --Brian ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Francis Turmel Personal: [EMAIL PROTECTED] Business: [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Associate clip with class
If this can be useful to anyone, I modified Danny's class to fit my needs and used it on several projects so far. Works like a charm. class ca.nectere.utils.ClassUtils{ //create a movieClip and associate a class with it static public function CreateWithClass( classRef:Function, target:MovieClip, name:String, depth:Number, params:Object ){ var mc:MovieClip=target.createEmptyMovieClip(name,depth); mc.__proto__ = classRef.prototype; if (params != null) for (var i in params) mc[i]=params[i]; classRef.apply(mc); return mc; } //attach a movieClip from the library and associate a class with it static public function AttachWithClass( classRef:Function, target:MovieClip, id:String, name:String, depth:Number, params:Object ){ var mc:MovieClip = target.attachMovie(id, name, depth, params); mc.__proto__ = classRef.prototype; classRef.apply(mc); return mc; } //link a class with an existing movieClip, use for _root / timeline association static public function LinkWithClass( classRef:Function, target:MovieClip ){ var mc:MovieClip = target; mc.__proto__ = classRef.prototype; classRef.apply(mc); return target; } } On 9/20/06, Adam Pasztory [EMAIL PROTECTED] wrote: I'm not a big fan of using Object.registerClass(). I find it creates a dependency between code and art assets that can be problematic. If your MovieClip is changed, your won't be able to instantiate anymore. Another problem with registerClass() is that it makes it difficult to change the source of the movie clip. For example, if I decide I'd like to load an external SWF instead of attaching a clip from the library, my class won't work anymore. Like Jason, I use containment most of the time to encapsulate movie clips. On 9/20/06, slangeberg [EMAIL PROTECTED] wrote: Eka, Can you tell us what you're trying to accomplish with that DisplayFactory? Usage example? Scott On 9/20/06, eka [EMAIL PROTECTED] wrote: Hello :) with Vegas : http://osflash.org/vegas you can use the class DisplayFactory : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/util/factory/DisplayFactory.as Install the AS2 src of vegas in your classpaths and test the example : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/vegas/util/factory/ You can try my example too in Lunas, the Components library extension of vegas : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/lunas/display/components/button/ EKA+ :) 2006/9/20, Alain Rousseau [EMAIL PROTECTED]: There is an interesting article on the subject in the Flashcoder's Wiki at osflash.org : http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_movieclip_without_a_symbol_in_the_library With this approach you can create a class that extends MovieClip and then create an instance of that class without a symbol in the library. I found it very useful and really neat ! works like a charm ! Alain Geoff Stearns wrote: it does work in flash 8. as for clips on the stage, it does work, you just have to give the clip a linkage ID in the library first, and use that linkage to register the class to it. On Sep 19, 2006, at 5:31 PM, slangeberg wrote: Does Object.registerClass() work in Flash 8 (i haven't been able to get it to work)? Also, does that allow you to register more than one clip with a class? The documentation seems to point to using the Linkage setting for AS2: * Availability: *ActionScript 1.0; Flash Player 6 - If you are using ActionScript 2.0 classes, you can use the ActionScript 2.0 Class field in the Linkage Properties or Symbol Properties dialog box to associate an object with a class instead of using this method. Also, I don't think it works for clips that you've dragged to the stage: When an instance of the specified movie clip symbol is created by using MovieClip.attachMovie() or MovieClip.duplicateMovieClip(), it is registered to the class specified by theClass Scott On 9/19/06, Geoff Stearns [EMAIL PROTECTED] wrote: that article was only meant for assigning a class to your _root timeline... I don't think he intended it to be used for other movieclips in the library or on stage. for that you could just use the linkage in the library or use Object.registerClass() On Sep 19, 2006, at 4:29 PM, slangeberg wrote: I was looking at Danny's article regarding a Flash Document Class at: http://www.dannypatterson.com/Resources/Blog/EntryDetail.cfm?id=106 And i started to wonder if people are using this to associate their clips on stage with a class? Are people doing this kind of thing (or otherwise)
Re: [Flashcoders] Associate clip with class
hrm actually heres a slightly revised version. Hope this helps class ca.nectere.utils.ClassUtils{ //create a movieClip and associate a class with it static public function CreateWithClass( classRef:Function, target:MovieClip, name:String, depth:Number, params:Object ){ if (depth == null) target.getNextHighestDepth(); var mc:MovieClip=target.createEmptyMovieClip(name,depth); LinkWithClass(classRef, mc); if (params != null) for (var i in params) mc[i]=params[i]; return mc; } //attach a movieClip from the library and associate a class with it static public function AttachWithClass( classRef:Function, target:MovieClip, id:String, name:String, depth:Number, params:Object ){ if (depth == null) target.getNextHighestDepth(); var mc:MovieClip = target.attachMovie(id, name, depth, params); LinkWithClass(classRef, mc); return mc; } //link a class with an existing movieClip, use for _root / timeline association static public function LinkWithClass( classRef:Function, target:MovieClip ){ target.__proto__ = classRef.prototype; classRef.apply(target); return target; } } On 9/20/06, Francis Turmel [EMAIL PROTECTED] wrote: If this can be useful to anyone, I modified Danny's class to fit my needs and used it on several projects so far. Works like a charm. class ca.nectere.utils.ClassUtils{ //create a movieClip and associate a class with it static public function CreateWithClass( classRef:Function, target:MovieClip, name:String, depth:Number, params:Object ){ var mc:MovieClip=target.createEmptyMovieClip(name,depth); mc.__proto__ = classRef.prototype; if (params != null) for (var i in params) mc[i]=params[i]; classRef.apply(mc); return mc; } //attach a movieClip from the library and associate a class with it static public function AttachWithClass( classRef:Function, target:MovieClip, id:String, name:String, depth:Number, params:Object ){ var mc:MovieClip = target.attachMovie(id, name, depth, params); mc.__proto__ = classRef.prototype; classRef.apply(mc); return mc; } //link a class with an existing movieClip, use for _root / timeline association static public function LinkWithClass( classRef:Function, target:MovieClip ){ var mc:MovieClip = target; mc.__proto__ = classRef.prototype; classRef.apply(mc); return target; } } On 9/20/06, Adam Pasztory [EMAIL PROTECTED] wrote: I'm not a big fan of using Object.registerClass(). I find it creates a dependency between code and art assets that can be problematic. If your MovieClip is changed, your won't be able to instantiate anymore. Another problem with registerClass() is that it makes it difficult to change the source of the movie clip. For example, if I decide I'd like to load an external SWF instead of attaching a clip from the library, my class won't work anymore. Like Jason, I use containment most of the time to encapsulate movie clips. On 9/20/06, slangeberg [EMAIL PROTECTED] wrote: Eka, Can you tell us what you're trying to accomplish with that DisplayFactory? Usage example? Scott On 9/20/06, eka [EMAIL PROTECTED] wrote: Hello :) with Vegas : http://osflash.org/vegas you can use the class DisplayFactory : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/util/factory/DisplayFactory.as Install the AS2 src of vegas in your classpaths and test the example : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/vegas/util/factory/ You can try my example too in Lunas, the Components library extension of vegas : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/lunas/display/components/button/ EKA+ :) 2006/9/20, Alain Rousseau [EMAIL PROTECTED] : There is an interesting article on the subject in the Flashcoder's Wiki at osflash.org : http://www.osflash.org/flashcoders/as2#creating_a_class_instance_based_on_movieclip_without_a_symbol_in_the_library With this approach you can create a class that extends MovieClip and then create an instance of that class without a symbol in the library. I found it very useful and really neat ! works like a charm ! Alain Geoff Stearns wrote: it does work in flash 8. as for clips on the stage, it does work, you just have to give the clip a linkage ID in the library first, and use that linkage to register the class to it. On Sep 19, 2006, at 5:31 PM, slangeberg wrote: Does Object.registerClass() work in Flash 8 (i haven't been able to get it to work)? Also, does that allow you to register more than one clip with a class? The documentation seems to point to using the Linkage setting for AS2
Re: [Flashcoders] can XML object POST HTTP variables?
hrm nevermind my comment, I was thinking about just doing a load(), not sendAndLoad() late, need sleep :) On 9/10/06, Francis Turmel [EMAIL PROTECTED] wrote: Just to add quickly to that, you will have to use the onData handler to get the raw data. From there you can create a new XML object. http://tinyurl.com/paufb [onData livedocs link] On 9/10/06, Robert Stuttaford [EMAIL PROTECTED] wrote: Have a loadvars target an xml object as it's load target :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Sent: 10 September 2006 09:27 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] can XML object POST HTTP variables? Hi I was wondering if anyone has the same problem as me, I have an application on my server which usually receives input from HTML forms via POST method. I can replicate this using FLASH with sendAndLoad() method. The application sends it's response back in XML so I would like to use the XML object, but I can't find in documentation if XLM object will send variables in POST format, only that it will send XML in POST format, which is not what I need. I am using Flash 8 Pro. Thankyou James ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 2006/09/08 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 2006/09/08 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] can XML object POST HTTP variables?
Just to add quickly to that, you will have to use the onData handler to get the raw data. From there you can create a new XML object. http://tinyurl.com/paufb [onData livedocs link] On 9/10/06, Robert Stuttaford [EMAIL PROTECTED] wrote: Have a loadvars target an xml object as it's load target :) -Original Message- From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On Behalf Of James Sent: 10 September 2006 09:27 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] can XML object POST HTTP variables? Hi I was wondering if anyone has the same problem as me, I have an application on my server which usually receives input from HTML forms via POST method. I can replicate this using FLASH with sendAndLoad() method. The application sends it's response back in XML so I would like to use the XML object, but I can't find in documentation if XLM object will send variables in POST format, only that it will send XML in POST format, which is not what I need. I am using Flash 8 Pro. Thankyou James ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 2006/09/08 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 2006/09/08 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Regular Expressions
Hey everyone, I was just wondering what was the current state of porting an AS 2.0 Regex class was in the community. I know about this little project (http://www.jurjans.lv/flash/RegExp.html ) but it looks far from being MTASC friendly and even has String prototypes peppered in it. I've heard of people doing it with javascript / external interface. How does that solution work for those of you who've tried it? Finally, I can see ( http://livedocs.macromedia.com/flex/2/langref/RegExp.html) that its already done for AS 3, which is great news. Anyone know if this is an external class that could be ported back to AS 2 or is it precompiled / integrated? just checking the pulse :) thanks! - Francis ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] TextField._height reported incorrectly with wordWrap = true
I'm not sure if this will actualy be related to the problem you have, but I've had issues with textfields heights lately and this is what I've figured out: - Use the TextField.textHeight property http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary774.html - There seems to be a bug with this property that I can't always reproduce. The first time you try to access it, it will give you the height for one line only (as if it can't see the wrap yet), but after more than one reference, you will get the proper value from it. Here's a quick proto wrapper for this. Let me know if it actually helped: TextField.prototype.getTextHeight = function() { var t = this.textHeight; return this.textHeight; }; ASSetPropFlags(TextField.prototype, getTextHeight, 1, 0); Good luck! - Francis On 8/11/06, Matthias Dittgen [EMAIL PROTECTED] wrote: this happens to me only sometimes and when I use negative leadings. Try to encapsulate your textfield with a movieclip and grab the height of the movieclip instead of the textfield height. That's the common workaround, I think. Have fun, Matthias 2006/8/11, Kjel Anderson [EMAIL PROTECTED]: No IDE for Linux yet :( Can't find any coding errors. Single line text fields are lining up just fine. When I ask flash for the size of the double line text field, it adds thirteen to the _height. I am using embedded fonts. Maybe I'll try it without the embedded fonts. Kjel On Friday 11 August 2006 12:47 pm, Ramon Miguel M. Tayag wrote: My runs fine. I didn't try it with MTASC though. Have you tried using the IDE? It should be the same either case though... On 8/12/06, Kjel Anderson [EMAIL PROTECTED] wrote: Hey list, Has anyone had a problem with textField._height being reported incorrectly when the text wraps to a second line? I tried to get around this by using the ._height variable of the MovieClip in question, but it is reporting it's height incorrectly as well. I am using the latest version of MTASC. Thanks, Kjel ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com