RE: [Flashcoders] TextFormat Font Face = 'Wingdings' or 'Webdings'
Jason The only way I can ever get the dings fonts to display in a dynamic tf is by embedding them - even if they are on the users system. I assume this is something to do with the dings family being a symbol font. M He suggested I trace the font on the textfield, which is not the same thing, and I was responding to that comment. It's tracing Wingdings on the textfield's TextFormat.font, it's just not rendering Wingdings on the screen. Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions ___ 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 + Web Services problems
What does your crossdomain.xml file look like? Mike ___ 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 + Web Services problems
Try adding a domain=* attribute to cross-domain-policy, and a allow-access-from domain=* / node to your cross-domain-policy nodes. Let me know if this works so I can feel a smug sense of satisfaction. Mike ___ 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 + Web Services problems
Like this: ?xml version=1.0? cross-domain-policy domain=* / allow-access-from domain=somedomain secure=false / allow-access-from domain=anotherdomain secure=false / allow-access-from domain=* / /cross-domain-policy Mike ___ 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] getURL and IE 6.0.
- This works fine for me. Try putting it in an html file uploading it - it might just be a local problem. The only issue I have is that a second click will not bring the window into focus - so you might want to consider a javascript option. Mike Adrian Ionut Beschea wrote: I need the browser to open a new window but if I press my button multiple times I want to get to that same window. Jim Berkey [EMAIL PROTECTED] wrote: Try it without the second paramater: test_btn.onRelease= getThatURL; function getThatURL() { getURL(http://www.example.com/script.php;); } *** REPLY SEPARATOR *** On 9/4/2006 at 4:04 AM Adrian Ionut Beschea wrote: Hello, I want to use getURL to open the exact same window whenever a user pushes the button. The code is this : test_btn.onRelease= getThatURL; function getThatURL() { getURL(http://www.example.com/script.php,window_name;); } It works fine in Firefox, but in IE 6.0. it keeps opening new windows. Am I doing something wrong ? Is there a workaround this problem ? Thanks. Adi. PS I am exporting for flash 7 as version: 2.0 - Get your email and more, right on the new Yahoo.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 o ___ 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 - Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. ___ 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 -- - Mike Cobb Creative Director HMC Interactive - Tel: + 44 (0)845 20 11 462 Mob: + 44 (0)785 52 54 743 Web: http://www.hmcinteractive.co.uk - Grosvenor House, Belgrave Lane, Plymouth, PL4 7DA, UK. - I've got a new e-mail address: [EMAIL PROTECTED] Please update your address book. 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] Text background
- Hi! I've got a tricky problem which I want to put to the list: Does anyone know any way to style a chunk of text with a background colour? I've got a dynamic multi-line textfield bringing in html text. Flash has no CSS support for background-color, so I would like to find a workaround for adding a background to portions of text. Flash 8, AS2 Any ideas? Mike -- - Mike Cobb Creative Director HMC Interactive - Tel: + 44 (0)845 20 11 462 Mob: + 44 (0)785 52 54 743 Web: http://www.hmcinteractive.co.uk - Grosvenor House, Belgrave Lane, Plymouth, PL4 7DA, UK. - I've got a new e-mail address: [EMAIL PROTECTED] Please update your address book. 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
RE: [Flashcoders] weird class could not be loaded.
What's the path? Is the class name actually myClass? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Christian Pugliese Sent: Tuesday, September 05, 2006 2:31 PM To: Flashcoders mailing list Subject: [Flashcoders] weird class could not be loaded. Ok, this is driving me nuts... Everything is working and ok: path, declaration, the fla compiles alright... but when i check the syntax on the .as where i'm importing the class, i get the following error: - The class or interface 'myClass' could not be loaded. again, the classpath and declaration is ok... anybody already got something like this?? is this a bug? is this an ufo? cheers ___ 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] Synchronizing multiple flvs
If the tiles were small enough this could be something you could do with bitmapData - ie. Copying the image data from a master video (offstage) into each of the tiles as it's played. Or you could just mask multiple copies of the same flv, but I suspect there would be bigger overheads with this technique. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Gomes Sent: 06 September 2006 16:46 To: Flashcoders mailing list; flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Synchronizing multiple flvs Would the tiles be contiguous and stationary with instantaneous jumps from one position to another, or do their positions have to animate from one location to another? At 08:38 9/6/2006, Christopher Whiteford wrote: I am looking to find out if anyone has experience in splitting an FLV into multiple parts and then playing them back whereas the the timing is seamless? The reason I ask is I need to create a picture tile game which is easy enough but the client came back with this where 15 tiles playing the same flv broken into different pieces need to be unscrambled and the result would be one big video. Any help would be greatly appreciated. CW ... ___ 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] Re:Adjust .swf to 100 % to screen size
Jorge, here's an example of using ExternalInterface to send stage dimensions to JavaScript. http://www.randomusa.com/flash/downloads/externalInterface_screenDimensions.zip Hope I'm not OT on this one. Mike ___ 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] Job postings ok?
imho it's a distraction from the point of the list, which is coding, and for this reason it's borderline unethical. Just my opinion. Mike ___ 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] [JOB] Sr. Flash/AS Programmers (4), Los Angeles, CA | 70-125k
This is a ridiculous analogy, but to me, a job post here is kind of like jumping up on stage in the middle of a play with an advertisement for a nearby coffee shop. You have the target demographic's attention, but not in context. Mike ___ 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] Job postings ok?
I'm surprised people are ok w/ job posts here. if (!codeRelatedPost) offTopic = true; Can a FlashJobPosts list be started? Job posts show us options, sure, but they aren't about code, they are about jobs. Mike ___ 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] XML id attribute shortcut not working?
No prob! You could also use the associative array syntax: _xml[idMap][myID] Altering the class is more elegant (and something Macromedia should have done in the first place, of course), but if someone else has to compile it, you may want to use the associative array cheat and mark it with a KLUDGE comment. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Rifled Cloaca Sent: Thursday, September 07, 2006 3:59 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] XML id attribute shortcut not working? All, It seems to be due to a bug in the base XML class definition. If you want to use idMap in Flash 8, you'll need to edit your XML.as class to add the attrib. Thanks again! On 9/7/06, Rifled Cloaca [EMAIL PROTECTED] wrote: Thanks, It works by itself, but if I try to use it in a class with an XML object in it, I get: There is no property with the name 'idMap'. It's defined as type XML. What's up? Thanks! On 9/7/06, Mike Keesey [EMAIL PROTECTED] wrote: Use the XML.idMap property. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Rifled Cloaca Sent: Thursday, September 07, 2006 3:27 PM To: Flashcoders mailing list Subject: [Flashcoders] XML id attribute shortcut not working? All, I have a large XML document with unique ID attributes that I'd like to access via the ID shortcut, like so: trace(myXML[3]); returns: myxmlnode id=3... It works fine when I publish to Flash 6, but publishing to anything greater returns undefined. Any thoughts? Thanks in advance! ___ 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
RE: [Flashcoders] classes vs external .as files
Far more errors can be caught compile-time using classes than using timeline script. Rather than finding out halfway into a project that you've mistyped a variable's name in several places, you find out the first time you try to compile. Classes also make for easier unit testing. I think it's generally better to extend the MovieClip class and register the symbol to the class than to create classes that refer to movie clips and assign them via timeline code. The latter approach faces more problems when the movie structure changes. In some ways it's also good to keep in line with what Adobe is doing. Are they making classes? Yes. Are they making scripts to be included from the timeline? No. There is only one instance where I currently use an included timeline script instead of a class, and that is for SWFObject's expressinstall.as, which needs to work in Flash Player 6r65. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Meinte van't Kruis Sent: Monday, September 11, 2006 1:33 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] classes vs external .as files it's more of a taste thing i guess, and this question kinda revolves around 'oop vs procedural' etc. These discussions have been 'waged' alot of times, and often result in language religion wars ;) Personally, if code is readable and makes sense, it's allright by me. Meinte On 9/11/06, Adrian Ionut Beschea [EMAIL PROTECTED] wrote: Hello, I've just had a debate with a colleague of mine about the some of the as 2.0 best practice. We both like to separate design from code, but we have slightly different ways of doing it. This is what he does : He leaves design elements on stage and includes and external .as file to handle the logic. #include 'script.as' I like to think in terms of oop. So instead of including a script, I write something use: SampleClass.main(this) main is something like this : public static function main(target_mc:MovieClip) { instance = new SampleClass(target_mc); } What do you guys think ? Which method is more of your taste and why ? - How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates. ___ 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
RE: [Flashcoders] taking color out of a jpg in flash
http://www.senocular.com/flash/source.php?id=0.169 Googled desaturate flash -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stanford Vinson Sent: 12 September 2006 10:53 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] taking color out of a jpg in flash I want to load in a jpg/gif and then take all its color out leaving it in gray scale. Is this possible using new functions in flash 8 ... like copybitmap or anything? Has anyone tried this? All the best, Stanford ___ 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] Accessing a file on the local hard drive?
From what I can see of the tweenies one it does upload the photo - it just takes care of the where from bit with the text: Create a folder on your c drive called temp and save the file here, naming it me.jpg I assume this triggers a php script or something similar to upload it from that location when Play is pressed. Pretty rubbish solution really. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: 12 September 2006 13:22 To: Flashcoders mailing list Subject: Re: [Flashcoders] Accessing a file on the local hard drive? If a Flash application (on the web) would have access to your harddrive, Adobe would be out of business in no time. That goes for any web application really.. Muzak - Original Message - From: Mark Burvill [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 12, 2006 10:44 AM Subject: Re: [Flashcoders] Accessing a file on the local hard drive? That's a good idea hadn't thought of that. Mind you, don't think we can use FP8 but worth considering. I'm still looking for the reason that it doesn't work straight from the hard drive though. Is it a Flash player thing or a service pack thing? ___ 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] does actionscript have something like sql's IN orLIKE ?
Why not just: public static function contains(str:String, val:String):Boolean { return str.indexOf(val) = 0; } ? A tad more concise (you don't need the ? true : false part), and avoids the problem your function has that if str is null or undefined, it returns true. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Jim Kremens Sent: Tuesday, September 12, 2006 11:25 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] does actionscript have something like sql's IN orLIKE ? Hi, Try this for checking if one string contains another: public static function contains(str:String, val:String):Boolean { return str.indexOf(val) != -1 ? true : false; } Also, try to avoid attaching your functions directly to buttons, as it makes scoping tricky: this.opened_btn.onRelease=function(){ Check out the Proxy class here for a better way to handle that: http://www.person13.com/articles/proxy/Proxy.htm Hope that helps, Jim Kremens ___ 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] AS3 : chr() == String.fromCharCode()?
Not to be too harsh, but that's been deprecated since, what, Flash 5? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of julien castelain Sent: Wednesday, September 13, 2006 10:45 PM To: flashcoders list Subject: [Flashcoders] AS3 : chr() == String.fromCharCode()? hi list, i saw in the AS2 to AS3 migration guide ( http://livedocs.macromedia.com/flex/2/langref/migration.html) that chr() has been removed ... is String.fromCharCode() the way to do things now? 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
[Flashcoders] Hex to HSB
Anyone got a quick and dirty hex to HSB and back converter algo - without having to convert to RGB first? Cheers M ___ 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] How to get the URL of the page that a moiveis embedded on?
trace(this._url) Have I missed something? M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim Berkey Sent: 15 September 2006 12:12 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] How to get the URL of the page that a moiveis embedded on? http://www.mochibot.com/ *** REPLY SEPARATOR *** On 9/14/2006 at 1:45 PM Jeff Mastropietro wrote: I need a 100% effective way to get the URL of the page that a flash movie is embedded in. It cannot rely on JavaScript. Any ideas? We are trying to track the pages that are embedding our flash movies. Thanks, Jeff ___ 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 e ___ 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] Hex to HSB
Thanks, but I was hoping this would be possible without having to convert to RGB first - I basically want to do pixel by pixel colour transform on a copy of a video whilst it's being played so it needs to be ultra efficient. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eka Sent: 15 September 2006 12:18 To: Flashcoders mailing list Subject: Re: [Flashcoders] Hex to HSB Hello :) you can find this tool in my OpenSource framework VEGAS (with this extension ASGard) http://osflash.org/vegas # Color tools in asgard.colors package : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/colors/ # HSV to RGB in ColorHSV class http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/col ors/ColorHSV.as EKA+ :) 2006/9/15, Mike Mountain [EMAIL PROTECTED]: Anyone got a quick and dirty hex to HSB and back converter algo - without having to convert to RGB first? Cheers M ___ 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
RE: [Flashcoders] Convert Regular Number back to Hex value?
toString(16) Cheers M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: 15 September 2006 13:01 To: Flashcoders mailing list Subject: [Flashcoders] Convert Regular Number back to Hex value? Similar to Mike's thread, is there a function out there someone has written to convert a regular numerical value back to its equivalent hex value? For example: var myColor:Number = 0xff6600; myText_txt.text = myColor //shows converted to 16737792, but //need it to display as ff6600 Thanks, Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions ___ 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] AS3 : chr() == String.fromCharCode()?
Sorry, yes, String.fromCharCode() replaced chr() a while ago. *checks* Yes, since Flash 5. Check the Deprecated section in the ActionScript side panel. Functions like chr() and ord() were in Flash 4, back before ActionScript (or was it just called Actions back then?) followed ECMA standards. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of julien castelain Sent: Friday, September 15, 2006 1:17 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] AS3 : chr() == String.fromCharCode()? ok mike, so what :) i read that in the docs too. however you still didn't reply to the question take it easy ___ 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] Hex to HSB
OK - seeing as you asked so nicely Instead of splitting it up into 3 different components R, G and B then doing a calculation on each of these in turn to find H S and B ,applying some transform on H and B and then turning these back into R G and B - then in turn combining this to find a flash friendly hex value - I'd like to know if it's possible to go Hex - Hsb - transform - Hex or to find HSB from hex do I have to split out the RGB components? Any clearer? M From: [EMAIL PROTECTED] on behalf of Ammon Sent: Fri 15/09/2006 17:07 To: Flashcoders mailing list Subject: Re: [Flashcoders] Hex to HSB Mike Mountain wrote: Thanks, but I was hoping this would be possible without having to convert to RGB first - I basically want to do pixel by pixel colour transform on a copy of a video whilst it's being played so it needs to be ultra efficient. I'm sorry... but explain to my how a hex number of the form 0xRRGGBB isn't _already_ an RGB value? :P Ammon ___ 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] Hex to HSB
I'm doing this in flash 9, the hex to rgb conversion is sweet and plenty fast enough, it's when I throw in the HSB conversion that is bogs down. It has to be done pixel by pixel as the type of transform depends on the input value of each individual pixel. [We're doing tilemap adjustments for a large screen made up of LED panels (so small res, think 340 by 122 pxls) so we have to do both Gamma and Colour correction.] M From: [EMAIL PROTECTED] on behalf of David Rorex Sent: Fri 15/09/2006 23:47 To: Flashcoders mailing list Subject: Re: [Flashcoders] Hex to HSB No, pretty much the way hsb -- rgb works, you need to have the numbers separate. You could probably create some awkward transform that tries really hard not to break them up, but it would end up being a lot more complicated, and not worth it. Besides, going from 0xRRGGBB to 0xRR, 0xGG, 0xBB is very fast (just 3 ANDs and 2 bitshifts). // takes a color in the form 0xRRGGBB returns an object with the fields r, g, and b function hex2rgb(c:Number):Object { return { r:(c16)0xff, g:(c8)0xff, b:c0xff }; } // takes an object with fields r, g, and b, returns a color in the form 0xRRGGBB function rgb2hex(c:Object):Number { return (c.r16) | (c.g8) | (c.b); } and then here's a quick test: var c = hex2rgb(0xabcdef); trace(r=0x+c.r.toString(16)+ g=0x+c.g.toString(16)+ b=0x+c.b.toString(16)); trace(color=0x+rgb2hex(c).toString(16)); then, assuming your rgb2hsv and hsv2rgb functions take an object as input, you could do: // read in hsv from a pixel var hsv:Object = rgb2hsv(hex2rgb(bmp.getPixel(x,y))); // transform hsv.h, hsv.s, hsv.v, etc hsv.h /= 2; hsv.s = 50; hsv.v = Math.random()*100; // put back our transformed pixel bmp.setPixel(x,y,rgb2hex(hsv2rgb(hsv))); -- Now, this is all theoretical, but I don't think flash 8 is fast enough to do this calculation on a real-time video of any decent size. flash 9 might be able to handle it. But if you just want to do some color transforms, i'd suggest looking at the built in transform classes instead of trying to do it yourself pixel-by-pixel. These should be much faster, because the transform code will be native, instead of in actionscript. They are pretty flexible, you can do a lot with them. -David R ___ 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] specifying type of an array contents?
One technique I often use is to create the array as a private member of a class and guard it against including invalid classes. For example: import mypackage.Item; class mypackage.ItemList extends Object { public function ItemList() { super(); _items = new Array(); } public function get itemCount():Number { return _items.length; } public function addItem(item:Item):Void { if (!(item instanceof Item)) { throw new Error(Invalid item: + item); } _items.push(item); } public function getItem(index:Number):Item { var item:Item = Item(_items[index]); return (item == undefined) ? null : item; } public function removeItem(item:Item):Void { for (var i:Number = _items.length; i 0; --i) { if (_items[i - 1] == item) { _items.splice(i - 1, 1); } } } public function removeItemAt(index:Number):Void { _items.splice(index, 1); } public function toString():String { return [type ItemList(items= + _items.join(, ) + )] ; } private var _items; } It is cumbersome to do this for all types, but it's handy for many occasions. (I do really miss C++ templates, though) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of dc Sent: Saturday, September 16, 2006 7:36 PM To: Flashcoders mailing list Subject: [Flashcoders] specifying type of an array contents? is there a way to tell flash what types an array contains? eg given this: var btnClipArray:Array; --- later: for (var btn in btnClipArray) { btn.removeMovieClip(); } flash defaults to thiking the array contains only strings, so the movieclip methods throw a compile error. of course, i can cast or otherwise hack, but it would be nice not to... var btnClipArray:Array:MovieClip; ? /dc --- David DC Collier mailto:[EMAIL PROTECTED] +81 (0)80 6521 9559 skype: callto://d3ntaku --- Pikkle 株式会社 http://www.pikkle.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] htmlText javascript link being ignored in Safari
I can think of a reason: SAFARI SUCKS!!! Sorry, I can't be more helpful; just had to get that out there. ;) Okay, I'll try to be a little helpful--have you tried putting an alert() call in your JS function to see if Safari's calling it at all? Or, better yet, try calling the function from an HTML link (a href=# onclick=openVidPlayer...). This may help narrow down where the failure is occuring. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Marlon Harrison Sent: Monday, September 18, 2006 2:36 PM To: Flashcoders mailing list Subject: [Flashcoders] htmlText javascript link being ignored in Safari I have a dynamic text field where I create an html link based on a couple of pieces of data. Here's an example of the code for the link: var aTag:String = p class = 'landing'a href=\javascript:openVidPlayer('/vidplayer.html?video=+sel.v_id+cate go ry=+sel.cat+');\ target = '_parent'+sel.ttl+/a/p; My problem is that the popup works fine in Windows IE, Mac/Win Firefox just fine. It won't work in Safari. It shows as link, but when you click, nothing happens. Can anyone think of a reason why this wouldn't work? ___ 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] Find item in array
It's a hell of a lot easier to read than the fastest for loop syntax. for (var i = myArray.length; --i -(-1); ) {} Actually that would be: var l = myArray.length; for (var i = l; --i -(-1); ) {} Then you're not looking up the length on every iteration.. :p M ___ 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] Find item in array
you live and learn. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fumio Nonaka Sent: 19 September 2006 14:38 To: Flashcoders mailing list Subject: Re: [Flashcoders] Find item in array Unlike to evaluation of a condition, the initial value should be evaluated only once anyway. for (var i = initialValue(); icondition(); i++) {} function initialValue() { trace(initial value is evaluated); return 0; } function condition() { trace(condition is evaluated); return 3; } // [Output]: initial value is evaluated condition is evaluated condition is evaluated condition is evaluated condition is evaluated _ Mike Mountain wrote: var l = myArray.length; for (var i = l; --i -(-1); ) {} Then you're not looking up the length on every iteration.. -- Fumio Nonaka mailto:[EMAIL PROTECTED] http://www.FumioNonaka.com/ My bookshttp://www.FumioNonaka.com/Books/index.html Flash communityhttp://F-site.org/ ___ 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] Find item in array
My guess would be that postincrement it takes longer because it needs to store and return the original value, while preincrement only needs to return the result after performing the operation. But that's only a guess. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Tuesday, September 19, 2006 1:45 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Find item in array As to why exactly --i -(-1) runs faster in a while loop than i--, well, it can't be the same exact pcode or it wouldn't be faster so it must be less pcode. I didn't bother to verify it myself because at the time, somebody did for me. It's explained somewhere in the archives. If you dig, you'll find it, and you'll find my name somewhere in there along with it since I was part of the discussion on most occasions that it came up. I do like mustard, now, by the way. :) ___ 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] Associate clip with class
One technique I've been trying lately is to assert linkage of class names. First I create a static function that asserts that a symbol is linked to a certain class. It returns the symbol ID if so, and throws an error if not: class com.exopolis.exosite.errors.SymbolError extends Error { //... public static function assertRegistered(linkageID:String, classFunc:Function, className:String):String { if (!Object.registerClass(linkageID, classFunc)) { throw new SymbolError(linkageID, className); } return linkageID; } } Then in any MovieClip subclass, I can do something like this: import com.exopolis.exosite.errors.SymbolError; class mypackage.MyComponent extends MovieClip { //... public static var LINKAGE_ID:String = SymbolError.assertRegistered(MyComponent, MyComponent, MyComponent); } That way, the symbol is automatically registered to the class, and if there is no such symbol, an error is thrown (which does not disrupt any other processes). -- Mike Keesey ___ 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] Using a swf as an animated texture in direct X
Anyone know if it's possible to use an animated swf as a texture for a directX object? Cheers M ___ 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] HTTP post request in the background
You should use something along these lines: import mx.utils.Delegate; function onResponseComplete(success:Boolean):Void { // Do something in response. } var request:LoadVars = new LoadVars(); // Set up variables in request. var response = new LoadVars(); response.onLoad = Delegate.create(this, onResponseComplete); request.sendAndLoad(url, response); ― Mike Keesey ___ 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] Working on Flash 6 player but not on Flash 8
The earlier post (by Jake Prime) is probably the explanation. But also, random() is deprecated; instead of random(x), you should use Math.floor(Math.random() * x). ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Berkay Unal Sent: Thursday, September 21, 2006 8:04 AM To: [FlashCoders] Subject: [Flashcoders] Working on Flash 6 player but not on Flash 8 Hi Coders, Can someone please tell me whats the problem with this code . it's working on fl6 but not fl8 . Thanks Code: -- counter++; // hiding the first dot dot._visible = false; // particle generator // setting of the shape and velocity for each new dot this[dot+counter].gotoAndStop(shape); this[dot+counter].speedx = (random(speed*10)/10)-(random(speed*10)/10); this[dot+counter].speedy = (random(speed*10)/10)-(random(speed*10)/10); // FX scaling and fading for every dots for (i=counter; icounter-maxdot; i--) { this[dot+i]._x = this[dot+i]._x+this[dot+i].speedx+Math.cos((counter+i)/frequency)*am pl itude+forcex/friction; this[dot+i]._y = this[dot+i]._y+this[dot+i].speedy+Math.sin((counter+i)/frequency)*am pl itude+forcey/friction; //friction this[dot+i].speedx = this[dot+i].speedx/friction; this[dot+i].speedy = this[dot+(i)].speedy/friction; if (fxscale == true) { this[dot+i]._xscale = (maxdot-(counter-i))*(100/maxdot)*scale; this[dot+i]._yscale = (maxdot-(counter-i))*(100/maxdot)*scale; } else { this[dot+i]._xscale = 100*scale; this[dot+i]._yscale = 100*scale; } if (fxfade == true) { this[dot+i]._alpha = (maxdot-(counter-i))*(100/maxdot); } else { this[dot+i]._alpha = 100; } } // removing old dots if (counter=maxdot) { eleman = counter-maxdot; removeMovieClip(this[dot+eleman]); } // managing maxdots changes : destroying unused dots maxdotdif = maxdot-maxdot0; if (maxdotdif0) { for (i=counter-maxdot; i=counter-maxdot0-1; i--) { removeMovieClip(this[dot+i]); } } trace(a); maxdot0 = maxdot; -- Berkay UNAL [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 ___ 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] Algorithm to find center of an irregular shape
Look into MovieClip.getBounds() and MovieClip.getRect(). For example, you could use: import flash.geom.Point; // ... function getCenter(shape:MovieClip):Point { var bounds:Object = shape.getBounds(this); var center:Point = new Point(); center.x = (bounds.xMax - bounds.xMin) / 2; center.y = (bounds.yMax - bounds.yMin) / 2; return center; } (Assuming that the scope of this function is a movie clip timeline or a subclass of MovieClip.) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of matt stuehler Sent: Thursday, September 21, 2006 9:58 AM To: Flashcoders mailing list Subject: [Flashcoders] Algorithm to find center of an irregular shape All, I'm not too handy with geometry, so I'm not even sure this is possible, but I'm looking for an algorithm that will determine the center of an irregular shape. I'm not even sure there is a meaningful definition of a center, but I'd like to at least find a point that is within the area of the shape. (I realize that with certain shapes, like a donut, this might be an intractible problem), so even some rough approximation would help. In this particular application, the shapes are the areas between the lines created when graphing several time series on a chart (e.g., the price of several stocks, graphed over time) Many thanks in advance for any advice or insights! Cheers, Matt Stuehler ___ 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] HTTP post request in the background
onResponseComplete is probably being called before onMailDataResponseComplete (damn that's a long name! onMailComplete would suffice, no?), and thus unloading the whole SWF as it loads a new HTML page. Try moving this line: formData.sendAndLoad(http://www.salescloser.com/XMLAddContact.aspx;, response); ... to the very end of your processForm() function. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Bill Abel Sent: Thursday, September 21, 2006 10:20 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] HTTP post request in the background I'm still having one problem. When I test this movie from within Flash, it sends both LoadVars, but when I try it from the .swf on the web server, it only sends to the .php script. Anyone see the problem? import mx.utils.Delegate; function onResponseComplete(success:Boolean):Void { getURL(http://www.hallmanhill.com/information/thankyou.html;); trace(posted data); } function onMailDataResponseComplete(success:Boolean):Void { trace(sent email); } function processForm() { var response = new LoadVars(); var formData:LoadVars = new LoadVars(); formData.firstname = firstname_tb.text; formData.lastname = lastname_tb.text; formData.address = address_tb.text; formData.city = city_tb.text; formData.state = state_tb.text; formData.zip = zip_tb.text; formData.homephone1 = areacode; formData.homephone2 = prefix; formData.homephone3 = linenumber; formData.email = email_tb.text; response.onLoad = Delegate.create(this, onResponseComplete); formData.sendAndLoad(http://www.salescloser.com/ XMLAddContact.aspx, response); trace(formData); var mailData = new LoadVars(); var mailDataResponse = new LoadVars(); mailData = formData; mailDataResponse.onLoad = Delegate.create(this, onMailDataResponseComplete); mailData.sendAndLoad(http://test.slaughtergroup.com/mail.php;, mailDataResponse, POST); trace(mailData); } ___ 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] HTTP post request in the background
Actually, scratch that -- move the whole formData deal to its own function, and call that from onMailComplete(). IOW, do the calls sequentially, not simultaneously. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: Thursday, September 21, 2006 11:07 AM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] HTTP post request in the background onResponseComplete is probably being called before onMailDataResponseComplete (damn that's a long name! onMailComplete would suffice, no?), and thus unloading the whole SWF as it loads a new HTML page. Try moving this line: formData.sendAndLoad(http://www.salescloser.com/XMLAddContact.aspx;, response); ... to the very end of your processForm() function. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Bill Abel Sent: Thursday, September 21, 2006 10:20 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] HTTP post request in the background I'm still having one problem. When I test this movie from within Flash, it sends both LoadVars, but when I try it from the .swf on the web server, it only sends to the .php script. Anyone see the problem? import mx.utils.Delegate; function onResponseComplete(success:Boolean):Void { getURL(http://www.hallmanhill.com/information/thankyou.html;); trace(posted data); } function onMailDataResponseComplete(success:Boolean):Void { trace(sent email); } function processForm() { var response = new LoadVars(); var formData:LoadVars = new LoadVars(); formData.firstname = firstname_tb.text; formData.lastname = lastname_tb.text; formData.address = address_tb.text; formData.city = city_tb.text; formData.state = state_tb.text; formData.zip = zip_tb.text; formData.homephone1 = areacode; formData.homephone2 = prefix; formData.homephone3 = linenumber; formData.email = email_tb.text; response.onLoad = Delegate.create(this, onResponseComplete); formData.sendAndLoad(http://www.salescloser.com/ XMLAddContact.aspx, response); trace(formData); var mailData = new LoadVars(); var mailDataResponse = new LoadVars(); mailData = formData; mailDataResponse.onLoad = Delegate.create(this, onMailDataResponseComplete); mailData.sendAndLoad(http://test.slaughtergroup.com/mail.php;, mailDataResponse, POST); trace(mailData); } ___ 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
RE: [Flashcoders] Working on Flash 6 player but not on Flash 8
Well, random() has two meanings then, and the Math.random() function is more generally useful than random() (for example, if you need a random floating-point number). That said, I'd love a Math.randomInt() function. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Thursday, September 21, 2006 12:22 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Working on Flash 6 player but not on Flash 8 instead of random(x), you should use Math.floor(Math.random() * x). Which makes me wonder why random() is deprecated. They really think that Math.floor(Math.random() * x) is better than random()? Ridiculous! The sign of a great API is its simplicity. ___ 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] Mute Flash Application, mac.
I think you can control all of the sound in a Flash movie like so: var globalSound:Sound = new Sound(_root); // Mute. globalSound.setVolume(0); // Restore. globalSound.setVolume(100); ― Mike Keesey ___ 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] Implicit Setters: Is validation considered a goodor bad OOP practice ?
This is generally the route I take. The only thing is that it may halt application flow in unforeseen circumstances, so 1) unit test and beta test really well and 2) try as much as possible to catch errors in code that sets the property. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of slangeberg Sent: Monday, September 25, 2006 8:46 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Implicit Setters: Is validation considered a goodor bad OOP practice ? so if it's a bad input, it cannot tell the object that is modifying the setter property that something went wrong. Not sure if it's the best practice, but if someone passes in a bad input to your setter, in AS3 you can throw errors, such as: public function set volume( val:Number ) { if ( val == bad_news ) { throw new Error( Volume Class - set volume(): Bad value passed in [ + val+ ] ); } } Scott On 9/25/06, Nicolas Cannasse [EMAIL PROTECTED] wrote: 3) Validate the value and it it's an undesired value, throw an error ? Here, the component prevents the user from assigning and undesired value like NaN or undefined and the user is alerted of the failure at runtime provided that he used a try catch statement. What do you guys think ? (3) definitly. It's called defensive programming. Try to have your API as much checked (type-wise and logical-wise) as possible. This will enforce your internal logic constraints and prevent faultly programs. For instance any other component of your application (an UI for example) will except your volume to be positive and not NaN so you cannot allow such values to be set. And you shouldn't ignore this error also since silently ignoring errors will make you and others lose hours of debugging when something goes wrong damn ! why this f... volume does not get set answer : because it's NaN Nicolas ___ 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 -- : : ) Scott ___ 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] How do you manage your classes?
Lately I actually copy all packages to a folder within my project's folder. Why? Suppose you have a package and you use it on project A. Later, you use it on project B, and realize there are some issues, so you change some of the code. Project B finishes. Then, later on, you find you have to go back to project A with some tweaks and republish it. Because of changes in the package, there may be problems--at best you will still have to spend time regression testing. Copying your packages to a project-local folder means that you have a secure snapshot of the package. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Dan Rogers Sent: Monday, September 25, 2006 4:36 PM To: Flashcoders mailing list Subject: [Flashcoders] How do you manage your classes? Flashcoders, I've been wondering how other flash developers deal with AS2/AS3 class management on both a project-based and common library level, while addressing the need to package up source code for a given project to deliver to a team member or client. I've used version control before, as well as doing the common classpath thing for shared classes... but when it's time to deliver the source code to someone, I would have to go in and hunt for all the classes I used on a project and copy them to the FLA directory (and recreate the com.package... structure as well). Sometimes it seems faster to simply create the AS files along with the FLA (in a single package), and copy over utility files as needed. But then you get into duplicate classes scattered over multiple projects. Can anyone provide any insight to a system that works well for them? For example, does anyone run custom shell scripts (such as rsync) that sync the current project with the main classpath directory? Thanks, -Danro ___ 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] Delegating Events and AS2
Whoops! -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: Tuesday, September 26, 2006 2:23 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Delegating Events and AS2 [...] Or, if using AS3.0, I think you can wrap a flash.events.EventDispatcher object (Decorator Design Pattern): [...] private function _dispatcher:EventDispatcher; } Obviously, that should be: private var _dispatcher:EventDispatcher; ― Mike Keesey (Note: I haven't actually tried AS3.0, so someone let me know if I messed anything up.) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Sean Scott Sent: Tuesday, September 26, 2006 12:09 PM To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Delegating Events and AS2 Hi All!, wondering if someone can point me in the right direction. I am trying to find a ASBoradcast / Event Dispatcher light model for my app. Basically i have a number of MCs that will have to either react to events being broadcast or broadcast their own. I have Essential AS2 by Colin Moock. Trying to find something i can import and maybe pass scope to it, vs have my main class extend it. I've googled, searched the archived and exausted my more talented flash developer friends. Thanks, Sean ___ 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
RE: [Flashcoders] MC not pressed
Untested but what about something like this: [as] var btns = new Array(mc0_btn, mc1_btn, mc2_btn, mc3_btn, mc4_btn, mc5_btn); function scaleUp(mc) { mc._xscale = mc._yscale=150; } function scaleDown(mc) { mc._xscale = mc._yscale=50; } function hiliteButton(btn_num, transFuncOn, transFuncOff) { var l = btns.length; for (var i = 0; il; i++) { if (i == btn_num) { transFuncOn(btns[i]); } else { transFuncOff(btns[i]); } } } var l = btns.length; for (var i = 0; il; i++) { btns[i].idx = i; btns[i].onPress = function() { hiliteButton(this.idx, scaleUp, scaleDown); }; } [/as] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Laurent CUCHET Sent: 20 September 2006 18:03 To: Flashcoders mailing list Subject: [Flashcoders] MC not pressed There is a lot of mc but I take to explain the case : They are name A_mc, B_mc and C_mc If I press one clip its scale get 300. How can I do in the same time get 50 to the other not pressed ? A_mc.onPress = B_mc.onPress = C_mc.onPress = function() { this._xscale = this._yscale = 300; }; Thank you very much ___ 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] Escape and
not sure where you're using this, etc.. but maybe something like: myString = where in the world is it? myString = myString.split(?).join(\?) --- Laurent CUCHET [EMAIL PROTECTED] wrote: I try to save text in DB When I save I escape text but it doesnt work whith �� If someone save a text is it possible to save � ? Without manually typing \� ??? Thank __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] Why isn't my listener firing?
[AS] import mx.transitions.Tween; import mx.transitions.easing.*; // var transListener:Object = new Object(); transListener.allTransitionsInDone = function(evt):Void { // direction value of 0 trace(evt.type+ triggered); }; mc.addEventListener(allTransitionsInDone, transListener); mx.transitions.TransitionManager.start(mc, {type:mx.transitions.Zoom, direction:0, duration:1, easing:mx.transitions.easing.Bounce.easeOut}); [/AS] I culled the above code form a couple of web sites from a google search - I'm trying to find out how to detect when a transisition using the transition manager has finished - the code is pretty much identical but it doesn't seem to fire off. It may be a case of wood for the trees but I can't see why it isn't working. Anyone help? Cheers M ___ 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] Why isn't my listener firing?
Never mind, having a thicko day M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Mountain Sent: 28 September 2006 09:57 To: Flashcoders mailing list Subject: [Flashcoders] Why isn't my listener firing? [AS] import mx.transitions.Tween; import mx.transitions.easing.*; // var transListener:Object = new Object(); transListener.allTransitionsInDone = function(evt):Void { // direction value of 0 trace(evt.type+ triggered); }; mc.addEventListener(allTransitionsInDone, transListener); mx.transitions.TransitionManager.start(mc, {type:mx.transitions.Zoom, direction:0, duration:1, easing:mx.transitions.easing.Bounce.easeOut}); [/AS] I culled the above code form a couple of web sites from a google search - I'm trying to find out how to detect when a transisition using the transition manager has finished - the code is pretty much identical but it doesn't seem to fire off. It may be a case of wood for the trees but I can't see why it isn't working. Anyone help? Cheers M ___ 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] log or sin or what?
According the the name, it should be some kind of a quadratic equation (ax^2 + bx + c = 0). You could get something looking a lot like this with the sine or cosine functions, though. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of til Sent: Thursday, September 28, 2006 4:24 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] log or sin or what? Does anyone know what formula yields a curve that looks sorta like this? http://hosted.zeh.com.br/mctween/examples/tracer.swf?mode=easeinoutquad ~Til ___ 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] Mac Flash Projector Question
MDM Zinc may do the trick? http://www.multidmedia.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Bargar Sent: 29 September 2006 15:50 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Mac Flash Projector Question Hi- A client has asked us to change the Version information that a user sees when he/she does Get Info on a Mac Flash projector. Currently it says something like 8.0 r22 (c) Macromedia, Inc. but the client would like to show their own info in that space. On the PC we used Versiown (http://www.goldshell.com/versiown/main.htm) but nothing we've tried on the Mac has worked. We've tried FileExaminer and Super GetInfo, as well as a hex editor for that special old-school charm. Any ideas? Thanks! -Matt --- Matthew Bargar Senior Developer sixredmarbles One Alewife Center, Suite 210 Cambridge, MA 02140 ___ 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] Implicit setters and exceptions in AS2.0
I think that's very well-put. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of David Bellerive Sent: Thursday, September 28, 2006 8:22 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Implicit setters and exceptions in AS2.0 Last week, I sent a message to the FlashCoders list asking if validating the values passed to setter methods (in custom classes) was a good practice. After reading on how exceptions work in Java, here's the solution I've decided to use in my setter methods in AS2.0. If the client (the programmer using my custom class) breaks his part of the contract by supplying my setter method with an illegal value, I display an alert in the output window using the trace statement and abort the implicit setter method without assigning the illegal value that was passed to the method. On the other hand, if the implicit setter method is the one breaking the contract (it can't complete it's task for whatever reason), I throw and exception. I've decided to use this method because AS2.0 doesn't support checked and unchecked exceptions like Java. In AS2.0, all exceptions are unchecked, meaning the client isn't forced to catch any exceptions. But when an exception goes uncaught, the function call stack completely aborts. So, using this method, when the client is responsible for breaking the contract (like passing an illegal value to the setter method), he is alerted via the output window in the Flash IDE. This way, he isn't forced to respond to low-risk errors and the function call stack won't abort under any circumstance. However, the client cannot react to this error at runtime. However, when the setter method is the one responsible for breaking the contract, an exception is thrown and the client has to catch it to prevent the function call stack from aborting completely. If the client doesn't catch the exception, the function call stack is emptied and the program probably won't work as expected. However, if the exception is caught (and it should), the client has the possibilty to react to it at runtime. In conclusion, when the error comes from the client only alert the client. When the error comes from the method, throw an exception. Any thoughts or comments on this ? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] Projector Wrapper
I'd be rather worried if Nicolas didn't want to promote it. The difference being Screenweaver HX is open and free - a comparison would certainly be very interesting. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: 02 October 2006 19:00 To: Flashcoders mailing list Subject: RE: [Flashcoders] Projector Wrapper Would be interesting to compare with recently released Screenweaver HX (http://haxe.org/swhx). ...says one of the authors of Screenweaver HX. Being a shill doesn't work unless you use a different name. ;) ___ 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] Projector Wrapper
Screenweaver HX does just work with the SWF. It just means you can extend it's capabilities with haXe if you wanted. From the blurb: the System layer : written in haXe and using the Neko API, you can access the local filesystem, databases, network sockets... You can also easily extend its capabilities by writing your own DLL. the Flash layer : written in haXe or any other technology capable of producing SWF, you can use this layer to display the graphical interface, handle user interactions, play sound and video... It's only downside as far as I can see is that it's not very user friendly, no pretty gui etc. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Derek Vadneau Sent: 03 October 2006 15:30 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Projector Wrapper I'd be rather worried if Nicolas didn't want to promote it. Except that the original poster was asking for opinions and getting an opinion from someone who develops one of the products is not as useful. Besides, getting a little off the original request. I don't use haxe nor mtasc so for me I would prefer something that just works based on the swf or the projector. Derek Vadneau ___ 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] when classes die...
The term is a destructor; and, no, ActionScript doesn't have destructors, only constructors. The closest it comes is MovieClip.onUnload()--if your class is a subclass of MovieClip, then you can just override that. If not, one common practice is to make a function called destroy(): public function destroy():Void { // Perform clean-up. delete this; } Then replace all instances of delete instanceOfYourClass; with instanceOfYourClass.destroy(). ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of grimmwerks Sent: Monday, October 02, 2006 6:34 PM To: Flashcoders mailing list Subject: [Flashcoders] when classes die... Ok, I've got an app that uses a static variable; I've got 'templates' that use x instances of this class. When the user loads in a new template when a previous template has already existed, I get some 'leftover' variables. Is there a function that is called when a class is 'killed', ie the opposite of when a class is birthed with 'new'? -- ---[ http://www.grimmwerks.com ---[ [EMAIL PROTECTED] ---[ [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 ___ 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] when classes die...
Will that be called if you use unloadMovie() or if the playhead moves to a frame without the instance? MovieClip.onUnload is put there specifically for this kind of purpose. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Tuesday, October 03, 2006 11:14 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] when classes die... for movieclips i tend to override removemovieclip myself. just a personal pref i suppose :) On 10/3/06, Mike Keesey [EMAIL PROTECTED] wrote: The term is a destructor; and, no, ActionScript doesn't have destructors, only constructors. The closest it comes is MovieClip.onUnload()--if your class is a subclass of MovieClip, then you can just override that. If not, one common practice is to make a function called destroy(): public function destroy():Void { // Perform clean-up. delete this; } Then replace all instances of delete instanceOfYourClass; with instanceOfYourClass.destroy(). ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of grimmwerks Sent: Monday, October 02, 2006 6:34 PM To: Flashcoders mailing list Subject: [Flashcoders] when classes die... Ok, I've got an app that uses a static variable; I've got 'templates' that use x instances of this class. When the user loads in a new template when a previous template has already existed, I get some 'leftover' variables. Is there a function that is called when a class is 'killed', ie the opposite of when a class is birthed with 'new'? -- ---[ http://www.grimmwerks.com ---[ [EMAIL PROTECTED] ---[ [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 ___ 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 -- j:pn http://www.lennel.org ___ 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] Projector Wrapper
OK got to get this out of my system - I've been itching to post it for months but 'held my tongue', alas no more: Steven you're obviously a talented guy, but my God you have an attitude - is noone allowed to have a different opinion to you? You don't discuss, you object constantly, shoot down, or just plane dismiss out of hand other peoples ideas and opinions unless they follow your train of thought. It isn't polite. Please now accept my most humble apologies for posting that - completely out of character on my behalf but something (as aforementioned) I needed to get out of my system I too suffered with the original Screenweaver - but as of yet have not tried screenweaver HX on anything more than a fleeting demo, so will not pass judgement, or comment by posting a list of faults on a previous version. I'm sure mProjector is really brilliant, the db's, the bees knees, I can feel myself baked in it's golden rays as it bends over to tie its shoelaces (and if you haven't got a free copy by now Steven they really aren't watching this list properly.) Competition is healthy and to be encouraged As I read it Nicolas was proposing that as Screenweaver is free, then it would undoubtdly do no harm whatsoever to give it a go and see if it does what the original post required. Apparently he was a little to succinct with his suggestion, a four page diatribe may well stand him in better stead next time. Keep on with the good flash man. Mike From: [EMAIL PROTECTED] on behalf of Steven Sacks | BLITZ Sent: Tue 03/10/2006 19:08 To: Flashcoders mailing list Subject: RE: [Flashcoders] Projector Wrapper Promoting it is one thing, but his post was not a promotional post, but more that of a call to action from an impartial party, which he is not. I don't think Screenweaver being open and free makes it better considering Screenweaver before it was open and free was, simply put, bad. Here are some facts about Screenweaver. It was extremely buggy, had features that simply did not work, was unstable and would crash without warning and with no notification, had issues with ATI cards when Microsoft Outlook was open, had issues where the CPU usage would spike to 99% and never release making Windows (and the SW app) unresponsive requiring a task manager force quit, had a terrible API for doing the most simple things (something like 15-20 lines of code to make a system tray icon compared to ONE line of code in mProjector, had many functions required 5+ arguments, which reflects poor planning) And the list goes on and on. I wouldn't recommend trusting anything that was based on such bad code unless it was completely rewritten from scratch, which I'm not sure it was. Contrary to that, mProjector has always been rock solid and well thought out and has had asynchronous support since the beginning while all other wrapper developers could not figure how to do it for years. Let me stress that - for years nobody knew how the author of mProjector provided asynchronous support despite their best efforts, and there was plenty of effort from all the wrapper developers. Now that the facts are out of the way, it's time for my opinions. I invite anyone to share a negative experience they had with mProjector (I've never seen or heard a single one), but you can search the archives and there are plenty of developers in the community who have had plenty of negative experiences with Screenweaver. Other wrappers like SWFStudio and Zinc, while not as solid as mProjector, were far more stable than Screenweaver. I would trust any wrapper except Screenweaver to handle functionality that mProjector doesn't have. IMO, the reason Screenweaver was made open source is because it was a mess and the only way to clean it up was to invite other coders to get involved and help fix all its problems. I'm all for open source, but the original Screenweaver code was so bad, I can't bring myself to rely on it. All this being said, major companies trust mProjector as their wrapper of choice for mass deployment. Companies like The Weather Channel, DirecTV, Fox Interactive, Earthlink, and Turner Broadcasting. I think the paltry $199 (or $300 for both platforms) is worth the peace of mind of owning the most solid, well-built, best API, easiest to use Flash wrapper on the market. ___ 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
RE: [Flashcoders] when classes die...
Well, I'll be darned. var a:Object = new Object(); var b:Object = a; a.toString = function():String { return object; } trace(a + , + b); delete a; trace(a + , + b); Output: object, object undefined, object Is there any difference at all between deleting a variable and setting it to undefined? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Peter Hall Sent: Tuesday, October 03, 2006 3:55 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] when classes die... public function destroy():Void { // Perform clean-up. delete this; } This code is garbage. The delete operator operates on variables and not on values. So delete this will just delete a variable called this within the scope of that function. To remove an object from memory, you have to remove all references to it. And you can do that by using delete on each one of those references, or by setting those variables to some other value. Peter ___ 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 Player 9 FullScreen Mode
Doesn't work in win ie 6.0.2 for me -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Radley Marx Sent: 05 October 2006 05:24 To: Flashcoders mailing list Subject: Re: [Flashcoders] Flash Player 9 FullScreen Mode bwah ha ha ha ha. Mac. OSX. Full screen didn't happen. mac wulez! ___ 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] Google code search
Already loving http://krugle.com/ M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of slangeberg Sent: 05 October 2006 16:02 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Flashcoders mailing list; flexcoders@yahoogroups.com Subject: [Flashcoders] Google code search Not sure how many have seen this yet, but I'd be intrigued to see what kinds of good stuff people might turn up. As it is, I'm not even real sure where to start!: http://news.zdnet.com/2100-3513_22-6122819.html?part=rsstag=f eedsubj=zdnn : : ) Scott ___ 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] flv not playing in IE with Flash 9
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157 Does this help? M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ammon Lauritzen Sent: 06 October 2006 00:01 To: Flashcoders mailing list Subject: Re: [Flashcoders] flv not playing in IE with Flash 9 On 10/5/06, John Dowdell [EMAIL PROTECTED] wrote: If you can't see other SWF in that browser, then that's a clue. Sigh. And here I was wasting my time trying to be polite to you. YES I could see other SWF's in that browser. Sheesh. Anyways. Resolution to the problem has been achieved. In stead of hard coding the flv into the swf, we're passing it in as an argument when instantiating it from the html. And it works. There seems to be an issue with directory locations. The flv was trying to load relative to the swf, NOT the html file. So why this happens in flash 9 for IE, I don't know, nor do I care any more at this point. But the incident has been logged for future reference when we encounter the bug again. Ammon ___ 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] Error check for parseXML()
Use the XML.status field. var xml:XML = new XML(); xml.ignoreWhite = true; xml.parseXML(someTextVar); if (xml.status == 0) { trace(Success!); } else { trace(Error in XML! Code: + xml.status); } ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mendelsohn, Michael Sent: Friday, October 06, 2006 6:50 AM To: Flashcoders mailing list Subject: [Flashcoders] Error check for parseXML() Hi list... According to the help docs, public parseXML(value:String) : Void doesn't return an integer or anything to indicate successful parsing of the xml. How can I be certain that I've passed in some error free xml and it was able to parse? Thanks, - Michael M. ___ 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] Error check for parseXML()
Good point. One optional tweak: var xml:XML = new XML(); xml.ignoreWhite = true; xml.parseXML(someTextVar); xml.onLoad = function(success:Boolean):Void { if (this.status == 0) { trace(Success!); } else { trace(Error in XML! Code: + this.status); } } The scope should probably be this instead of xml in this case. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Ray Chuan Sent: Saturday, October 07, 2006 2:21 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Error check for parseXML() Hi, you should put the conditional in a callback, because when execution reaches the conditional xml parsing might not have finished parsing. var xml:XML = new XML(); xml.ignoreWhite = true; xml.parseXML(someTextVar); xml.onLoad = function(success:Boolean):Void { if (xml.status == 0) { trace(Success!); } else { trace(Error in XML! Code: + xml.status); } } Note that the success argument can be ignored if you're using functions like parseXML(), because it's got to do with the success of loading a document using XML.load() or XML.sendAndLoad(). On 10/7/06, Mike Keesey [EMAIL PROTECTED] wrote: Use the XML.status field. var xml:XML = new XML(); xml.ignoreWhite = true; xml.parseXML(someTextVar); if (xml.status == 0) { trace(Success!); } else { trace(Error in XML! Code: + xml.status); } ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mendelsohn, Michael Sent: Friday, October 06, 2006 6:50 AM To: Flashcoders mailing list Subject: [Flashcoders] Error check for parseXML() Hi list... According to the help docs, public parseXML(value:String) : Void doesn't return an integer or anything to indicate successful parsing of the xml. How can I be certain that I've passed in some error free xml and it was able to parse? Thanks, - Michael M. ___ 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 -- Cheers, Ray Chuan ___ 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] simple gotoAndPlay :: Am I losing my mind?
Are you using MoveClipLoader within IE? If so it's listeners behave eratically with different content caching settings - this could be the problem, your main swf would think the content was loaded in and ready, when in fact it wasn't. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Serge Jespers Sent: 11 October 2006 14:22 To: Flashcoders mailing list Subject: Re: [Flashcoders] simple gotoAndPlay :: Am I losing my mind? It's getting worse... :-/ It works like it should inside the IDE. But not in a browser. Now you could think that my main.swf is causing this swf to mess up but I'm doing the exact same thing with another swf and that one works perfect... The troubled swf is being loaded with a MovieClipLoader and I just play it once it's loaded in. I think I'm just going to build this file from scratch 'cause other than a messed up file, I can't come up with anything that may cause this... :-/ ___ 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] Moving to AS2, array always undefined
I prefer underscores for fields, too, but I'd still use the belowmentioned constructor argument syntax if I wanted to set a property corresponding to a field so as to take advantage of any format-checking in the property setter: class PolarCoordinate extends Object { public function PolarCoordinate(radius:Number, theta:Number) { super(); this.radius = radius; this.theta = theta; } public function get radius():Number { return _radius; } public function set radius(value:Number):Void { if (isNaN(value) || !isFinite(value)) { // Default to 0. _radius = 0; } else { _radius = value; } } public function get theta():Number { return _theta; } public function set theta(value:Number):Void { if (isNaN(value) || !isFinite(value)) { // Default to 0. _theta = 0; } else { // Normalize: 0 ≤ θ 2π while (value 0) { value += Math.PI * 2; } while (value = Math.PI * 2) { value -= Math.PI * 2; } _theta = value; } } private var _radius:Number; private var _theta:Number; } �D Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JOR Sent: Thursday, October 12, 2006 7:27 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Moving to AS2, array always undefined No, it isn't wrong which was entire the point of my earlier response. I gave essentially the same example as you. In fact, you've included it quoted at the bottom of your response which I left intact. However, just because it is correct doesn't mean I prefer it over other conventions. I prefer to use underscores with my field names. -- james Ash Warren wrote: In practice, you're right and I try not to name any parameters the same as a field name to avoid this confusion. Don't tell anyone, but sometimes I don't even use this. :) So this is wrong? function MyClass (myParam1:Number, myParam2:String) { this.myParam1 = myParam1; this.myParam2 = myParam2; } For me this method seems much easier to read and it even refers to naming parameters this way in the adobe best-practices article. Why try and come up with 2 names for the same thing, when one will suffice just fine? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JOR Sent: Tuesday, October 10, 2006 5:52 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Moving to AS2, array always undefined A bad practice most likely, but not technically wrong. I do see it in text books from time to time. I was just mentioning it as a case where this *would* be needed as opposed to speaking in absolutes. In practice, you're right and I try not to name any parameters the same as a field name to avoid this confusion. Don't tell anyone, but sometimes I don't even use this. :) James O'Reilly - Consultant Adobe Certified Flash Expert http://www.jamesor.com Design . Code . Train Steven Sacks | BLITZ wrote: Correct me if I'm wrong, but it looks like your rationale is entirely based on an argument name being identical to a class variable name. I might be looking at this too simply, but shouldn't you just use a different argument name if it clashes with a class variable name? -Steven -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JOR Sent: Tuesday, October 10, 2006 1:19 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Moving to AS2, array always undefined Actually, the need is dependent on the implementation. It was my understanding that AS first looks to the local scope for the existence of a variable then works up to find it. By using this you were explicitly telling flash that the var isn't local to the function but rather belongs to the object cutting out a step for the VM. Therefore, something like the following becomes possible and the use of this becomes necessary: class MyConstructor { private var target:MovieClip; public function MyConstructor (target:MovieClip) { this.target = target; } } Because you can not do this: class MyConstructor { private var target:MovieClip; public function MyConstructor (target:MovieClip) { target = target; // ? } } However, depending on your naming conventions you might not have to use this if you did something like the following
RE: [Flashcoders] Flash Projectors - mProjector vs. Zinc
The problem I found with Director is you have to go out and buy a bunch of Xtras to really achieve anything notable. Have you considered ScreenweaverHX? M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of slangeberg Sent: 17 October 2006 17:58 To: Flashcoders mailing list Subject: Re: [Flashcoders] Flash Projectors - mProjector vs. Zinc Peter, I had considered Director, as we have that here. What did you find in Director that was lacking in these other projector tools? Scott On 10/17/06, Blumenthal, Peter [EMAIL PROTECTED] wrote: I know there's a *big* difference in price, but lately I've been coming back around to using Director for Flash based apps that need decent OS level capability... Pete This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. We may monitor email to and from our network. ___ 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 -- : : ) Scott ___ 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] Zinc issues
Zinc fixed this issue a few releases back, sounds like you're using an old build - ours works fine with SVN now... M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stan Vassilev Sent: 23 October 2006 20:42 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Zinc issues We just purchased a license for Zinc since we had to quickly pick a 3rd party projector with file load/save for a project. I'm using it with flex 2 framework / flash 9. It's kinda a letdown, first thing, it has a bad conflict with TortoiseSVN which caused it to crash right on startup. After researching a bit, Zinc installs old DLL-s which TSVN coughs up with. SWFStudio had the same kind of issue but they fixed it in recent builds. If I knew, I'd buy it instead of Zinc. The control over dialogs and features is terrible. They do support AS3, which we need since it's Flex 2 project. But it's spotty at best. To save binary files we had to take a ByteArray and convert it to a huge HEX string for Zinc to understand. This is of course slow, even in AS3. The Open dialog works, but amusingly the Save dialog doesn't! No matter what we tried, it just won't open or do anything at all. And since the open dialog doesn't check for file existence or anything, now we save files with the open dialog, as weird as it sounds. I'm writing here to ask if someone of you have dealt with those issues in Zinc and have workarounds, fixes, tricks/hacks etc. I'm contacting Zinc support too, but from what I see on their forums, they don't seem willing to answer to other people asking about the same issues. Regards, Stan Vassilev ___ 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] Q:passing a variable as argument with getURL(javascript:testfunc(arg));
Use this: var arg:String = myvar; getURL(javascript:testfunc(' + arg + ')); // Note: arg's value cannot have apostrophes in it. Or, better yet, look into the flash.external.ExternalInterface class. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, October 24, 2006 9:55 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Q:passing a variable as argument with getURL(javascript:testfunc(arg)); Hi I'm having a problem using getURL to pass a variable argument to a javascript function this works(notice 'arg' is a string) getURL(javascript:testfunc('arg')); this DOESN'T work: var arg='myvar' getURL(javascript:testfunc(arg)); Any suggestions??? [e] jbach at bitstream.ca [c] 416.668.0034 [w] www.bitstream.ca ...all improvisation is life in search of a style. - Bruce Mau,'LifeStyle' ___ 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] Easy to learn and use 3d program
Cinema 4D by Maxon is both simple to use and very powerful M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Nyberg Sent: 27 October 2006 08:50 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Easy to learn and use 3d program Hi, I'm looking for an easy to learn and use 3d program to create content for Flash. What are your suggestions? I want to do fairly simple animations, but I need something that are a bit more complex than say, Xara3d. -- Varmfrontsgatan 1 128 34 Skarpnäck 070 - 407 83 00 08 - 37 16 73 ___ 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] AS 3 - event args
One way would be to create a subclass of Event that stores the parameters. In this case, though, I wouldn't even do that. You can just use event.target to determine which button was pressed: function onPressed(event:Event):void { var button:Button = Button(event.target); // Do stuff with button. } If you need to specifically use an index number, I'd attach that to the button instances themselves. Then you could retrieve that via event.target. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of dnk Sent: Friday, October 27, 2006 7:59 PM To: Flashcoders mailing list Subject: [Flashcoders] AS 3 - event args Hi there. I am just beginning my adventure into AS 3, and came upon something. In AS 2 I used to use a custom delegate class to deal with scope issues, but also be able to pass args (in an array, single string, etc) to my event functions. So for example, I might have something in AS 2: // snipped fro ma method for (var j:Number = 0; j 5; j++) { this._targetMc[dtBtn + j].onPress = MyDelegate.create(this, onPressed, j); } // event method function onPressed(i:Number) { trace(i); } So the custom class would allow this to work in my classes. Now in AS 3 as I have read, the basic delegate class is no longer needed as the scope issues are dealt with now. So how would I go about accomplishing the same thing in AS 3? passing an arg to an event method? Thanks! Dustin ___ 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] AS 3 - event args
Here's an example: ---mypackage/IndexButton.as--- package mypackage { public class IndexButton extends Button { function IndexButton() { super(); } public function get index():uint { return _index; } public function set index(value:uint):void { _index = value; } protected var _index:uint; } } ---in some other class--- //... protected function init():void { for each (var button:IndexButton in this) { button.addEventListener(release, onButtonPressed); } } protected function onButtonPressed(event:Event):void { if (event.target is IndexButton) { var index:uint = IndexButton(event.target).index; // Do something with index. } } //... ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Bbt Lists Sent: Monday, October 30, 2006 4:44 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] AS 3 - event args Mike Keesey wrote: One way would be to create a subclass of Event that stores the parameters. In this case, though, I wouldn't even do that. You can just use event.target to determine which button was pressed: function onPressed(event:Event):void { var button:Button = Button(event.target); // Do stuff with button. } If you need to specifically use an index number, I'd attach that to the button instances themselves. Then you could retrieve that via event.target. ― Mike Keesey With the way I do intend to use it, I would have to pass an index as that index provides the basis for many actions within the onPressed function. And I am not sure what you mean by attaching the button instance itself... how would one go about that? -- dnk ___ 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] AS 3 - event args
Err, that last function should probably be called onButtonRelease ... but you get the idea ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: Monday, October 30, 2006 5:04 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] AS 3 - event args Here's an example: ---mypackage/IndexButton.as--- package mypackage { public class IndexButton extends Button { function IndexButton() { super(); } public function get index():uint { return _index; } public function set index(value:uint):void { _index = value; } protected var _index:uint; } } ---in some other class--- //... protected function init():void { for each (var button:IndexButton in this) { button.addEventListener(release, onButtonPressed); } } protected function onButtonPressed(event:Event):void { if (event.target is IndexButton) { var index:uint = IndexButton(event.target).index; // Do something with index. } } //... ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Bbt Lists Sent: Monday, October 30, 2006 4:44 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] AS 3 - event args Mike Keesey wrote: One way would be to create a subclass of Event that stores the parameters. In this case, though, I wouldn't even do that. You can just use event.target to determine which button was pressed: function onPressed(event:Event):void { var button:Button = Button(event.target); // Do stuff with button. } If you need to specifically use an index number, I'd attach that to the button instances themselves. Then you could retrieve that via event.target. ― Mike Keesey With the way I do intend to use it, I would have to pass an index as that index provides the basis for many actions within the onPressed function. And I am not sure what you mean by attaching the button instance itself... how would one go about that? -- dnk ___ 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
Re: [Flashcoders] AS 3 - event args
2 other options: Just have one event handler per button. or use an anonymous function myButton.addEventListener(MouseEvent.CLICK, function(){doSomething (1);}); private function doSomething(index:int):void { trace(index); } (I havent tested the code above, so there might be some syntax errors). Personally, I would always have one event listener per button as I feel it make it a little easier to read the code. mike chambers [EMAIL PROTECTED] On Oct 30, 2006, at 4:12 PM, Mike Keesey wrote: One way would be to create a subclass of Event that stores the parameters. In this case, though, I wouldn't even do that. You can just use event.target to determine which button was pressed: function onPressed(event:Event):void { var button:Button = Button(event.target); // Do stuff with button. } If you need to specifically use an index number, I'd attach that to the button instances themselves. Then you could retrieve that via event.target. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of dnk Sent: Friday, October 27, 2006 7:59 PM To: Flashcoders mailing list Subject: [Flashcoders] AS 3 - event args Hi there. I am just beginning my adventure into AS 3, and came upon something. In AS 2 I used to use a custom delegate class to deal with scope issues, but also be able to pass args (in an array, single string, etc) to my event functions. So for example, I might have something in AS 2: // snipped fro ma method for (var j:Number = 0; j 5; j++) { this._targetMc[dtBtn + j].onPress = MyDelegate.create(this, onPressed, j); } // event method function onPressed(i:Number) { trace(i); } So the custom class would allow this to work in my classes. Now in AS 3 as I have read, the basic delegate class is no longer needed as the scope issues are dealt with now. So how would I go about accomplishing the same thing in AS 3? passing an arg to an event method? Thanks! Dustin ___ 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
RE: [Flashcoders] Create zip file through flash
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Claus Wahlers Sent: Wednesday, November 01, 2006 6:49 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Create zip file through flash He's talking about zipping up files on the local filesystem. Flash 9 can do that? Flash 9 has native filesystem access which would allow compressing files on your hard drive? Flash Player 9 can zip up files pretty easily, but of course can't access the local filesystem. Sorry for the noise. Don't apologize--I found the unzip class interesting! ― Mike Keesey ___ 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] Q:Coding : from Procedural to Class based code?
Well, as an initial stab, you could do something like this: package radialnav class RadialManager extends MovieClip center:Point [read-only] createItem(symbolName:String, tweenSettings:TweenSettings):RadialItem tweenIn():Void tweenOut():Void class RadialItem extends MovieClip manager:RadialManager [read/write] tweenSetting:TweenSettings [read-only] tweenIn():Void tweenOut():Void class TweenSettings extends Object durationIn:Number [read/write] durationOut:Number [read/write] easeType:String [read/write] nodes:Array [read/write] radius:Number [read/write] copy(source:TweenSettings):Void ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, November 01, 2006 12:10 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Q:Coding : from Procedural to Class based code? Hi I have a project that I'd like to convert to class based code but would appreciate some advice on the best approach. Basically I have a routine which attaches a number of library items to the stage and, on either a rollover or press event, tweens these items(images) out in a radial fashion. They optionally return to their initial (overlapping) state. Pretty simple stuff. All of the tweening properties (number nodes, circle radius, duration out, duration in, ease type, etc) are predefined and passed in as a single object. My question is: What is the best way to convert this into a Class? Should I simply have a 'create' method in my class that takes the place of my original method? When attaching large numbers of library items, isn't there a 'speed hit'? Should the tweening objects(basically containers for tween properties) have their own class as well? What's should the getters/setters return/set? Any feedback greatly appreciated! Jim Bachalo [e] jbach at bitstream.ca [c] 416.668.0034 [w] www.bitstream.ca ...all improvisation is life in search of a style. - Bruce Mau,'LifeStyle' ___ 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] AS 3 - event args
Yeah, the simplest way is to create an index field on the buttons themselves, and then access that in the listener with event.target.index. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of dnk Sent: Tuesday, October 31, 2006 6:59 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] AS 3 - event args Mike Chambers wrote: 2 other options: Just have one event handler per button. or use an anonymous function myButton.addEventListener(MouseEvent.CLICK, function(){doSomething(1);}); private function doSomething(index:int):void { trace(index); } (I havent tested the code above, so there might be some syntax errors). Personally, I would always have one event listener per button as I feel it make it a little easier to read the code. mike chambers [EMAIL PROTECTED] Hey - the anon function seems to be the way that resembles what I used to do. The only reason I do not have a unique one per button is say for example I have 25 buttons and I loop through to create the instances and the event listeners - then have a function that performs the same actions (with a different index number). Then I only have to write out 1 function for the 25 button instances. Unless there is a way to do it with a loop, I would then have to write out 25 unique functions to handle the button events - correct? That is if I was going to do it your preferred way with unique button functions Dustin ___ 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] playing audio filetypes other than mp3?
You can use ByteArray in Flash 9 to load any kind of binary data. While you could use this to create image-rendering plugins using BitmapData (or even video-rendering, although I question performance), there's no corresponding SoundData class, is there? So I think, at least as far as sound goes, you're kind of stuck with MP3. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Josh Santangelo Sent: Wednesday, November 01, 2006 3:54 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] playing audio filetypes other than mp3? I'm wondering if anyone's managed to play filetypes other than MP3 in Flash. Obviously you can't just load them up, but I'm envisioning loading them into a hidden instance of the QuickTime plugin, and then using JavaScript to bridge the two so that you can control the playback from Flash. Anyone seen/done anything similar? -josh ___ 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 Print Function and Callbacks ?
Pretty sure you can't. Just noticed something odd whil looking at the documentation on AS3.0's ProntJob class (http://livedocs.macromedia.com/flex/2/langref/)--it extends EventDispatcher, yet it doesn't have any documented events. Vot der hey? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Stephen Ford Sent: Wednesday, November 01, 2006 9:57 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Flash Print Function and Callbacks ? Does anyone know if Flash's built in Print command has anyway of providing a callback once a print job has been executed ?? I need to set a clips visibility to false while the printing takes place, then set it back to visible once the print executes ?? Is this possible ?? Thanks, Stephen. ___ 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] Copy Constructor
I might do it like this: class mypackage.Connect4State extends Object { public function Connect4State(state:Connect4State) { super(); if (state instanceof Connect4State) { copy(state); } else { board = new Array(); score = new Array(); // Default initialization code. } } public function copy(state:Connect4State):Void { board = state.board.concat(); score = state.score.concat(); } public var board:Array; public var score:Array; } Then you could call the construct with or without a parameter. (Actually, I would never use public variables, but that's another topic) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Thursday, November 02, 2006 2:31 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor Perhaps it is easier if I explain what I need: I am rewriting some Java code into AS2. Basically I have a class called Connect4State class Connect4State { public function Connect4State() { // - // Initialize the board array // -- board = new Array(); code goes here // -- // Initialize the score array // -- score = new Array(); code goes here } public var board:Array; // A 7 by 6 two dimensional array of integers representing the state of game public var score:Array; // A 2 dimensional array of integers representing the score for the players } The Java code has a function called a Copy Constructor that enables you to create new objects that are copies of existing objects. The copy constructor for Connect4State just copies the contents of each member variable. It is necessary to have a copy constructor for Connect4State because the AI algorithms use temporary state objects a great deal This is the copy constructor code translated to AS2 public function Connect4State(state:Connect4State) { // -- // Copy the board // -- board = new Array(); for (var i:Number = 0; i 7; i++) { board[i] = new Array(); for (j:Number = 0; j 6; j++) { board[i][j] = state.board[i][j]; } } // --- // Copy the scores // --- for (var i:Number = 0; i 2; i++) { score = new Array(); for (var j:Number = 0; j winPlaces; j++) { score[i][j] = state.score[i][j]; numPieces = state.numPieces; } } } AS2 seems not to like this as I get the following error A class must have only one constructor. public function Connect4State(state:Connect4State) Anyone suggest an alternative to this Copy Constructor? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven Sent: 02 November 2006 20:01 To: 'Flashcoders mailing list' Subject: [Flashcoders] Copy Constructor Hi there Is there an equivalent of the Java Copy constructor in Flash AS2? Thanks Paul ___ 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
RE: [Flashcoders] Copy Constructor
Maybe I'm not quite getting the concept, but a copy constructor should be a constructor that copies data from another object to the object being created, right? And (I think) the original poster wanted to know how to overload constructors in ActionScript so as to have a default (argument-less) constructor and a copy constructor. But you can't overload functions in ActionScript. You only get one form for each method/constructor. But you can make the argument(s) optional, which is what I did in my example, posted earlier. In AS3.0, I think the constructor might look more like this: // ... function ClassName(source:* = null) { super(); // ... if (source is ClassName) { copy(ClassName(source)) } else { // Default initialization. } } public function copy(source:ClassName):void { // Copy data from source to this object. } /... Example of code using this class: var a:ClassName = new ClassName(); // Default initialization. // Code that modifies a. var b:ClassName = new ClassName(a); // Creates a copy of a. Another possibility is to create a clone() method: // ... public function clone():ClassName { var cloneObj:ClassName = new ClassName(); cloneObj.copy(this); return cloneObj; } // ... ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Thursday, November 02, 2006 2:53 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Copy Constructor How about this? class Test { var foo:String; var bar:String; function Test(initObj:Object) { for (var a:String in initObj) { this[a] = initObj[a]; } } public function get data():Object { var obj:Object = {}; obj.foo = foo; obj.bar = bar; return obj; } public function copyConstructor():Test { return new Test(data); } } // import Test; test1 = new Test(); test1.foo = Hello; test1.bar = World; test2 = test1.copyConstructor(); trace(test2.foo); trace(test2.bar); -- Hello -- World ___ 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] Copy Constructor
A call to super() is not required unless you are passing arguments to the superclass' constructor. Nor is it required that you specify that you are extending Object. (If you don't specify a superclass, it assumes Object.) I just do it that way because I'm anal about my code. ;) Calling super() calls the constructor of the superclass (i.e, parent class). One instance where you might need it is if the constructor signatures do not match, e.g.: class SuperClass extends Object { public function SuperClass(superValue:Number) { _superField = superValue; } public function get superField():Number { return _superField; } private var _superField:Number; } class SubClass extends SuperClass { public function SuperClass(superValue:Number, subValue:Number) { super(superValue); _subField = subValue; } public function get subField():Number { return _subField; } private var _subField:Number; } The super keyword can also be used to access fields and methods of the superclass, e.g. where methods have been overridden in the subclass, e.g.: public function toString():String { return super.toString() + extra subclass info; } ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Thursday, November 02, 2006 4:03 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor Thanks a million Mike, that works perfectly. I now have a chance of getting this game up and running by the morning. One question though. I commented out the super(); after reading the following: The super() call in the constructor class is not required because Flash handles this for you in AS2, and it is handled properly. In AS1 you had to call super() to make sure the superclass' constructor was called. The order for class initialization tended to be a bit odd. That is not the case in AS2. I am fairly new to AS2 so I do not really understand what super() does but its all working fine so far as far as I can see. Can you comment on whether the super() is required? Thanks Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: 02 November 2006 22:53 To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor I might do it like this: class mypackage.Connect4State extends Object { public function Connect4State(state:Connect4State) { super(); if (state instanceof Connect4State) { copy(state); } else { board = new Array(); score = new Array(); // Default initialization code. } } public function copy(state:Connect4State):Void { board = state.board.concat(); score = state.score.concat(); } public var board:Array; public var score:Array; } Then you could call the construct with or without a parameter. (Actually, I would never use public variables, but that's another topic) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Thursday, November 02, 2006 2:31 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor Perhaps it is easier if I explain what I need: I am rewriting some Java code into AS2. Basically I have a class called Connect4State class Connect4State { public function Connect4State() { // - // Initialize the board array // -- board = new Array(); code goes here // -- // Initialize the score array // -- score = new Array(); code goes here } public var board:Array; // A 7 by 6 two dimensional array of integers representing the state of game public var score:Array; // A 2 dimensional array of integers representing the score for the players } The Java code has a function called a Copy Constructor that enables you to create new objects that are copies of existing objects. The copy constructor for Connect4State just copies the contents of each member variable. It is necessary to have a copy constructor for Connect4State because the AI algorithms use temporary state objects a great deal This is the copy constructor code translated to AS2 public function Connect4State(state:Connect4State) { // -- // Copy the board
RE: [Flashcoders] terminating hotspots etc
Well, the easiest way to shut off all hotspots (and it's kind of a hack, but a pretty useful one) is to throw a big, invisible button with property useHandCursor set to false over everything. That won't work for motion, though. For motion the most elegant solution is probably to use a singleton EventDispatcher to control everything: // MotionDispatcher class import mx.events.EventDispatcher; [Event(start)] [Event(stop)] function mypackage.MotionController extends EventDispatcher { private function MotionDispatcher() { super(); } public static function get instance():MotionController { if (_instance == undefined) { _instance = new MotionController(); } return _instance; } public function get stopped():Boolean { return _stopped; } public function set stopped(value:Boolean):Void { if (_stopped != Boolean(value)) { _stopped = Boolean(value); dispatchEvent({type: _stopped ? stop : start, target: this}); } } private static var _instance:MotionController; private var _stopped:Boolean = false; } // In a motion-controlled movieclip with a timeline animation: import mx.utils.Delegate; MotionController.instance.addEventListener(start, Delegate.create(this, play)); MotionController.instance.addEventListener(stop, Delegate.create(this, stop)); // To stop all controlled animations: MotionController.instance.stopped = true; // To restart all controlled animations: MotionController.instance.stopped = false; ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of :: joshua Sent: Thursday, November 02, 2006 4:27 PM To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] terminating hotspots etc hey everyone. ok heres the situation: i have a flash site that I would like to terminate all functionality to when a help panel comes up. essentially shutting off all hotspots and motion mc's. would there happen to be an easy way to make this happen... im afraid i know the answer to this[hoping i'm wrong]...but that's why i'm turning to you all... cheers. joshua ___ 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] OT conver java code to flash
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Thursday, November 02, 2006 3:15 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] OT conver java code to flash Thanks Jim It is AS2, and the context is below. Btw what is the difference between Math.rand() and Math.random()? There is no Math.rand(). There was a top-level function, random(), which returned integers (I think), but it is deprecated. Just use Math.random(): var MAX:Number = [some positive integer value]; var randomInt:Number = Math.floor(MAX * Math.random()); // Sets it to some number from 0 to MAX - 1. ― Mike Keesey ___ 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] Tween question
Hi, I've got a motion tween in the timeline that simply moves a mc vertically (about 30 pixels) and then back again. All works fine until I also try to move that mc horizontally using actionscript and the ._x property, the timeline motion tween stops working, the mc moves horizontally but not vertically. Is this just Flash's normal behavior, that moving an object using actionscript means that the timeline will be ignored? Are there any work arounds? Thanks, Mike ___ 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] OT conver java code to flash
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Chris Benjaminsen Sent: Friday, November 03, 2006 5:42 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] OT conver java code to flash Hi Paul Actually Math.random always return a positive number between 0 and 1 [...] Strictly speaking, it returns a *nonnegative* number from 0 (inclusive) to 1 (exclusive). I.e, once in a blue moon it might actually return 0, but it will never return 1; 0.9 (or something like that) is as close as it gets. The distinction doesn't matter much in practice, but ― Mike Keesey ___ 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] Copy Constructor
I don't see anything wrong after a (very) cursory glance. One red flag, though, is that you are making your variables public. This means there could be code elsewhere that sets them to be identical to each other. Because of issues like this, I think it's a good practice never to make variables public (except in some cases, like static pseudo-constants in AS2.0; but AS3.0 has real constants, so this problem goes away). There are two things you could do with an array: 1) make it read-only, offering a defensive copy with a getter; 2) provide methods for accessing and updating its data: 1) public function get board():Array { return _board.concat(); } private var _board:Array; 2) public function getBoardStatus(x:Number; y:Number):Number { return _board[x][y]; } public function setBoardStatus(x:Number; y:Number, value:Number):Void { _board[x][y] = value; } Actually, looking at it further, Board should probably be a class composed by Connect4State. Oh, damn, and I realized why you are having that problem! See copy function below (it's because you are copying an array of arrays): class connect4.BoardStatus { private function BoardStatus() { } public static var BLACK:BoardStatus = new BoardStatus(); public static var EMPTY:BoardStatus = new BoardStatus(); public static var RED:BoardStatus = new BoardStatus(); } class connect4.Board { public function Board(source:Board) { if (source instanceof Board) { copy(source); } else { // Default initialization; } } public function copy(source:Board):Void { _status = new Array(); for (var i:Number = 0; i source._status.length; ++i) { _status[i] = source._status[i].concat(); } } public function getStatus(row:Number, col:Number):BoardStatus { return _status[row][col]; } public function setStatus(row:Number, col:Number, value:BoardStatus):Void { _status[row][col] = value; } private var _status:Array; } class connect4.GameState { public function GameState(source:GameState) { if (source instanceof GameState) { copy(source); } else { _board = new Board(); // Initialize other fields. } } public function get board():Board { return _board; } // Other properties. public function copy(source:GameState):Void { _board = new Board(source._board); // Copy other fields. } private var _board:Board; // Other private fields. } ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Friday, November 03, 2006 10:44 AM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor I think the problem may be that I am recursively creating the copies. Here are the two classes in full if anyone would be kind enough to see if they can help. Been on this all day and have made no progress http://www.mediakitchen.co.uk/Connect4Engine.as http://www.mediakitchen.co.uk/Connect4State.as Thanks Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven Sent: 03 November 2006 17:55 To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor Seem to be having problems with this still. It seems like every time I change a value in the main constructor objects array, it also changes the array values in the copies. Are these copies essentially just pointers to the same array? Basically the reason I need copies is so it can simulate future moves in the game by updating a copy of the game state arrays. So essentially I need to create copies of these arrays that I can manipulate without these manipulations affecting the arrays they were copied from. I hope that makes sense Thanks Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: 02 November 2006 22:53 To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor I might do it like this: class mypackage.Connect4State extends Object { public function Connect4State(state:Connect4State) { super(); if (state instanceof Connect4State) { copy(state); } else { board = new Array(); score = new Array(); // Default initialization code. } } public function copy(state:Connect4State):Void
RE: [Flashcoders] Copy Constructor
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul Steven Sent: Saturday, November 04, 2006 2:39 AM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Copy Constructor Couldn't quite figure out your code Mike so have just rewritten the copy function based on what you said: Well, that was the most important part. I am however curious to understand the BoardStatus class you wrote. You declared a variable of type BoardStatus within BoardStatus. Can you explain what you are doing here please. This was an example of an enumeration class. As I recall, your code had been storing the status of each Connect-4 square (red, black, or empty) as a number (0, 1, or 2). The problem with this is that it's easy to slip it a bad number (e.g., 3, 4, 5, etc.). One solution is to create an enumeration class. An enumeration class has a private constructor and a finite number of instances, generally static constants (or pseudo-constants) associated with the class. Thus, it is impossible to assign an invalid value to anything that requires a variable of that class type. Example (somewhat modified from my previous example): class connect4.SquareStatus { private function SquareStatus() { } public static var BLACK:SquareStatus = new SquareStatus(); public static var EMPTY:SquareStatus = new SquareStatus(); public static var RED:SquareStatus = new SquareStatus(); } // Elsewhere: var status:SquareStatus; // It is impossible to set this variable to anything but null, undefined, or a valid SquareStatus value. status = SquareStatus.RED; Incidentally, you could skip the EMPTY value and just have null signify an empty square. In AS3.0, this becomes trickier, since there are no private constructors. Anyone know if there is a recommended way to get around this? (On the plus side, you can make the class final and the static values constant, which is a major shortcoming in AS2.0.) -- Mike Keesey ___ 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] OOP advice for game
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Cédric Néhémie Sent: Sunday, November 05, 2006 5:52 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] OOP advice for game You may prefer a more common syntax for the singleton access method, like getInstance for example. In ActionScript (as opposed to Java), I think it's better to use a property: class Singleton { private function Singleton() { } public static function get instance():Singleton { if (_instance == undefined) { _instance = new Singleton(); } return _instance; } private static var _instance:Singleton; } // Elsewhere: Singleton.instance; // Returns the only instance of Singleton. Personally I would prefer an EventDispatcher rather than the Observer Yes. EventDispatcher is everywhere in AS3.0, so might as well start using it now. pattern, creating events like onWindChange, onRainChange, etc..., and a WeatherEvent object carrying the new weather values. Generally in the code that Macromedia/Adobe writes, event names dont have on as part of the name, but a function responding to them might, e.g.: WeatherManager.instance.addEventListener(windChange, Delegate.create(this, onWindChange)); Or, in AS3.0: WeatherManager.instance.addEventListener(windChange, onWindChange); -- Mike Keesey ___ 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] Have I got this OOP business right?
Looks pretty good to me! You might consider having the display classes dispatch an event instead of calling a single function when they close--then you can extend behavior more easily in the future, if several things need to happen based on the same event. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Haydn Sent: Sunday, November 05, 2006 11:31 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Have I got this OOP business right? Hi, I've got a simple little game that I'm trying to make with AS2, but I'm not sure that I'm doing it right. Here's what I've got so far. I've used a 'document class' as described here: http://www.bit-101.com/blog/?p=857 Here's the code in the .fla: Game.create(this); In Game.as: class Game extends MovieClip { private var splash:Splash; private var preload:Preload; private var mainMenu:MainMenu; private function Game() { showSplash(); } public static function create(target:MovieClip):Void { target.__proto__ = Game.prototype; Function(Game).apply(target, null); } public function showSplash():Void { Splash.create(this, splash, getNextHighestDepth()); splash.setEndFunction(this, showPreload); } public function showPreload():Void { Preload.create(this, preload, getNextHighestDepth(), this); preload.setEndFunction(this, showMainMenu) } public function showMainMenu():Void { MainMenu.create(this, mainMenu, getNextHighestDepth()); // etc. } } The Splash, Preload and MainMenu classes each have a static function called create that attaches an instance of their symbol to the stage. The two setEndFunction functions tell Splash and Preload what call when they've finished doing their thing. Is this a reasonable way of going about things, or am I just making life hard for myself? Thanks, Haydn. ___ 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] preventing scientific notation
AS3.0 has Number.toFixed(): http://livedocs.macromedia.com/flex/2/langref/Number.html#toFixed() Of course, that probably doesn't help you ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Hans Wichman Sent: Monday, November 06, 2006 9:42 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] preventing scientific notation Hi Chris, thanks for your reply. According to the manual flash should be able to handle numbers up to 1.79769313486232e+308? Mine is 1e+21 so it seems i should have a little way to go before i max out:). Threading the number as a string isnt possible, since the webservice interface requires Int64. If i cast the number i get from the service to a string, my string reads 1e+21 Any ideas? JC On 11/6/06, Chris Benjaminsen [EMAIL PROTECTED] wrote: Hi Hans The numbers you are trying to store are way to large for Flash to handle as a number. If you however just thread the numbers as strings it should work perfectly. /Chris Hans Wichman wrote: Hi list, i need to talk to webservices which pass me back very large db id's, which im using again to request more info. However when i do (for example): var b:Number = 10; trace (b); it prints 1e+21 Now when I use this value as an argument to this webservice it seems to fail. When I use a tool like wsstudio2 and copy and paste the long version, it works fine. Any ideas on how to fix this? greetz JC ___ 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
Re: [Flashcoders] Flash Lite - Could someone clarify?
Flash Lite is not available for Blackberry devices. The list of compatible devices can be found at the Mobile section of the Adobe site. There are some Nokia's shipping with Flash Lite installed, however most of your users would probably have to purchase the developers version from Adobe and install on their own device. You may want to look into delivering your content to Blackberry users via the browser. Blackberry's browser is actually quite good. Hope that helps, -- Mike ___ 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] Freelancer Class
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Tuesday, November 07, 2006 12:05 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Freelancer Class I don't know if it's a remnant. You may be doing property initialization and need to nail down scope: class Student { private var name:String function Student( name:String ) { this.name = name; } } That's just bad coding. Don't use class variable names as argument names. It's not like you don't have a choice about it. ;) I don't think it's bad coding. Documentation generated from this signature might be a bit clearer than documentation generated from a signature where the argument was, e.g., nameValue, since it would be more immediately obvious that the argument name corresponds to the property name. That said, the code itself is clearer the other way. Six of one and half a dozen of the other. (Programming is so often like that.) -- Mike Keesey ___ 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] Freelancer Class
They (now Adobe) have pretty much done an about-face on this issue. The ActionScript 3.0 documentation (http://livedocs.macromedia.com/flex/2/langref/ ) is excellent. And they do use the argument name = property name syntax in constructors. For example, http://livedocs.macromedia.com/flex/2/langref/Error.html Error(message:String = , id:int = 0) Creates a new Error object. (Well, the id argument corresponds to the errorID property--so I guess they went both ways on this one!) ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Tuesday, November 07, 2006 1:34 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Freelancer Class Pretty much. You either muddy up your code or your docs. I opt to muddy up docs over code, just like Macromedia. ;) ___ 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] Accordion Pains!
Don't use components often, so excuse the ignorance. And I have RTFM'd and googled. Can't find anyway of setting the state of the Accordion Panel (ie. Which one subpanel is open) using AS? Anyone? Bueller? Cheers M ___ 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] Accordion Pains!
Ah, thanks, case of wood for trees - I thought this was a read only prop to tell you which one was selected. M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Brouwers Sent: 08 November 2006 10:46 To: Flashcoders mailing list Subject: RE: [Flashcoders] Accordion Pains! From the help file ;-) Accordion.selectedChild Availability Flash Player 6 (6.0.79.0). Edition Flash MX Professional 2004. Usage accordionInstance.selectedChild Description Property; the selected child (of type UIObject) if one or more children exist; undefined if no children exist. If the accordion has children, the code accordionInstance.selectedChild is equivalent to the code accordionInstance.getChildAt(accordionInstance.selectedIndex). Setting this property to a child causes the accordion to begin the transition animation to display the specified child. Changing the value of selectedChild also changes the value of selectedIndex. If the accordian has children, the default value is accordionInstance.getChildAt(0). If the accordion doesn't have children, the default value is undefined. Groet, Peer http://www.weiqi.nl http://www.weiqi.nl/blog http://www.schoolvoordetoekomst.nl mobiel: 06 36 13 45 56 werk:073 62 00 274 -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Mike Mountain Verzonden: woensdag 8 november 2006 11:33 Aan: Flashcoders mailing list Onderwerp: [Flashcoders] Accordion Pains! Don't use components often, so excuse the ignorance. And I have RTFM'd and googled. Can't find anyway of setting the state of the Accordion Panel (ie. Which one subpanel is open) using AS? Anyone? Bueller? Cheers M ___ 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 Disclaimer: Het Koning Willem I College/School voor de Toekomst sluit elke aansprakelijkheid uit voor eventueel in of als bijlage bij deze e-mail voorkomende onjuiste, onvolledige of door virussen aangetaste teksten en documenten. Koning Willem I College/School for the Future rejects any liability for improper, incomplete or delayed texts in or annexed to this email or for damage resulting from texts or documents in or annexed to this e-mail affected by viruses. ___ 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] Freelancer Class
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Dennis Roche Sent: Tuesday, November 07, 2006 10:47 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Freelancer Class I prefer the the double underscore naming scheme to differentiate a local/arugment variable from a class variable. It helps when you want to create get/set functions and reminds you that it is a private variable and should not accessed directly. class Student { private var __name:String; public function Student(name:String) { __name = name; } } Me, too (well, single underscore), but we were talking about setting properties, not variables. You might want to set a property in a field because it has some kind of verification or formatting functionality. For example: class mypackage.MyClass { /** * Class constructor. * * @param nameName for this instance. * @see #name */ public function MyClass(name:String) { this.name = name; } /** * An upper-case string which is the name for this instance. * * pValues are automatically converted to upper-case. May be * [EMAIL PROTECTED] null}./p */ public function get name():String { return _name; } public function set name(value:String):Void { if (value instanceof String) { _name = value.toUpperCase(); } else { _name = null; } } private var _name:String = null; } ― Mike Keesey ___ 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] EventDispatcher and onEnterFrame.... problems
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Wednesday, November 08, 2006 10:24 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] EventDispatcher and onEnterFrame problems Inside an onEnterFrame function you have to use this when referring to things in the class (if the class extends MovieClip, which I hope it does because only MovieClips can have onEnterFrame as far as I know). class MyClass { var foo:Boolean; function MyClass() { this.onEnterFrame = function() { this.foo = !this.foo; this.traceFoo(); } } function traceFoo() { trace(foo); } } But you could just write it this way: class MyClass extends MovieClip { private var foo:Boolean = false; public function MyClass() { } public function traceFoo() { trace(foo); } private function onEnterFrame():Void { foo = !foo; traceFoo(); } } Or even like this: class MyClass extends MovieClip { private var foo:Boolean = false; public function MyClass() { onEnterFrame = toggleAndTraceFoo; } public function traceFoo() { trace(foo); } private function toggleAndTraceFoo():Void { foo = !foo; traceFoo(); } } (Me, I prefer to use an event dispatcher that sends enterFrame events, but I'll admit that that's often overkill.) ― Mike Keesey ___ 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] Writing code for big teams
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Michael Nisi Sent: Wednesday, November 08, 2006 11:38 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Writing code for big teams Same here. Can't imagine to develop without testing anymore. Test while you code, not afterwards. It let's you design your objects in a transparent way. Yes. I highly recommend this book: http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201 485672/sr=8-1/qid=1163021817/ref=pd_bbs_sr_1/002-6548398-2158405?ie=UTF8 s=books It really opened my eyes to the utility of unit-testing, and how paying some time up front can allow your code to be more stable and more flexible down the road. (Yes, the examples are in Java, but it's extremely similar to AS.) ― Mike Keesey ___ 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] List items of differing row height
List items of differing row height - is this possible in the list component? Cheers M ___ 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] Test if using ActionScript 2.0
If you were using AS3.0 you could use the flash.display.LoaderInfo.actionScriptversion property. Wait--no, that only distinguishes 1.0 and 2.0 from 3.0. You could use the swfVersion property, though. Why exactly do you need to detect this? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Jeff Fox Sent: Thursday, November 09, 2006 9:37 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Test if using ActionScript 2.0 I want to create a test to see if a loaded SWF is compiled in ActionScript 1 or 2. I'm assuming I can use an old Flash detection trick and call a method that's only supported in ActionScript 2, just not sure which one to call exactly. Will that work? Anyone have any ideas or examples? -Jeff -- Jeff Fox [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 ___ 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] Grabbing data directly from the HTML page
I was playing around with the idea of passing data from an HTML page directly into a Flash movie via Javascript/SWFObject. One thing I wanted to try was sending the text that SWFObject replaces into the Flash movie. In Firefox this was pretty simple. E.g., if SWFObject was replacing the contents of div id=flash-content.../div, then all that was needed was something in the Javascript code like: var swfObj = new SWFObject(parameters); swfObj.addVariable(HTML_flashContent, escape('div id=flash-content' + document.getElementById(flash-content).innerHTML.toString() + /div)); Then, in Flash, the root variable HTML_flashContent can be parsed into an XML object. This has obvious benefits for search engine optimization, as well as making it so a Flash and non-Flash version of a page can be the exact same file. Unfortunately, though, Internet Explorer and Safari return SGML, not XHTML, for the innerHTML property (e.g., the above div tag gets converted to DIV id=flash-content.../DIV in IE). I made a quick-and-dirty SGML to XHTML conversion tool to get around this, and it seems to work so far. My question is, has anybody else made an SGML to XHTML conversion tool in ActionScript, or should I continue to refine mine and offer it for public use when done? ― T. Michael Keesey Director of Technology Exopolis, Inc. 2894 Rowena Ave. Ste. B Los Angeles, California 90039 ___ 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] Grabbing data directly from the HTML page
That sounds *much* nicer--how do you grab the whole XHTML page in Javascript? ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Ryan Potter Sent: Thursday, November 09, 2006 11:39 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Grabbing data directly from the HTML page Not sure how complicated your html page is, but I have been playing with the same idea but going at it a different way. I just loaded the entire page in as xml. As long as the page is valid xhtml it works great. I realize it doesn't exactly answer your sgml question, but it should get you the same effect and it doesn't rewrite your code. Then you can either go directly to the node or use xpath to navigate to it. Just a thought. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Keesey Sent: Thursday, November 09, 2006 12:24 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Grabbing data directly from the HTML page I was playing around with the idea of passing data from an HTML page directly into a Flash movie via Javascript/SWFObject. One thing I wanted to try was sending the text that SWFObject replaces into the Flash movie. In Firefox this was pretty simple. E.g., if SWFObject was replacing the contents of div id=flash-content.../div, then all that was needed was something in the Javascript code like: var swfObj = new SWFObject(parameters); swfObj.addVariable(HTML_flashContent, escape('div id=flash-content' + document.getElementById(flash-content).innerHTML.toString() + /div)); Then, in Flash, the root variable HTML_flashContent can be parsed into an XML object. This has obvious benefits for search engine optimization, as well as making it so a Flash and non-Flash version of a page can be the exact same file. Unfortunately, though, Internet Explorer and Safari return SGML, not XHTML, for the innerHTML property (e.g., the above div tag gets converted to DIV id=flash-content.../DIV in IE). I made a quick-and-dirty SGML to XHTML conversion tool to get around this, and it seems to work so far. My question is, has anybody else made an SGML to XHTML conversion tool in ActionScript, or should I continue to refine mine and offer it for public use when done? ― T. Michael Keesey Director of Technology Exopolis, Inc. 2894 Rowena Ave. Ste. B Los Angeles, California 90039 ___ 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
RE: [Flashcoders] Grabbing data directly from the HTML page
Ah, that works. The only thing is that it requires a double load of the page and the data isn't instantly available (although, with browser-caching, it should load in very quickly). Not huge concerns, but the double load could skew metrics. ― Mike Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of John VanHorn Sent: Thursday, November 09, 2006 12:13 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Grabbing data directly from the HTML page i think you misunderstood the suggestion. you can load the page in as xml in flash, just like loading in any other xml. i would change your swfObject javascript to pass in the location of the page: ___ 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