Developing a website with php

For the past few weeks I’ve been developing a website using the javascript, html, css and php languages. This is not the first time I’ve delved into the depths of web development, but only now can I say that I can see the whole picture. Each language behaves differently, each one has its fair share of annoyances and problems and each one interconnects with the other in weird ways.

I could go on and on about how stupid css is, how counter-intuitive it is and how it manages to defy common sense with strange rules and interactions that turn a simple task into a giant mess of code. What could be done with one simple attribute has to be done with an escheresque contraption of divs and overlapping attributes. I am not making this up. Seriously.

And THAT’s how you make the footer stick to the bottom of the page. Easy, right?

But I’m not here to talk about how horrible css is. Yes, css is broken. Yes, css should die in a fire and be replaced with another language that understands what its suppossed to do and does it well. But the important thing is, css is NOTHING compared to php.

I am not the first one to recognize this.

And I have nothing else to add. That link says it all. I’m serious, look at that mountain of text and tell me with a straight face that there’s anything that I could possibly add to that.

Yeah, I didn’t think so.

Advertisements

Removing the context menu in flash v11.2

Remember my rant about the whole “the unavoidable context menu of flash being a fucking insult to game developers” thing? Yeah, fun times.

Anyway, it turns out that since version 11.2 (released back in January) developers have been able to disable the context menu … but I’m only aware of this fact because I did an extremely specific google search that miraculously directed me to this very blog post that I’m linking by a “Game Developer Evangelist” at Adobe. That post has a nice and rather long-winded video of how to actually disable the context menu.

In short, it’s something like this*:

//Define a function to call when the right mouse button is pressed

protected function yourFunction(event:MouseEvent):void {}

//Somewhere in your code, add an event listener that listens to the right mouse button:

stage.addEventListener(MouseEvent.RIGHT_CLICK, yourFunction);

Easy!

The funny thing is, I already had this version of flash and I didn’t notice any of the new types of mouse events shown in the video. As it turns out, to be able to win the privilege of actually being able to take control of the right mouse button, you need to configure the crap out of your IDE. Well, at least in my case.

That IDE is FlashDevelop, by the way.

After 4 hours of trying things out, failing miserably, finding new configurations to toy around with, failing miserably again with no sign of improvement, I ended up solving the whole issue by searching yet again and finding the right blog post with the exact information I was looking for.

If you’ve been on the internet for any amount of time, you know perfectly well how unlikely that is, so excuse me while I savor the moment.

Developmeeeent, FUCK YEAH
Awwwww riiiiiight

AWESOME! Fuck Yeah! I can’t believe this. Blog Post, you’re the answer I’ve been looking for for more than a year. Yeah, that’s right, you naughty post. Mmmmhhhh, yeeeeessss.

*cough*

Yeah, so, that magical blog post that I was talking about is aptly called “Configuring FlashDevelop for Flash version 11.2” and is found in this here linky.

In the possible case that the blog post is lost forever or becomes inaccessible, let me copy & paste the steps for getting Flash Develop to work with Flash version 11.2. I’ve modified some of the steps a bit to reflect the changes done to the “Adobe Support Center” downloads page.

  1. Get the files.
    You can find the installation links here.

    • Launch the flash player 11.2 installer for your OS. This is required to be able to play 11.2 content on your browsers
    • Download the “playerglobal.swc to target the 11.2 APIs ”:
      • into “\FlashDevelop\Tools\flexsdk\frameworks\libs\player\11.2\” (create the 11.2 folder as it won’t exist)
      • save as “playerglobal.swc”.
    • Download the “Standalone Debugger”:
      • into “\FlashDevelop\Tools\flexlibs\runtimes\player\11.2\win\” (create the 11.2\win folders inside “player”)
      • save as “FlashPlayerDebugger.exe”.
  2. Configure FlashDevelop
    • Go to Tools -> Program Settings
    • Click on the “FlashViewer” plugin settings page
    • Set the “External Player Path” to point to your recently downloaded “11.2\win\FlashPlayerDebugger.exe” file.
  3. Configure your projects
    • Go to project properties by right clicking the project’s name.
    • Set the platform version to 11.2.
    • Add the following line to “Additional Compiler Options”:-swf-version=15
  4. Done, test your project!

If you follow these instructions, you’ll finally be able to get rid of that horrible, horrible context menu. However, if at least one of the configurations isn’t right, when you try to add a listener for the right-click you’ll get an error saying:

TypeError: Error #2007: Parameter type must be non-null.

And … well … that’s it really.

I’m kind of confused as to why I haven’t heard about any of this from any other site. Particularly gaming sites, now that I think about it. Oh well, I hope this helps somebody out there, because the solution to this issue is not very intuitive and might be conducive to some rage induced hair-pulling.

——————

*Wordpress doesn’t seem to have a handy way of displaying code, so a citation format will have to do. Luckily, it’s kinda legible only because it’s really simple and has no indentation whatsoever.

Image taken from here.