Blog

  • D&D Dice Roller v2

    I re-did my old Central Dice Roller using Flex. Basing it off of the one Wizards of the Coast did, I improved on what they had. I also improved my old one, and included it.

    I’ve been “salvaging” code all weekend; where you go through old and current projects, and look for code that you could easily encapsulate into resuable tools. The Dice Roller was one of the only things that could stand alone without Flashcom from my D&D Tools set, so it was very easy to pull out, clean up, and post. I’ve submitted to Wizards of the Coast forums; I hope they like it since they never saw the old version.

    Flex D&D Dice Roller – See It | Download Source (ZIP)

  • Flex Chronicles #10: Installing Flex on Windows XP Using Tomcat & Apache

    I can’t believe it, but I got it to work with some major help from Flexcoders (thanks Andrew Spaulding and Simon Jenkins!).

    I’ve never installed, re-installed, toggled services on & off, and tweaked my router & networking settings so much in my life. I can’t believe server people actually like this stuff. I just want a SWF…

    Another night of gaining respect and appreciation for server-side Java developers, amen.

    • First, I downloaded Flex 1.5, installed with my Non-Commercial Serial Number.
    • Second, I installed Apache Tomcat 4.1.30 (since 5.5.x, and 5.0.x wouldn’t start). Additionally, I had already installed the Java 1.4.2_06 J2E… runtime thing, and the JAVA_HOME was already an environment variable.
    • I copied my flex.war and samples.war to the Tomcat/webapps folder and it automatically extracted them.
    • I then tested my local samples via http://localhost:8080/samples, and it worked cool (I actually typed about 50 combos till I found the right port)
    • However, my server computer wouldn’t accept web traffice from my Alienware, which are both behind my router. So, I port forwarded 8080 on my router to point to my server box.
    • Then, I turned my Windows XP firewall off on my server box.

    She works, but my server is sooooooooo slow to compile my Flex apps vs. my Alienware running JRun. At least now I’m legal.

  • Flex Chronicles #9: No Library? No Worries.

    Someone who uses ActionScript heavily in Flex, I embed my graphics in Flex (since it doesn’t have a Library like Flash) using code, like so:

    [Embed(source="../../../images/dice.swf" symbol="d4")]
    static public var d4_img:String;

    If it was just a PNG or JPEG, I could remove the symbol attribute. That is for SWF files, which I like to use heavily; it removes the amount of images I have in my Flex application folders; 1 SWF vs. dozens of images folders containing dozens of images.

    The other way is to merely embed it on the image itself:

    <mx:Image source="@Embed(‘../../../images/dice.swf#d6’)" width="41" height="46" />

    The problem is, combining these techniques will cause collisions; Flex will not compile your app saying that the image was already imported.

    To solve this, I created a library of my own, in ActionScript. The technique goes something like this. You should not use _global variables in Flash, thus, you use static classes with static, public variables. All you then have to do is import the static class, and you can then access it’s variables. If you make 1 class, called “Library”, and do all of your image embedding in it, you can then consolidate, and self-contain all of your image assets into 1 file, thus avoiding collisions where other files try to embed assets already embedded elsewhere.

    So, an example class would be:

    class com.jxl.Library
    {
            [Embed(source="../../../images/dice.swf" symbol="d4")]
            static public var d4_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d6")]
            static public var d6_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d8")]
            static public var d8_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d10")]
            static public var d10_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d12")]
            static public var d12_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d20")]
            static public var d20_img:String;
            
            [Embed(source="../../../images/dice.swf" symbol="d100")]
            static public var d100_img:String;
    }
    

    Example usage for ActionScript:

    import com.jxl.Library;
    
    private var image_ldr:mx.controls.Image;
    image_ldr.contentPath = Library.d4_img;

    Example usage for Flex tags:

    <mx:Image source="{com.jxl.Library.d4_img}" width="39" height="46" />

    This will hopefully help prevent collisions, keep your library assets organized, and make them easily accessible.

  • Mobile Providers Hamper Mobile Internet

    I want to call bulls$(*t on this article… and it’s not CNN I have a problem with, it’s the inventor of the internet. Was reading this article on my phone during my break in class tonight, and was appalled. 2 seconds later, I immediately recognized that I had a few, sparse, quoted setences, taken out of context.

    Taking quotes from people without taking the entire page they spoke removes much of the true meaning behind what they said. So, in all fairness, I’m aiming my bs-detector at the article, not at Mr. Tim Berners-Lee.

    From the article:

    Berners-Lee’s original vision of the Web was as a resource for collaboration. He said that so far it had been “a big disappointment” in this respect, although exceptions such as “wikis” — essentially interactive online note pads — showed its potential.

    …uh… dude, 70% of the reason I’m where I am at today in my career is because of the collaborative power of the internet. Talk about some SERIOUSLY high expectations; that poor guy must have emotinoal scars from being drilled by investors when asking for venture capital for another multi-billion dollar particle accelerator.

    I can definately identify from where he is coming from; many of my code creations I curse angrily as being failures, even though my clients gleefully praise how neat it is and pay me dough for services rendered. The nature of being, not necessarely a perfectionist, but wanting to have your creation match your vision exactly… it’s tough and a let down at times.

    “Wikis in general are great examples of how people want to be creative and not just suck in information,” he told the seminar, pointing to the online encyclopedia Wikipedia as the most advanced development in this area.

    Dude, the wiki that used to be at chattyfig.figleaf.com sucked! Not because of the content (found some juicy undocumented Flash 5 ActionScript in there), but the whole concept of chaotic control of everyone suddenly empowered to edit the same document… what a mess. Usability? F-that shi, yo!

    I gained more knowledge, experience, and ideas from the collection minds of the over 3000+ people subscribed to Flashcoders for the past 5 years, and now I’m giving back to 5 times as many mailing lists, blogs, and community events… yeah, maybe I “sucked information” a lot of the time in the beginning, but I tried my best to give back when I could… now that’s all I do, because when I do ask questions, I’ve forgotten how to ask them, and thus they never get answered (since I’ll write a page, and people will go, “Where’s your question?”)… or I answer them myself.

    I almost suffocated on my coffee when I read that quote; had the last 7 years been a dream? I pinched myself, and quickly confirmed that the creator of the internet was smoking some serious crack OR he was taken WAYYYY out of context…or both. I’m not accusing, just surmising. What else do you do with 10 minutes between learning about the Greeks kicking the shizz-nit out of the Persians (with the Spartans’ help, of course)?

    And finally, my favorite:

    “Everyone was supposed to be browsing the Web with their mobile phone, but the problem is that it has not happened,” Berners-Lee said, adding later this was not a question of weak demand.

    “I’m reading this very story on my cellphone, you frikin’ goober!”

    In all fairness, it takes me 900 milliseconds to type my website into a new tab in Firefox. It took me 1 minute, 30 seconds to type in my website on my phone (with http:// already filled out for me), and another 10 seconds for my phone to say it was out of memory.

    No, I think a lot of the blame lies with providers. Who chooses the list of already typed in, and nicely organized links (via WAP or toned down HTML?) that I receive… not me, they just were “there” and I figured, “Cool, CNN news via my phone… this could come in handy!” But the pain to physically pull content vs. have it pushed to me… damn, I blame Cingular for that one.

    When I first met Mike Downey Day 0 of MXDU, he was telling me of the insanity a Flash developer had to go through just to get a SWF app deployed on a phone.

    No… again, either homeskillet was smoking crack, or mis-quoted. Naturally, I’m a geek, so I surf the internet on my phone, and even more subjective, I’m married to a web designer, so can’t dis ’em. Regardless, just because they’ve had XMLHTTPRequest (or whatever the heck it’s called) for the past 3 years, and haven’t had the luck of it catching on till Google hires a few bad asses to put the smack down again, kickin it RIA style with DHTML, still doesn’t mean they aren’t talented and quick learners. Hogwash. The web designers I KNOW still in the industry are awesome, smart, quick learners, and EXTREMELY versitile. There are bonds Johnny-Particle Watcher isn’t seeing here. He must never leave the lab… or CNN is being sick. I’d guess the latter… as long as they don’t take it personal and remove themselves from my phone; I need them every Tuesday and Thursday nights!

    I bet if someone takes ole’ Packet-Meister, and shows him IRC, a random MMORPG forum, datecam.com, Breeze, sourceforge.net, csszengarden.com, and the winner of the Flash Lite contest on a cellphone… he’d go, “Fascinating” in some Spock like tone, invent Nuclear Fusion (or is it Fission?) and we’d jump to the Fusion Age, making the Information Age the quickest of the 8, although quickly justifying the dot-com bust timetable.

    Regardless, at any rate, in addition too, and furthermore: Thanks for the internet Quantum-Bi..er, Mr. Berners-Lee!

    CNN Dribble

    Considering today is what today is, the internet for phones suck because they ain’t Scottish, and if it ain’t Scottish, it’s crap! Oh wait… St. Patty-Cake day is an Irish day… dammit. Well, consolation prize: I HAVE BEER AND TOMORROW OFF!!! Happy St. Patricks Day everyone! (yes, I have a wee thirty-three in meeee)