Re: [Flashcoders] Release camera driver...
And when I mean you cannot get rid of a connection to either one, what I mean is if you load a swf that opens a connection to Camera or Microphone, YOU CAN NEVER UNLOAD IT, even with stopAndUnload(). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 shop
Is you or ain't you a developer? If you know AS3, and you found an AS2 solution, why don't you port it to AS3? If you're making an online shop though, might I recommend Flex, which has lots of great libraries available for e-commerce. Here's a bonus - it's AS3! :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] You cannot debug this SWF because it does not contain any Actionscript
Helmut Granda wrote: The question now is, how do files in the library can become so corrupted? This would help to avoid it I hope. Because Flash, like a lot of software, ain't perfect. There's no reliable way to make an image get corrupted. Sometimes, the corruption is simple, like it says Image Cannot Be Displayed in the library preview, and it won't show up on stage. Sometimes, it gets much worse. The solution is (often) fairly simple. You have to save the image out again with a different name, because if you try to copy the same image and rename it, Flash will still get corrupted. Sometimes, it won't like it right away. Sometimes, it won't like it until you Save and Compact. Sometimes, it will work fine until you do a random amount of work in the file at which point it will stop working. Sometimes, it will still show up in the library preview and the stage but it will cause the Flash file to have problems when compiling or opening on other computers. In other words, Flash ain't perfect (CS3 is the best example of that, while Flash 8 is the closest it's ever been - in one version they went from best to worst). There's no solution and don't expect a fix because this issue has been around since at least Flash 5 and they've never fixed it. I don't even think they know what it is or why it happens, and it happens so infrequently, they simply don't talk about it. The effort to figure it out might not make sense economically. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] The Charges Against ActionScript 3.0
Everyone forgets their roots. Nobody remembers what it was like when they were first learning Flash and learning the basics of programming. Colin Moock forgot his roots when six months ago he wrote an article about how easy AS3 was to learn and how n00bs should be learning it right out the gate. Colin Moock has now remembered his roots and written what amounts to an effective retraction of his original article. Anyone who looks at the archives of Flashcoders knows where I stand on this issue. People who say all these features in AS3 are much better are either 1. Experienced, talented coders, or people who came from other programming languages. 2. See 1. Yes, it's really bad to put scripts on MovieClips or nested in some timeline somewhere. But, it's also really good for some designer who just needs to get some glorified banner out the door. Yes, it's questionable OOP to use _parent._parent, and it's certainly hard to maintain, but it's also really good for some animator who just needs to set the text of some TextField two levels up. Advanced coders often take their intelligence and knowledge for granted. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] The Charges Against ActionScript 3.0
Ashim D'Silva wrote: Flash is not a toy. You can't pick it up, with no prior knowledge, and expect to have a app 2 hours later. --- This is where we part ways. Flash used to be a toy, and, up until Flash 8, it still could be. Now, with AS3, Flash has ceased to be a child's toy and is now only a toy for adults. Child, in this sense, means non-programmer who is more comfortable with design and timeline animation, and adult meaning seasoned programmer. The notion that Flash is not (or was ever) meant to be easy enough to just pick up and make something really quick is diametrically opposed to reality. The reason you see so much BAD Flash is because it was SO EASY to use for even non programmers. It's the same with all the bad HTML. It's like saying that AJAX means that the web browser is no longer a toy. The difference here is that browsers still accept noob HTML coding standards (according to people who are AJAX/CSS experts), but Actionscript 3 gives you zero latitude. Flash is, at its _root, a vector animation tool with a scripting language tacked on. To say that a vector animation tool is not a toy is pretty far off the mark. Actionscript 3 takes Flash away from the realm of the artist and into the realm of the programmer. It makes simple things harder (regardless if it's better, it's still harder for non-coders) and is thus much less appealing to its original core audience, and a VAST MAJORITY of the people who use it. Sorry, but good Flash coders are hard to find. You just think otherwise because you run in these circles. For every person participating in online Flash development communities, there are thousands who aren't. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Error #1009 and gotoAndStop()
Creat a function that does the setting on the TextField and call it from that frame. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Nested SWFs
http://blogs.adobe.com/rgonzalez/2006/06/applicationdomain.html ApplicationDomain is the solution, but even the designer of the class acknowledges it's tricky. Each choice has mutually exclusive consequences. Gaia provides an easy way to manage the domain of loaded swfs, but I can't make it easy to understand why it works the way it works. If the above article doesn't help, only time and experimentation will. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Netstream fails to close
Move to AS3. ;) Alexander, Mary wrote: Does anyone have a solution for AS2? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Saffron Modeler - what happened to it
On 30 Jun 2008, at 17:11, Sidney de Koning wrote: there is loads of activity on sam's twitter account http://twitter.com/SamuelAgesilas Ugh. His twitter is the reason I hate twitter. You know why Saffron isn't getting done? Because Sam's got a twitter account and he's using it. A LOT. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Netstream fails to close
Barry, FYI, I didn't just throw out an idea and pull some code out of my ass. I have tackled this exact issue for a client that needed to stop a stream from downloading when they closed the stream, and couldn't actually kill streams when the user interaction resulted in spamming new NetStreams. The solution is to throttle the requests, using the exact code I provided. If you're saying you call ns.pause(); ns.close(); ns = null; and the NetStream continues to download afterwards *when you do not attempt to open another NetStream*, then there's something else going on because that works. If you immediately try to play another stream, even if it's not on same NetStream instance, then the previous one will not stop downloading (that's the bug). When you throttle the requests for new streams, the problem goes away. -Steven ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Netstream fails to close
And it's worth mentioning this works for AS3 Flash Player 9.0.47 only. It does not work for AS2. The first link you provided was from 2004 with Flash Player 7. The second link didn't look like it had any solution. The third link shows how bad the bug is, and I'm well aware this was part of the problem. You have to close the browser to kill the download if you get stuck downloading an flv because you didn't properly kill it. However, if you call pause() first (which people assume, incorrectly, that you shouldn't have to do), then close(), then set the NetStream to null and then wait at least 250ms (I recommend 500ms) to play the next stream, you're good to go no matter what the MIME type is on the server. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Netstream fails to close
You have to pause() before you close(). Jason Van Cleave wrote: sounds like a scope issue where you have multiple netstream objects On Thu, Jul 3, 2008 at 9:54 PM, Barry Hannah [EMAIL PROTECTED] wrote: I'm trying to fix a bug in a video player. Selecting a new video to play from a playlist, plays correctly but the first clip's audio doesn't die. I'm using NetStream.close(), it doesn't appear to work. It works if I wait for the first clip to download fully, just not if I select a new clip when the first is still loading. HELP! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Netstream fails to close
The only bug with NetStream that I know of is if you're spamming it with new streams too quickly. The solution is to throttle the requests. A safe time to wait between changing the streams is 250ms. It's really simple to write a queueing system that does this. You just overwrite the same variable and reset the timer. var currentStream:String; var timer:Timer = new Timer(250, 1); timer.addEventListener(TimerEvent.TIMER, onTimerEvent); function queueNewStream(value:String):void { currentStream = value; timer.reset(); timer.start(); } function onTimerEvent(event:Event):void { netStream.pause(); netStream.close(); netStream.load(currentStream); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] E4X question
Just because you CAN do it (as this document is just that, documentation), it doesn't mean you SHOULD. I mean, you CAN put underscores in class names. You CAN start class names with lower case characters. You can make all your variable names ALL CAPS even if they're not constants. You can put 10 underscores and dollar signs alternating _$_$_$_$_$ before every variable name if you want to. You can cast every variable as an Object, or as *. The language supports it, and the documentation says you're able to do it. So just because XML supports it, and the documentation says it's allowed, doesn't mean it's in any way a good practice, or smart, or even acceptable. In fact, it is not. I'll give you the number one reason why. Because XML is MEANT to be read by programming languages while still being human readable. Programming languages generally don't like hyphens in the middle of attribute names or variable names. You have to do hacky stuff like bracket access to use them. Hence, you should never use hyphens in XML attributes or node names. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] E4X question
You might want to try following XML standards and best practices by not using hyphens in XML node or attribute names. The only time I've seen hyphens in XML is when salespeople and other laymen end up writing XML schemas. Why they're ever given authority to do such things is beyond me. If it was me, I would fight tooth and nail to get those hyphens removed and replaced with camel case. Best practices or die! ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Actionscript Virtual Machine-1
http://flasm.sourceforge.net/ Everything you ever wanted to know about AVM1. Have fun seeing how far down the rabbit hole goes. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] E4X question
Just because I'm parsing XHTML using the XML parser in Flash doesn't mean that the XHTML is not following best practices. CDATA in XML is a best practice, but not in HTML. I'm using the Flash E4X parser to parse HTML, which, while technically possible, has its own set of challenges due to XML expecting XML not XHTML. Rich Shupe wrote: He may be working with a source he can't change, like your parsing HTML without using CDATA tags. On 7/2/08 1:56 PM, Steven Sacks [EMAIL PROTECTED] wrote: You might want to try following XML standards and best practices by not using hyphens in XML node or attribute names. The only time I've seen hyphens in XML is when salespeople and other laymen end up writing XML schemas. Why they're ever given authority to do such things is beyond me. If it was me, I would fight tooth and nail to get those hyphens removed and replaced with camel case. Best practices or die! ;) Rich http://www.LearningActionScript3.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] E4X question
My point is that the source (XHTML) was following best practices for XHTML, including using strict mode. By contrast, the OP's source was XML, but it was not following best practices, so Flash had some issues with hyphens, which aren't supposed to be there. I guess I was just saying that it wasn't a fair comparison. I had control over my source (XHTML), it's just that source wasn't exactly what E4X was designed for, but it followed the standards that E4X expected and the output was exactly what E4X would have output if it was XML, I was just having growing pains because of how Flash handled XML in AS1. Hyphens in XML node names and attributes is just bad all around, and I refuse to accept that things that are within your power to change are unchangeable. Some people choose the path of least resistance and figure out a way to parse the hyphens. I choose the path of righteousness and figure out a way to get rid of the hyphens that shouldn't be there in the first place. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] E4X question
Fair enough, Rich. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Warning: 3596: Duplicate variable definition.
Why? You already set buttons to _menuButtons. Now you're going to set it again? Besides, that ternary is not DRY because you are setting buttons = twice. However, it can be compacted even more, and in 2 lines, instead of 3, by reusing clip and a ternary in the var declaration, like so: var clip:* = e.target; var buttons:Array = (clip.buttonType == 1) ? _subMenuButtons: _menuButtons; :) Allandt Bik-Elliott (Receptacle) wrote: should that be:? var clip:* = e.target; var buttons:Array = _menuButtons; (e.target.buttonType == 1) ? buttons = _subMenuButtons : buttons = _menuButtons; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Warning: 3596: Duplicate variable definition.
Kerry, You should turn Strict mode on your FLAs in the publish profile settings. If you click on the language (the place you set your class paths and if you want Flash to auto-declare stage instances), you should see a checkbox for strict mode. Turn it on. The reason you want strict mode is because it will catch errors that the normal Flash compiler does not. Strict mode will help you quite a bit and expose obvious errors that the normal Flash compiler does not catch, which results in confusing runtime errors that should have been caught during compiling. I wish there was a way to turn Strict mode on by default, but AFAIK, you have to do it manually for every Flash file. Leaving variables untyped is loose coding and AS3 is all about enforcing strict coding. Using * as a wildcard type is not generally something you want to do, but it's there for you if you need it (notable exceptions include specific game programming situations where it's been proven faster to iterate over certain wildcard variables than typed ones). In the example given, the proper way of doing that would be to do what I originally said; either have both classes extend the same abstract and cast the var to the abstract, or have both classes implement the same interface and cast the var to that. In this case, you can probably get away with a wildcard, but you should never leave a variable untyped. At the very least, you're making your code more readable in the sense that you're explicitly setting a type as a wildcard and it's clear in the code that's what you wanted, vs you forgot to set a type. HTH, Steven ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Warning: 3596: Duplicate variable definition.
You see that you're declaring clip (and buttons) twice (causing the error), and as two different types (not causing the error but will cause another shortly). Because you want one variable to act as either a Main or Sub, you need to either cast clip as an abstract version that both of those extend, or make an interface both of them implement and cast clip as such, or cast clip as * and forgo any strict typing altogether. Relevant code only: var buttons:Array; var clip:* = e.target; switch(e.target.buttonType) { case 0: { buttons = _menuButtons; break; } case 1: { buttons = _subMenuButtons; } } Pavel wrote: Hi List, I have written a script, here is piece of some method: private function resetState( e:Event ) { switch(e.target.buttonType) { case 0 : var clip = e.target as MenuButtonMain; var buttons:Array = _menuButtons; break; case 1 : var clip = e.target as MenuButtonSub; var buttons:Array = _subMenuButtons; break; } for (var i:uint = 0; i buttons.length; i++) { if( buttons[i] != clip ) { buttons[i].enable(); } else buttons[i].disable(); } The script works as want it to but I keep getting a 3596 - duplicate variable definition warning, when I run the script. Should I be woried about this warning message? What is wrong in my code? Thanks Pavel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Warning: 3596: Duplicate variable definition.
Even better, 3 lines. var clip:* = e.target; var buttons:Array = _menuButtons; if (e.target.buttonType == 1) buttons = _subMenuButtons; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] switch statement more efficient than if...else?
I disagree that switch statements are more readable than if else statements, at least if you put your braces on their own lines. if (true) { // something } else if (true) { // something else } else if (true) { // yet another outcome } I don't think either is more readable than the other, unless you write your if else or switch statements poorly (no whitespace). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] switch statement more efficient than if...else?
One thing that nobody who writes switch statements seemed to know (me included) is you can (and, apparently, should) write them like this: switch (n) { case 0: { foo(); break; } case 1: { bar(); return; } case 2: { baz(); return; } default: { blech(); break; } } I definitely find that more readable than the old way. http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
Because of the way everything in AS2 is centred around the MovieClip class, in order to create any kind of MVC architecture, which I gather you are trying to do, it's all about the MovieClip. You can have your Model be an Object, but your View and Controller classes, and any other visual display class need to be MovieClips, as a general rule. Unless you use composition and pass a reference to a MovieClip in the constructor. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
It's a rare bug that is unacknowledged by Macromedia/Adobe. If you name the package folder that contains your class the same as your class name (case doesn't matter), AS2 will behave like a dumbass. It does randomly buggy behavior, and it's impossible to track down what it is because there's nothing wrong with your code, it's AS2 being buggy. Once you rename your package or class, everything works as it should. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as2 - method losing scope when called from timeline.
Also, I'm not sure what you are trying to do with 'this.clip = clip;', but you cannot instantiate or associate a MovieClip inside an Object (which Test is), and have successful access to its properties and methods. He's using composition, which is sometimes preferable to extending MovieClip in AS2. He's passing a reference to the MovieClip in the constructor. However, I generally avoid having MovieClips themselves instantiate their class on their own timeline, however, because then it's not explicit anywhere else what's going on and then you have to dig through the MovieClips to find out where code is (timeline code can be a major pain). In those cases, you should either have a controller class do that or extend MovieClip and assign the class to the clip in the libary. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Converting simple XML data into Array
class net.stevensacks.utils.XML2AS { public static function parse(n:Object, r:Object):Void { var a:Object, d:Object, k:Object; if (r[k=n.nodeName] == null) r = ((a=r[k]=[{}]))[d=0]; else r = (a=r[k])[d=r[k].push({})-1]; if (n.hasChildNodes()) { if ((k=n.firstChild.nodeType) == 1) { r.attributes = n.attributes; for (var i:String in k=n.childNodes) XML2AS.parse(k[i], r); } else if (k == 3) { a[d] = new String(n.firstChild.nodeValue); a[d].attributes = n.attributes; } }else r.attributes = n.attributes; } } xml = new XML(); xml.ignoreWhite = true; xml.onLoad = Delegate.create(this, onLoadComplete); xml.load(path); function onLoadComplete() { var xmlObj:Object = {}; XML2AS.parse(xml.firstChild, xmlObj); var nodes:Array = xml.files[0].file; var i:Number = nodes.length; while (i--) { trace(nodes[i]); } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to avoid fake data being sent to server?
This isn't even open for debate. If you don't run your logic on the server, you have zero security. End of story. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Exclude classes
In AS3, there is no exclude.xml. Whether this was an oversight or, for some reason, not possible, you cannot do this in AS3. You can, however, use the Bridge pattern. http://www.stevensacks.net/2008/01/23/update-gaia-bridge-pattern-api/ In a nutshell, you: 1. Make an Interface for the class you want to share between swfs (the implementation), but only want to be compiled in one. 2. Make a class to Bridge the gap that contains a static getter that returns the Interface, but really returns the Implementation. You could also just make it a public static var if you really want. I used an internal namespace because I don't want developers overwriting the implementation. 3. Set the Implementation in your primary swf to make it available to all the other swfs. 4. Import the Bridge class in your other swfs and now you can access the implementation. Here is a trivial example that would work. package { import IClass; public class Bridge { public static var api:IClass; } } /// import Bridge; Bridge.api.yourMethod(); /// AFAIK, this is easiest way to overcome the lack of exclude.xml in AS3. There are other ways, but they are complicated and difficult. HTH, Steven ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Gaia 2.2.0 now available
I'd like to let everyone on the list know about the latest major release of my free, open-source, front-end Flash framework, Gaia. http://www.gaiaflashframework.com/forum/index.php/topic,542.0.html Gaia 2.2.0 is a major release and contains many awesome improvements and upgrades! First off, SWFObject 2 + SWFAddress 2.1 are now fully supported. Updating older Gaia projects will automatically convert all your html pages, including your SEO Scaffolding ones, all while keeping any custom params and FlashVars you have in the old syntax. One click and your project is up-to-date with the latest SWF embedding technology. It doesn't get much easier than that! Another cool new feature is queued on-demand asset loading. Gaia will now only open a maximum of two HTTP requests at a time, which means your Gaia site is more stable (developers have reported AS3 becomes unstable when you have too many pending HTTP requests) and more responsive. External pages now have a window attribute which enables you to target which window you want to open your link in right in the site.xml. The Gaia panel now has Site XML and Class Path validation so you don't accidentally scaffold invalid class folder names (no spaces, no number at the start, alphanumeric), or invalid page ids. Additionally, the panel tells you exactly which nodes are invalid so you don't have to waste time trying to determine which ones they are. Gaia now has AS3 Event Metadata for auto-completion when using Flex Builder 3. Separate page templates for Actionscript and Timeline are now available for easy customization (and to solve a nasty JSFL bug with removeFrames). Plus, some important bug fixes were made in both the framework and the panel. And to top it all off, the latest version of the TweenMax family (v 1.17) is also included. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is it possible to display in the xml file
If you put ampersands in attributes, the XML will not parse correctly in any browser. Ampersands (and other special characters) should go inside CDATA tags to maintain valid XML. :) Cedric Muller wrote: or you could set an attribute instead of a node dep value=Fin IT / ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Unhandled IOError and IOErrorEvent when closing browser during load
I posted this to Flash_tiger but it seems to be down or something, so I'm xposting it here. Am I missing something, or is this a bug with the Flash player (9.0.124)? If you're loading something and during the load you close the browser, the Flash player spits out an Error #2044, from either ioError or IOErrorEvent or both. Error #2044: Unhandled ioError:. text=Error #2036: Load Never Completed. Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed. Ok, fine. Adobe wants to enforce strictness even when you're annihilating the swf, I can deal with that, or so I thought... I listen for the IOErrorEvent and I try..catch the load and Flash still spits out the same error. What gives? Flash still throws an allegedly unhandled error that I am most assuredly handling? Sample code: _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError, false, 0, true); try { _loader.load(request); } catch (error:Error) { trace(Caught error!, error.name + :: + error.message); } function onError(event:IOErrorEvent):void { trace(onError, event); } I believe I'm doing everything I should do to capture these errors and I still get them. Why? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: Stretch only edges of a displayObject?I
Maybe this will work? Make two copies of the original MovieClip (if you're loading an image, load it once into the first clip, then when it's done loading, load it into the two others) for a total of three. Mask the left and right pieces to the width you want to show. Mask the middle piece so those edges aren't showing. Determine the math that you would have to stretch each one of the slices so that that portion would be stretched 15% (it will be more than 15% because you would have to take into account the width of the entire clip) and set their scalex to that value. Position their x so they're lined up correctly. Voila! eric e. dolecki wrote: I am looking to take a DO (movieclip), and stretch just the side edges, leaving the middle unstretched... so take an image, cut in 4 vertical pieces, and stretch the outside pieces out horizontally by like 15%. I could use DisplayObjects above the main one and just stretch those horizontally, but I really want to keep this contained to manipulations on the main object itself and not worry about creating and destroying others. Any ideas? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] help again.. NaN
Your textfield is probably set to multiline or something like that. Anything like a carriage return will cause parseInt to break. rlyn ben wrote: need to display number to the resultTxt but when i press the first number it displays NaN.. when i enter the second number.. it display the number but with the NaN.. :( stop(); ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge); function convertAge (event:TextEvent):Number { var resultTxt:TextField = new TextField(); resultTxt.border = true; addChild(resultTxt); var userAge:Number; var ageStr:String; ageStr = ageField.text; userAge = parseInt(ageStr); userAge.toString(); resultTxt.text = String(userAge); return userAge; } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] help again.. NaN
You can just cast it as int and it will resolve as 0 if it's empty string or contains non-numeric characters. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Best way...
The Flex 3 Debugger is solid. Patrick J. Jankun wrote: .. to debug AS3 [NOT AS2!] Is there any other Debugger then one build in Flash IDE? How do you guys Debug your Proejcts? What are the best practices in debugging? What tools should i consider? Greetings, Patrick -- fancy skills to pay the bills www.jankun.org Phone: +43 660 96 969 - 01 web:jankun.org mail: p[at]jankun.org ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] FPS limit of flash player inside browser?
Juan Pablo Califano wrote: By the way, in most cases setting a FPS above 30 doesn't make much sense (bear in mind that a NTSC video signal runs at 30 FPS, and a PAL one at 25 FPS). And it will only worsen frame-dropping problem, if you already have one. I'm awfully tired of hearing this argument put forth by people. If this had even a remote possibility of truth then Nvidia and ATI would be out of business. Obviously, they're not. In fact, the competition is fierce over something that you claim makes no sense. The fact of the matter is, running at a higher frame rate makes things look smoother. Period, end of statement. If you take a time-based animation inside a 30fps movie and a 60 fps movie, the 60 fps version will look a lot smoother. It's not an opinion, it's a fact. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Why is good to extend an Event Class
It's not really important to understand the why behind extending Event in AS3. The reasons become self-evident over time as you use it. There's no reason not to, so best to just do so. The only reason you wouldn't is if you spent considerable time to deeply understand the event system in AS3 (reading posts is only part of it - you would need to spend time running tests, poking around in the code, doing RD, basically) and somehow determined that extending Event was detrimental to a specific edge case that you were working on. I'd be hard pressed to figure out what that edge case would be, and I could come up with several arguments against the decision to not extend Event in that case. In other words, if you have to ask why you should use it, you should use it. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Sr. Flash Developer Position
This is the first (and, unfortunately, I doubt the last) installment of my Recruiters Who Spam series. Michael Bright is a spammer. If he has spammed you, as well, won't you share your experience? Here's mine. Michael Bright emailed me twice, and then posted about his position twice in two days in the comments of one of my old blog posts from last October. He has done this to other people I know, as well. Michael is the second recruiter to do this specific thing - spam multiple emails and then spam their job posting on a blog post of mine they believe might show up in certain search queries. Recruiters: Post your jobs on osflash.org, post once on Flashcoders and Flash_tiger, post on Krop.com. Don't spam! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Deleting Flash Vars
Have you tried setting your individual Flash Vars to null? root.loaderInfo.parameters.someValue = null; If you tried that and it didn't work, don't use FlashVars if you need that kind of security. There are many other options to FlashVars. Ketan Anjaria wrote: I am using FlashVars in an AS3 application.Is there a way to delete flash vars once they are passed in? What I would like to do is // get the flash vars and set in application var flashVars:Object = (root.loaderInfo as LoaderInfo).parameters; for (var i:String in flashVars) { setValue(i, flashVars[i]); } // delete the flash vars to prevent other swfs from accessing delete (root.loaderInfo as LoaderInfo).parameters; but parameters is read only. Any ideas? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Determining sound sample rate?
Ben has an open source project on Google code that is the evolution of his old classes called Metaphile. http://code.google.com/p/metaphile/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Actionscript Exploit very bad news
http://www.matasano.com/log/1032/this-new-vulnerability-dowds-inhuman-flash-exploit/ http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Gaia Framework 2.1 - SEO Scaffolding
Just wanted to let everyone know I just launched a major release of my Gaia Framework for Adobe Flash. http://www.stevensacks.net/2008/04/16/gaia-flash-framework-21-seo-scaffolding/ Gaia 2.1 contains SEO Scaffolding. To find out more about it, check out my blog post and the wiki. Gaia 2.1 contains a bunch of other great new features, as well! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
For the record, I never belittled his English, but rather celebrated his the internet is serious business approach, which actually had a greater affect on diffusing my frustration than anything else. :) http://blog.mediacatalyst.com/images/seriousbusiness.jpg ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] RE: AS3 memory management - loaded content
On the AIR tip, here's the thing. Desktop application development is an entirely different beast than website application development and Flash website development. You must be extremely conscientious about your memory management with desktop applications because they might be running for days or even weeks at a time, whereas website apps and Flash sites will only be running for maximum a few hours. In this way, AIR is inviting trouble because they're attempting to bring Desktop development appealing to the masses, when really, the masses have no idea what they're getting into, or what they're subjecting their users to. Of course, you gotta learn sometime and all the memory management stuff you learn can be applied to your Flash sites, as well. This expose by Grant Skinner is important specifically because of Adobe AIR more so than anything else. I was developing Flash desktop applications with Flash wrappers and Director for a few years so I know a lot of the pitfalls, one of the biggest being tight memory management. This extremely bad memory leak in AS3 is a death knell for AIR. Until it is fixed, AIR can no longer be seriously considered as a reliable platform for desktop application development. People are better off using AS2 and one of the other wrappers out there. There's just no room for terribly bad memory leaks like this in the world of desktop application development, especially when they're completely out of your control even when you do everything right and you have no way of fixing it. Adobe has really dug themselves into a deep hole here. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
No they are not. In fact, their absolute refusal to fix it is the reason for Grant's post. If you want it fixed, you're going to have to put pressure on Adobe, which they have certainly earned with this. Talk about it on every online forum and blog. Point to Grant's blog entry. Expose the huge memory leak in the player. Talk about how it has crippled AIR as a legitimate desktop application platform. Make major companies like Disney and Turner wary of using AS3 for their Flash sites. Think about the line about automobile recalls in Fight Club. A times B times C equals X. If X is less than the cost of a recall, we don't do one. Unless this affects Adobe financially or embarrass them publicly in the tech industry, they aren't going to do anything about it. Merrill, Jason wrote: Does anyone know if Adobe is fixing this huge FP9 problem? http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html Jason Merrill Bank of America GTO and Risk LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
And just a note here, but the blogosphere is starting to come alive with people talking about this issue. Funny that MXNA has been down for the past couple of days. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Francis Cheng wrote: Grant's post is helpful because he discusses the issue in such detail, but it would be even more helpful to have a concrete test case that exhibits this problem. Francis, With all due respect, the Flash team knows about this, and they don't need any more concrete test cases. We've got better things to do than play into Adobe's attempt to buy time by deflecting it back on the developers to come up with examples while the Flash team tries to get out of their blunder. It's clear that Grant had discussions with Adobe before he wrote that blog post and I'm certain that others have approached the Flash player team with this issue for awhile. Nothing has been done to fix it, so you end up with a public exposure of the issue, as Grant has done. The Flash player team has egg on its face because in AS2 if you unload a swf, it unloads, and in AS3, it doesn't. Period end of statement. The Flash GC engine's inner workings is something that nobody outside of Adobe has access into and we can't possibly make tests that demonstrate whether it is or isn't working. The proof is in the pudding and Grant's post is all the evidence you need. Let's not get into a situation where we are insulting each other's intelligence by acting like the Flash team hasn't been aware of this issue for quite some time. The Flash team is well aware of it, they know why it exists and they know it's difficult to fix. In all likelihood, they knew about it before any developer discovered it. I mean, after all, it works exactly like it was coded to work. It's not technically a bug, it's an engineering decision that is coming back to haunt them. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Correct, Muzak. They are affected. You might remember I posted about this issue last month. I cannot unload a swf that contains an embedded video on the timeline. The best I can do is stop it. Muzak wrote: My guess is that flv's are not affected.. And guessing some more.. external swf's that contain flv/audio are affected (e.g. audio will continue to play when unloading the swf). - Original Message - From: Barry Hannah [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, April 14, 2008 11:06 PM Subject: RE: [Flashcoders] Is Adobe fixing this big FP9 problem? 1) Are flv's affected? 2) Does it ruin Adobe media player? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Let's get down to brass tax. Grant's post is not some bug report and everyone at Adobe knows it. Coming on here and trying to downplay it isn't going to get you very far because people are going to call bullshit. It's a major problem for Adobe for this to be made public and one reason it was made public is because the Flash team wouldn't admit it or fix it. It's not a good idea to lie to your development community. The Flash team knows what they did. They shouldn't have made this bad engineering decision and now they are in a bind because there's no going back and the best they can do is try and provide a usable workaround in the form of memory sandboxing. Weak (no pun intended). The rule for unloading a swf is that you have to remove all references, stop all timelines, stop all sounds, stop all timers, stop any enter frame listeners, etc, only then will it be allowed to unload. This requirement set up the situation where you cannot run a trace inside the swf to prove that it still exists in memory, otherwise, you've violated the requirement that allows a swf to unload. Interesting, huh? This is the very thing that the Flash team has relied upon to shield themselves from this being exposed. If you can't prove it, they don't have to fix it because they've got plausible deniability. The GC is completely hidden from developers, which only compounds the issue. Of course, this lack of transparency of the GC is by design, and that discussion is out of the scope of this conversation. This is the Flash team's dirty secret. They don't actually unload your swf. But, if you stop all timelines, scripts, and clear all references then to the casual observer it appears that your clip is unloaded because you have no solid way of proving otherwsie. Crafty, but not crafty enough. Unfortunately for the Flash player team, some smart developers figured out a way to prove what's really going on, and because of their continued denials and refusal to fix it because of the difficulty in doing so, their dirty little secret has been exposed. The fact of the matter is, if your references are within the scope of the swf, and you unload the swf, then the swf and everything inside it should unload. You shouldn't have to turn off anything inside a swf if its scope stays within the swf. You shouldn't have to call stop() on all timelines inside a swf that you're trying to unload, either. AS2 let you do it, so should AS3. I don't know how Adobe, in good conscience, could be pushing newbie developers to learn AS3. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Thanks for the link to Alex Harui's post, Francis. It unquestionably supports my stance that only advanced developers should be using AS3 and everyone else (95% of Flash developers) should stick with AS1/AS2. This issue of not unloading swfs unless you explicitly turn everything off inside it is another prime reason why only expert developers should be coding AS3. The fact that it doesn't actually work even when you do requires a high level of programming skill to manage correctly. This is not the realm of designers, animators and low to mid level Flash developers. Nobody wants to acknowledge the strictness in AS3 is not merely syntax, but extends to the entire way you develop. Most Flash developers out there are not strict or disciplined programmers. AS2's looseness (and the ability to unload swfs) is still best for creative Flash development except in the trained hands of Flash experts who know how to manage the memory management issues. If the GC implementation in Flash was truly transparent, then somebody would be able to explain why Grant's localConnection hack to force the GC to run worked. The Flash team would also provide some API methods into it. There is no API to the GC, therefore it's implementation is not transparent. And to the guy who said Disney doesn't give a shit, you're wrong. Disney is undergoing a major overhaul of all their Flash content to AS3. They've been in touch with Adobe about this. Let's not spread misinformation here. I think Adobe has done enough. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Also I want to make clear that I am not putting any words into Grant's mouth. I have not had any discussion with Grant personally on this topic. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Ha! I never said I make $300,000 a year. Where did you get such a crazy idea as that? :) The Flash player team knew they were in a pickle and instead of providing a way to punt something or forcibly shut it down, they opted to not say anything and hope that nobody figured it out. That might be ok when you only have a few hundred users, but with the way Adobe's been pushing AS3 at everyone, getting people like Colin Moock to try and convert newbie developers to use AS3 claiming how much better it is, Adobe's behavior is completely irresponsible. I make my living with Flash. I don't need other companies out there pushing competing technologies to be able to point out that the Flash player has a major issue in it so come to the darkside. Adobe needs to fix it, pronto. :)-- Smiley face laurent wrote: I hope, Steven, this is just part of the strategy. How much money have you make since flash player is out...? 300 000$ a year you said ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Laurent, you're my hero! teh internet is serious business INDEED! :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Ha! Paul Andrews wrote: You're saving them the job. If I were reading this thread I'd wonder how anyone had ever done anything with Flash. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is Adobe fixing this big FP9 problem?
Laurent wrote: what the f**k is a flash player in the universe god damn it! By the way, Disney just called me, they don't give a s**t... Kerry Thompson wrote: Ouch. Ok, I'm old-fashioned, but, please, Laurent, out of consideration for the more prudish members of the list like myself, could you refrain from that sort of language? I'm not the list mom, and don't pretend to speak for anybody but myself, but that does make me uncomfortable. Yeah, Jason Merrill works in corporate America and he has to be careful, too. Put $10 in the swear jar. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 memory management - loaded content
Hi Dave, http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html Grant Skinner recently blogged about this. Major issue. What's worse is Adobe really has no intention of fixing it. I believe Grant's blog post was an intention to put mucho pressure on Adobe by exposing how bad the issue is as well as expose how they refuse to fix it. I dunno if it's going to work but it's better than nothing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 memory management - loaded content
Dave, One thing, though. The documentation states that you absolutely must remove ALL references inside the swf, including timers, enter frame listeners, stop playback of sounds, etc., basically do a complete cleanup, before you can even remove a loaded swf. The issue that Grant brings up is that even if you do all that, it STILL does not release the memory. dave matthews wrote: hi All, Our app is designed to load Flash content examples and widgets from outside servers - anyone on the web can enter a URL.swf into the demo list and those .swf's are loaded as visitors view different areas of the site. Many of the examples we've experimented with setup processes that do NOT let go when the responsible .swf is deleted and/or unloaded from the child container holding it. What's more - even deleting the container does not stop background calculations and sounds from continuing to execute in the player. This is a huge departure from how Flash was! One of the nice features of Flash was the ability to unload content on the fly and know it was out of the player. Is there a reason for this new behavior or just a serious bug - overlooked when the Flash9 player was developed?Dave Matthewshttp://www.2GoTo.com _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Re: Two for loops and one if statement into one for loop.
Your if statement is pointless because defaultSection is ALWAYS less than maxSection because you're not altering either of those variables. That being said, this is much faster: var defaultSection:int = 3; var maxSection:int = 6; var i:int = maxSection + 1; var j:int = defaultSection; while (i--) { trace( - + i ); if (defaultSection maxSection) { while (j--) { trace( - + j); } } } Helmut Granda wrote: oh yeah forgot the loop: var defaultSection: Number = 3; var maxSection: Number = 6; for (var i : Number = defaultSection ; i maxSection + 1 ; i ++ ) { trace ( - + i ) ; } if (defaultSection maxSection) { for (var i : Number = 1 ; i defaultSection ; i ++ ) { trace ( - + i ) ; } } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Re: Two for loops and one if statement into one for loop.
Right. I should have set j inside in the if statement each time. var defaultSection:int = 3; var maxSection:int = 6; var i:int = maxSection + 1; var j:int; while (i--) { trace( i = + i ); if (defaultSection maxSection) { j = defaultSection; while (j--) { trace( j = + j); } } } However, somebody managed to suss out what Helmut was really trying to achieve. Their second example, however, was the exact opposite of what Helmut wanted, which was an efficient loop. Doing any kind of math or function call in the comparison function of a loop is the polar opposite of efficiency. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Calling Listener Functions
If you're not actually accessing any of the properties of the MouseEvent in your listener function, you could do the following: (...args) or you could keep it strict and use (e:MouseEvent = null) Either works fine, though the second one is explicitly cleaner. Omar Fouad wrote: Hi, I've got a function that is called when a listener listens an event like: fancyButton.addEventListener(MouseEvent.CLICK, myFunction); private function myFunction(e:MouseEvent):void { // statements... } If I try to call myFunction using myFunction() , the compiler throws me an error, saying that the function expects an argument. At this point how should I call this function without dispatching the MouseEvent Event?? Thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Calling Listener Functions
I disagree with this approach. It's unnecessary and makes code less manageable. It's cleaner to set the argument as optional (event = null) than write another subroutine. Matt S. wrote: You might want to separate the functions, so you would have myFunction(), which you could call from anywhere, and myClickHandler, which would handle the mouse event specifically. So: fancyButton.addEventListener(MouseEvent.CLICK, myClickHandler); private function myClickHandler(e:MouseEvent):void { myFunction(); } private function myFunction():void{ //blah blah... } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Seeking example: pop up div with greyed out background
You can't do any legwork first? This is a Flash list and you're asking a non-Flash question. Guess how easy it is to find numerous examples of this: http://www.google.com/search?q=ajax+modal+dialog Done. Mendelsohn, Michael wrote: Hi list... Does anyone have a good example URLs of a div that pops up an alert for users to do something, then have an additional div that grays out the background thus highlighting the alert div? Thanks, - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] how to check if child exists
If the display object is checking itself, all you have to do is check to see if stage == null. Otherwise, you can see if its parent contains it. parentClip.contains(dispObj); that said, i'd still like to know how to determine if a display object is in the current display list? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AIR - Insert header in XML file
Can't you inject that into your xml string? myXml = ?xml version=1.0 encoding=UTF-8? + myXml; Patrick Matte | BLITZ wrote: I'm saving an xml file with AIR, it works but how can I add ?xml version=1.0 encoding=UTF-8? at the top of the file? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AIR - Insert header in XML file
myString:String = yourXML.toString(); myString += ?xml delcaration here?; save(myString, myString.xml); An XML file is just a text file with a .xml extension. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 MouseEvent target?
Extending DisplayObject to access some of its native functionality (e.g. event bubbling) seems fine to me, especially if you look at it from the perspective of EventDispatcher has events and DisplayObject extends EventDispatcher and adds bubbling functionality. If you need bubbling, extend the class that provides that. The whole non-visual argument is a bit of a red herring considering we're using Flash and, until recently, all Actionscript was inside of or attached to a display object (MovieClip). Technically, it still is. ;) Flash is a visual tool, and I maximize my productivity by leveraging it fully. Flash has all kinds of great Flash-centric features and you can definitely use them to your advantage. It's not hacking to use the API given to you. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Interfaces
Interfaces can do much more than just help multiple coders stay on track. In Actionscript 3, they can be used to mimic multiple inheritance, decrease file size of loaded swfs, and clarify your own code. Interfaces are simple, but understanding Interfaces and how and when to use them takes a bit more time. You need a firmly established understanding of core OOP concepts like inheritance, abstract/concrete, and factories. Once you fully understand those, the transition into learning how interfaces work will be a lot easier and will pave the way for the Ah ha! moment when you actually get how they benefit you. If you're the only person working on a project, interfaces can be less useful unless you know how to use them well. Putting them in just to put them in serves no purpose other than bloating your code. But, sometimes you need to do that in order to figure them out. For instance, let's say you have multiple swfs, and some class and its inheritance chain is fairly large when compiled. Rather than import the Abstract class type in the loaded swfs, you can instead import the Interface for the class and your loaded swf won't need to know the inner workings of any class that follows the interface to compile. At runtime, the class will exist because the main movie loaded it, and all the loaded swf needs to know is that if it calls a particular method of an interface, it's guaranteed to be in the class because the class follows that interface. That's just one example of how interfaces can be used. If you want to see some example code for interfaces, install my Gaia Framework, create a new AS3 project, and take a look at the com.gaiaframework.api package. There are interfaces for all of the asset classes, as well as the the main Gaia API. There are more complicated uses for interfaces, such as multiple inheritance, but best to learn the basics before you jump into that aspect. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] removeChild - targeting question
try event.currentTarget ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 MouseEvent target?
mc.mouseChildren = false; or event.currentTarget ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 MouseEvent target?
IMO, explaining Event Bubbling as the reason the TextField is the target is complicating the immediate solution he needs, which is mouseChildren = false. Yes, it's Event Bubbling that's causing the target to be the TextField. To understand Event Bubbling, read about it in the docs, or better yet, in a book (like Moock's). But, then you MUST do it yourself to learn how it works. If you don't play with it yourself, you will never get it no matter how much somebody explains it to you. I'm fully convinced of that. You gotta mess around with it to fully understand why it's so amazingly awesome. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 MouseEvent target?
(dateStart, dateEnd) * (pbHeight+pbSpace); var pb:MovieClip = new MovieClip(); if (uint(dateEnd-dateStart) 1) { pb.graphics.beginFill(0xFF,.3);// white 50% alpha pb.graphics.drawRoundRect(0,0,pbWidth,pbHeight,pbHeight); pb.graphics.endFill(); pb.x = pbX; pb.y = pbY; var pbText:SimpleTextField = new SimpleTextField(0xFF, 14, headingFont, 4, -2, pbWidth-4, 25, pbTitle, false); pbText.selectable = false; pbText.text += ; pbText.text += pbDate; var pbf:TextFormat = new TextFormat(); pbf.font= subheadingFont; pbf.size= 10; var pbCurrentLength= pbTitle.length+1; var pbDateLength= pbText.length; pbText.setTextFormat(pbf, pbCurrentLength, pbDateLength); pb.addChild(pbText); pb.mouseChildren = false; /- HERE } else { pb.graphics.beginFill(0xFF,.5);// white 50% alpha pb.graphics.drawCircle(0,0,pbHeight/2); pb.graphics.endFill(); pb.x = pbX; pb.y = pbY+(pbHeight/2); } pb.rolloverText = pbTitle + \n + pbDate; pb.addEventListener(MouseEvent.MOUSE_OVER, pbMouseOverListener, true); scrollableBase.addChild(pb); } thanks for your input so far a On 31 Mar 2008, at 22:30, Steven Sacks wrote: IMO, explaining Event Bubbling as the reason the TextField is the target is complicating the immediate solution he needs, which is mouseChildren = false. Yes, it's Event Bubbling that's causing the target to be the TextField. To understand Event Bubbling, read about it in the docs, or better yet, in a book (like Moock's). But, then you MUST do it yourself to learn how it works. If you don't play with it yourself, you will never get it no matter how much somebody explains it to you. I'm fully convinced of that. You gotta mess around with it to fully understand why it's so amazingly awesome. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 MouseEvent target?
Take off the true flag for bubbling and set mouseChildren = true. This should solve your issue. Er, I meant set mouseChildren = false. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] JSFL Add a new font
You can do anything you want in C++. Read the JSFL docs on how to use C++ to do more complex JSFL stuff. Hopefully, the time and cost it takes to research it, write the C++, debug and deploy your solution will be less than the time and cost savings of importing a Font into a Flash library. If you can sense the sarcasm, you're dead on. ;) On the other hand, it might be possible to alter an already existing Font symbol in the Library. You might want to look into that. The history panel is your friend and so are the JSFL docs. Leon wrote: And no others way? Ex: A low-level extension for flash that extends JSFL ? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Variable scope within for loops: reusing iteratorvariables
function doSomething { var i:int; for(i=0;i++;i10) { } } Is functionally identical to this: function doSomething { for(var i:int =0;i++;i10) { } } Wrong. It's not. In the latter example, i is not available after the loop. In the first example, it is. var i:int; for (i = 0; i 10; i++) { if (i == 5) break; } trace(i); -- 5 There are a multitude of uses for this, and I do it all the time. Additionally, I read somewhere many moons ago (back in my FLASM days) that declaring variables outside a for loop is less bytecode and uses less memory. I don't believe that applies to the counter declaration, but I do know it applies to the comparison as well as vars declared inside the for loop. However, this level of optimization is only useful in a practical way on mobile and some games. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Outsourcing
If you want freelance work, here's how you do it. Make an account on LinkedIn. Get some recommendations. I get about 10 job offers each week from just that. Some full-time, some project-based. You're missing out if you're not making yourself known. :) Dwayne Neckles wrote: My sentiments exactly.. it's frustrating...thats why I became full time in NY. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AMFPHP vs RubyAMF
AMFPHP has been around a long time. It's been optimized and optimized and optimized. RubyAMF is (relatively) new. However, I have not used it, so I don't know how it performs, but I'm going to take an educated guess that AMFPHP is faster, more stable and more flexible only because of its age and widespread use. artur wrote: is there a major difference in terms of performance, stability, and flexibility? im about to built an RIA using Flex MySQL.. but havent decided on the middleware yet. whats the verdict? also whats the learning curve on it for devs who have experience with Java, JSP, ASP, PHP ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Variable scope within for loops: reusing iteratorvariables
Valid where? If that's in a class function and i is not a class variable, then the compiler will complain that you're using an undeclared variable. Cory Petosky wrote: I guess I should have provided an example when I mentioned no block level scoping. Try this on for size: for (i = 0; i 10; ++i); // Do nothing but increment i var i:int; trace(i); This is totally valid code and will trace 10! ALL variable declarations in a function, regardless of the block the variable is declared in, are performed as the function is pushed on the stack. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Tweening Engines for AS3
A few years ago, I went to work at a company and a guy had written an AS2 variable height data grid component. It was over 2000 lines of code in 3-4 classes. It had bugs and it was slow to render. He had been working on it for over two months. I sat down and wrote a variable height data grid with the same exact functionality in 41 lines of AS1 in about 2 hours. No bugs, instant rendering. While the above example is a far cry from 3k vs 8k, the point I'm making is if the extra lines of code aren't benefiting you, why compile them? For most purposes, TweenLite gets the job done. If you're doing Papervision 3D and need bezier curves and such, Tweener is the obvious choice. Both are fantastic. I choose TweenLite most of the time purely for speed, size and efficiency. If I need something more robust, I use Tweener. They're the two obvious winners. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Tweening Engines for AS3
We are programmers, we can't afford Porsches! Better change that to bike and skate... You're joking, right? Talented Flash developers are in extremely high demand right now. Every day I get 3-5 emails from recruiters or companies. It's a seller's market and people are paying top dollar for AS3 and Flex devs. Flash and Flex jobs are paying $75-$150/hr. That's $150,000 - $300,000 a year. If you can't afford a Porsche, you need to find a new job or grow a pair and ask for a raise. That being said, I don't own a Porsche because I've got better things to do with my money. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Sound.loadSound ?isStreaming?
uh. mySound.loadSound(url, true); mySound.stop(); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Sound.loadSound ?isStreaming?
;) ywc Andrew Sinning wrote: Don't you think that a bit too obvious? ;-) Thanks Steven! Steven Sacks wrote: uh. mySound.loadSound(url, true); mySound.stop(); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] JSFL Add a new font
Here's the #1 way of knowing what's not possible in JSFL. Open your History Panel (CTRL+F10). Do something. If the something you did has a red X in the lower right corner, you can't do it in JSFL. x (Create New Font Symbol) You can't do this with JSFL, unfortunately. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
Beginners should not be coding AS3. It's really that simple. AS3 requires a whole new level of strict coding practices and is not for beginners. Null pointer exceptions are extremely important to catch because they can cause a Flash app to crash, and the foresight to know where and how those will trip you up requires a lot of coding experience. I've been programming over 13 years and I still get caught by the occasional null pointer. You have to cast everything in AS3 anyway, and understanding why you have to cast requires understanding of OOP and strict coding practices. AS3 is very strict. It's not for everyone, in fact, it's not for most people. There's a reason that AS2 won't be going anywhere for awhile, and it's because it's forgiving and fails gracefully and both non-programmers and lazy programmers appreciate that. I know I miss it sometimes. Writing try catches with nothing in the catch in order to fail gracefully is hacky, but when I've got a deadline looming, I'm glad it's there because there's no way I'm going back to AS2 again. ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to expand import * statements?
Instead of writing var myVar:WhateverClass in FlashDevelop, you can just say new WhateverClass and it will autocomplete it for you. Less to type, less to erase. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Tweening Engines for AS3
For things like Papervision 3D, where bezier curves are important, Tweener is the obvious choice. For general purposes, though, Tweener is probably overkill. I'm not bashing Tweener or Fuse or any of the other tweening engines out there. For a lot of situations, TweenLite is more than sufficient. When you need the special functionality that Tweener provides, TweenLite is obviously not going to cut it. Zeh Fernando wrote: While I agree with the speed thing, let's just keep this in context - it's so when you have a lot of tweenings going on at the exact same time. A few tweens won't produce a difference in terms of framerate. If they do, there's something else wrong. Still, I think we should be glad there are so many alternatives. :) Zeh Steven Sacks wrote: Tweener is proven to be significantly slower than TweenLite, and it's almost 300% larger (TweenLite is 3k vs Tweener's 8k). I'm not telling you what to do. You're welcome to your preference. I prefer to write better, faster, smaller, more efficient code. Different strokes for different folks, I guess. :) Dave Mennenoh wrote: I prefer Tweener, and if you've ever used Fuse you'll like it's syntax. It's also quite small - adds about 8K. Dave - Head Developer http://www.blurredistinction.com Adobe Community Expert http://www.adobe.com/communities/experts/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Tweening Engines for AS3
Dwayne Neckles wrote: ALso Tweener allows you to tween frames in movieclips WITH easy... which is pretty darn useful and amazing if you ask me.. I dunno if tweenlite allows that.. Dwayne TweenLite: *Frame tweening* - you can tween to any frame in a MovieClip, like TweenLite.to(my_mc, 2, {frame:125}); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
The issue is that in Flash you are using the terrible awful why-did-Adobe-put-it-in-there publish option of Automatically Declare Stage Instances. It's the worst thing in the world and causes many people headaches. Turn it off. It's the dumbest thing Adobe could have ever made. SHIFT+F12, click on the AS version Settings button, and deselect Automatically Declare Stage Instances. Always always ALWAYS declare your stage instances in your classes. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Tweening Engines for AS3
TweenLite and TweenFilterLite are the undisputed kings of Tween engines. They're the most efficient, best performing and most lightweight. I distribute them with my Gaia framework. Jack Doyle is actually working on an improved version of TweenFilterLite right now which should be released soon. http://blog.greensock.com/tweenliteas3/ http://blog.greensock.com/tweenfilterliteas3/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom MovieClip Classes
Do you want to inherit some or all? If you want to inherit all, have RegistrationPanel extend APanel. If you want to inherit some, have RegistrationPanel instantiate APanel and have proxy methods to just the ones you want. -Steven Omar Fouad wrote: List, I have a MovieClip in my Flash Library with Class Name APanel. The class obviously extends MovieClip; Also I have another MovieClip in the library Called RegistrationPanel and It's class also would extend the MovieClip's one. Now I would the like to let RegistrationPanel inherit some behaviours from APanel. But it allready extends MovieClip... How can I do this ? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Decorator Pattern - removing a decorator
What you're experiencing is premature enlightenment. - Tyler Durden The Gang of Four specifically warns about this, and it's important to acknowledge that it's happening. When people first learn about design patterns, they will immediately begin looking for places to apply them. They will do this and fail in some particular way, and in doing so, learn more about that design pattern or perhaps one that they don't know of, yet. The issue most people have is trying to solve a problem with a design pattern they just learned without understanding that it isn't an appropriate pattern. But, you have to do it wrong in order to learn why. Prepare to fail and learn from those failures. It will make you a better coder. Your initial hunch is that your problem would best be solved by the Decorator pattern, but it very well may not be. The Decorator pattern has fallen out of favor in recent years, as many people believe it violates good OOP practices. It has its uses, but they're limited. You should continue coding this using Decorator if you like, so you can discover what its limitations are. It sounds like you're already hitting them. It's possible that Strategy and Composition might be useful here, as well. Just understand that you won't understand until you code yourself into a corner a few times. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] dictionary vs array
If you want the best performance you can get: http://lab.polygonal.de/2007/11/26/data-structures-more-on-linked-lists/ His doubly linked list is insanely fast. What I mean is, I had some code that moved non-sequential items around a list. Using an Array, I could easily cause Flash to timeout from code taking too long with 25,000 items. Using a DLinkedList, I could do the same operation with 200,000 items in about 300ms. 25,000 items was 10ms on average. Obviously, YMMV, but these classes are fantastic. Leandro Ferreira wrote: There's also a performance issue there, since some array operations(ie. splice) are more expensive than in dictionaries and some dictionaries operations(ie. for in) are more expensive than array ones. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] frameworks and classes for flash cs3
You could also google flash frameworks. Google is a great tool. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Error #1009
It is exceedingly rare that the compiler is telling you something is wrong that isn't. If you're getting an error thrown, like it or not, you made a mistake somewhere. Flash does what you tell it to do. Unfortunately, it's not always easy to figure out where the error is coming from if you don't use the debugging tools provided. Using try catch and throwing meaningful error messages will help you debug much more quickly. If you're getting null pointer exceptions, you're experiencing the growing pains of going from AS1 to AS3. It'll take time, but the more you get burned by them, the more your code will account for them and the less you'll have to deal with them. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Writing Custom MovieClip Classes
Which is exactly what I told you to do and you brushed me off. :p Brilliant minds think alike, Jason. Omar Fouad wrote: Wow.. On Mon, Mar 17, 2008 at 5:08 PM, Merrill, Jason [EMAIL PROTECTED] wrote: Try this instead, this is how I would do it (you have a few screwy things in the code you posted, too many to bother commenting on :) ): package { import flash.display.MovieClip import flash.text.*; public class DataCard extends MovieClip { public function set name(value:String):void { theTextField.text = value; } } } And in the .fla with the clip's class set to DataCard: var dc:DataCard = new DataCard(); dc.name = Hello; Jason Merrill Bank of America GTO LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Fouad Sent: Sunday, March 16, 2008 9:24 AM To: Flash Coders List Subject: [Flashcoders] Writing Custom MovieClip Classes I have a MovieClip in my project that I put in the library. This MovieClip is used in the application lots of times and I attach it on the stage on run time when required like var DC:DataCard = new DataCard(); DC.x = Math.random()*550; DC.y = Math.random()*400; addChild(DC); In the Identifier Dialogue Box I set the Class name to DataCard and I am trying to associate it to a Class file DataCard.as This MovieClip has a text field for example, and it is named nameTF. I want to be able to control the components of the DataCard MovieClip from the Class Itself, in this case to change the text in the nameTF TextField. So in the Class I worte: package { import flash.display.MovieClip import flash.display.MovieClip; import flash.text.*; public class DataCard extends MovieClip { var cardName:String; static public function DataCard():void { nameTF.text = cardName; } public function set cardName(Name:String):void { cardName = Name; } } } It shows me many errors and it does not work. when I tried: public class DataCard extends MovieClip { public function CardName(CN:String):void { nameTF.text = CN; } } and in the FLA: var DC:DataCard = new DataCard(); DC.CardName(here is the name); DC.x = Math.random()*550; DC.y = Math.random()*400; DC.name = dataCard; addChild(DC); this worked. But how can I use a Constructor, setters and getters in this case? Also how can I set the name of the MovieClip like I would do in the FLA DC.name = DCName; in the class itself? Thanks for the Help. -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Writing Custom MovieClip Classes
What is nameTF? I don't see it declared in your class. If you are using Automatically declare stage instances, turn it off. Adobe put it in there specifically for newbies to code, it's not meant for proper developers to use. Keep in mind you need to declare your stage instances as public vars. You cannot make the constructor of a class a static function. Setting card name has no effect on the value of the text field in your code. I recommend using a more generic naming convention anyway. package { import flash.display.*; import flash.text.*; public class DataCard extends MovieClip { public var TXT_Name:TextField; public function DataCard() { super(); } public function set label(value:String):void { TXT_Name.text = value; } } Omar Fouad wrote: I have a MovieClip in my project that I put in the library. This MovieClip is used in the application lots of times and I attach it on the stage on run time when required like var DC:DataCard = new DataCard(); DC.x = Math.random()*550; DC.y = Math.random()*400; addChild(DC); In the Identifier Dialogue Box I set the Class name to DataCard and I am trying to associate it to a Class file DataCard.as This MovieClip has a text field for example, and it is named nameTF. I want to be able to control the components of the DataCard MovieClip from the Class Itself, in this case to change the text in the nameTF TextField. So in the Class I worte: package { import flash.display.MovieClip import flash.display.MovieClip; import flash.text.*; public class DataCard extends MovieClip { var cardName:String; static public function DataCard():void { nameTF.text = cardName; } public function set cardName(Name:String):void { cardName = Name; } } } It shows me many errors and it does not work. when I tried: public class DataCard extends MovieClip { public function CardName(CN:String):void { nameTF.text = CN; } } and in the FLA: var DC:DataCard = new DataCard(); DC.CardName(here is the name); DC.x = Math.random()*550; DC.y = Math.random()*400; DC.name = dataCard; addChild(DC); this worked. But how can I use a Constructor, setters and getters in this case? Also how can I set the name of the MovieClip like I would do in the FLA DC.name = DCName; in the class itself? Thanks for the Help. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] to mac or not to mac
FlashDevelop is not, and probably will never be, since it's made with .NET framework. FlashDevelop beats every other editor hands down for Actionscript development. TextMate is great for other languages, and decent at AS, but FlashDevelop is truly the finest example of what an Actionscript editor should be. You will write code *measurably* faster than with any other program. FlexBuilder's auto-complete is buggy and poor, to say the least. FlashDevelop is like driving a Formula 1 race car when everyone else out there is in mid-range sedans. Beyond that, the whole Windows/OSX debate is hackneyed. There is no winner. It completely depends on what you like and what your needs are. I know plenty of graphic designers who can't STAND Mac and will only use Windows. Making blanket statements that Mac is better for creatives is regurgitating the marketing campaign of Apple from the frickin nineties for crying out loud. It's not even relevant anymore because Windows no longer runs graphic programs slower than Mac and hasn't for quite some time. If you do Flex development, then your needs will be met best on a Mac. If you prefer OSX as an operating system over Windows then by all means get a Mac. The great thing about Mac is you can install Windows on it specifically for using FlashDevelop if you want to truly enjoy coding Actionscript. http://www.flashdevelop.org/community/viewtopic.php?t=2463 That's all you need to know about using a Mac and FlashDevelop. I can't get by without FlashDevelop anymore. I donated to the project because there's nothing that has made such a dramatic difference in my production than that piece of software. If you haven't used it yet, you don't know what you're missing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Using seek on a NetStream
You can pass any time to seek, but the NetStream will jump to the nearest keyframe of the FLV. If you seek(4) and the nearest keyframe is at 7, it will jump to 7. Go to YouTube to see this happen as you scrub. Some of their videos have 15 second keyframes. If you've got control over the videos, you can publish them with more keyframes, 1 per second if you want, or more if you want more accuracy. Stutter-free loop? I'd say queue up a second NetStream of the same url and start it right when the other one ends or hits a certain timecode and attach the new one to the Video object at the same time. Shant Parseghian wrote: Hi guys, I'm having a problem using seek. In a listener for NetStream.Play.Stop I have a call to stream_ns.seek(1). I am trying to loop a stream seamlessly. I put a trace on the stream_ns.time and after the seek is called, the time displays as starting over from 0. When I change the seek command to a value of 3 or 4, it still isn't accurate to what I'm sending it. Is this a bug in my trace or is the seek not as accurate as it should be? If anyone has any advice on getting a clean, stutter free loop on a NetStream I'd love to hear some thoughts. I've tried a lot of different methods with no good result yet. Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders