Skip to content

Macromedia Components & Object.prototype Don’t Get Along

In most of my flash projects I have a prototype file I include into the project. It contains additions to core objects such as Object, MovieClip, etc. Well, today I found out that some Macromedia components (ComboBox was the one I was having trouble with) don’t like additional methods to be defined on certain classes (Object was the one I found that ComboBox was having issues with); they fail to continue to work with additional methods defined. However, there is a workaround: ASSetPropFlags. Simply hide all additional methods with this line of code: [code lang=”actionscript”]ASSetPropFlags(Object.prototype, null, 1);[/code] I can’t wait until AS3 can be used all the time.

Continue Reading

Flash: Create MovieClip With Custom Class

I’ve always wanted to attach a movieclip to the stage with a class other than MovieClip without having to use swfmill or the ide to create a movieclip with linkageID + custom class. Well that day is finally here! I found a nice snippet of code on the net and modified it a bit to act more like attachMovie (ability to specify an initOb). The result? createClassMovieClip:s [code lang=”actionscript”] /* Description: A function used for creating empty movie clips with subclass association. Parameters: c:Function – The class to associate with the the empty movie clip. name:String – The instance name for the empty movie clip. depth:Number – The depth for the empty movie clip…

Continue Reading

Flash & Fonts

I’ve written about the pains of fonts in flash before; and it something that still plauges my work today. However, since that post new tools have been created, new workflows introduced, and with that some new findings. Fonts With SWFMILL SWFMILL is an awesome tool that may allow you to leave the Flash IDE untouched for some projects. However, embedding fonts seems to be scarcely documented (I had trouble getting the methods documented working). Here are the two links I’ve found that document embedding fonts with swmill: Adding fonts to your SWF with FAMES Using SWFMILL I wasn’t able to get embedded fonts working using the information above, so here is my method. This is what my swfmill xml looks like…

Continue Reading

AttachMovie & Loaded Clips

Using attachMovie when you’ve loaded other clips into your movie has always been very painful. You can’t attachMovie a asset into a loaded clip that is located in the parent movieclip, and conversly you can’t attachMovie a asset in a parent that was loaded into a child. This is extremely frusterating… but after some searching today I came across this interesting link. Using the fact that Flash likes to cache everything it can, he created a function that will load an clip that contains an asset into the movieclip you are trying to use attachMovie from. Nice idea, never thought of doing this before…

Continue Reading

Jump To A HTML Anchor in a WebView

This isn’t something that is as straightfoward as you would think. There is no real ‘cocoa native’ way to acomplish this, and there seemed to be no information anywhere on how to acomplish this until I found this post. So it seems the only way to scroll to an anchor is to resort to evaluating javascript code: [code lang=”javascript”] – (void) jumpToAnchor:(NSString *)anchor { [oWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@”var anchor = document.anchors[“%@”];window.scrollTo(anchor.offsetLeft, anchor.offsetTop);”, anchor]]; } [/code]

Continue Reading

Don’t Forget To Flush…

No, not the toilet, your file streams. I was recently working on a project that involved creating a child process and reading its stdout to update the user inteface. Everything was working great until I sent it off to some testers who reporting that it ‘wasn’t working’ – the interface wasn’t updating correctly. I first thought it was a problem with the shell command itself, maybe it wasn’t performing the operation correctly and thus wasn’t sending the correct message through stdout but as far as I could tell everything was working perfectly. After about 3 hours of banging my head against the wall trying random things I finally thought to flush the stdout after sending my status message. It fixed it!..

Continue Reading

XASH 1.4

Following the XTrace 1.1 update is XASH 1.4. This is a smaller release, but still comes with a good number of improvements: Search speed improvements Hitting return with the help tree in focus will open the currently selected page in the help tree Hitting return in the search field will cause the top most search item to open The book filter is now ‘sticky’ (remembers which book you last filtered by) Compiled & tested as a universal binary Actionscript 3 Support Alot of people have emailed me asking about support for Actionscript 3. The fact is, I dont use Actionscript 3 yet (don’t do nearly as much Flash work as I did), so I have no desire to add support for Actionscript 3 documentation…

Continue Reading

XTrace 1.1

At last XTrace 1.1 is out the door! This has been a long time coming, and has alot of changes & new features: CMD+Shift+C now clears the log window XTrace now automatically starts the trace server Added the Sparkle (auto updating) framework Added the ability to disable wrapping in the log window Added the option for window auto-close (log window will close when the SWF it is connected to closes) New icon thanks to Ale! Log message coloring/formatting thanks to Daniel Giribet Compiled & tested as a universal binary I’ve recorded a quick tutorial on how XTrace works. If you’re new to XTrace, or just want a quick refresher I encourage you to take a look. If you would like to get involved with development, please send me an email!..

Continue Reading

mach_override on Intel Macs

I was disappointed last month when after a hour or two of hacking I couldn’t get mach_override (evil, I know) to work on my new MacBook Pro even though it had been ported to intel macs. I added myself to the procmod group and tried everything that google could come up with, but I could only get it to succesfully override local functions, it wouldn’t override any library/system functions no-matter what i did. Today I’ve found the solution on the ExtendAMac mailing list hosted on sourceforge: this simple post contains a small patch that seems to fix all the issues I’ve been having…

Continue Reading