Flashcii Now for Download

Just a quick one for people that were interested when Flashcii was first blogged about a while back, it is now available for download.

See here for more.

Just a quick one for people that were interested when Flashcii was first blogged about a while back, it is now available for download.

See here for more.

GeSHi Renderer & Proxy Classes for b2 (evolution)

Well, very inspired by Aral Balkan yesterday, got straight in Dreamweaver and started following the instructions, until I found I only had one of the files he had. I didn’t realize b2evolution was not infact b2/cafelog, it has changed considerably, ever…

Well, very inspired by Aral Balkan yesterday, got straight in Dreamweaver and started following the instructions, until I found I only had one of the files he had. I didn’t realize b2evolution was not infact b2/cafelog, it has changed considerably, everything is now very OO. Thankfully now there’s no need for hacks to the source (I hope).

Now you have to create a PHP sub-class of Renderer, and get that to do some preg_match’ing of it’s own. My PHP hat is still fairly new, but I’ll try and go through what I had to do to get it all working….you can just download it if you feel lazy.

First of all, GeSHi will (at present) only work on PHP 4 and some PHP 5 installations (specifics yet to be confirmed), but I’ve written a workaround later on in this post.

First up download the zip file provided (contains the Renderer plugin and CSS file) geshi_for_b2.zip, then download and unzip GeSHi to your b2 blog root.

  • Unzip the first file, and put _geshi.renderer.php in “b2root/plugins/renderers/” (where b2root is your blog’s root directory)
  • Place geshi.css in “your_skin_directory/geshi.css” (e.g. on mine this is “b2root/skins/custom/”)
  • Add to “b2root/config/_config.php”:
    include_once (dirname(__FILE__ ) . ‘/../geshi.php’);
  • Add to “b2root/skins/custom/_main.php” (where custom is your current skin):
    <link rel=”stylesheet” href=”geshi.css” type=”text/css” />

All done 🙂 you should now be good to go…

Usage:

  • Wrap any code in [as], [java] or [php] (etc) tags.
  • Click the tick next to “Geshi” in the Renderers palette.

Sample Actionscript:

[as]Date.prototype.getDateOffset = function(offset)
{
var retDate = new Date(this);
retDate.setTime(retDate.getTime()+offset*86400000);
return retDate;
}[/as]

Good news is, your code remains editable in the admin section, you save some CPU cycles as the CSS is pre-generated (you can generate more with cssgen.php provided with GeSHi). I’ve included CSS for Actionscript, PHP, Java, HTML, but the renderer is only looking for the 1st three of those for speed reasons, you can enable as many as you like in under a minute.

Now for PHP 5 :s :

(Un)lucky for me, my webhost is running PHP 5, which GeSHi doesn’t like, so in light of this, I’ve written a Proxy Renderer class, that will get a script on a PHP 4 server to generate the required highlighted code, and return it to the Proxy plug-in.

To install, simply download the geshiproxy_for_b2.zip files and modify the commented code in the “geshiproxy_Rendererplugin.php” file to point to your PHP 4 server (this could be a free host with banners for example). Put that file in your “b2root/plugins/renderers” folder. Next up, put the “doGeshi.php” file on your PHP 4 webhost, at the location defined in the Proxy class.

This is currently the method I am using, and so far so good as long as you’ve installed GeSHi to your other host of course.

Good luck, please feel free as always to comment on anything.

AMFPHP still kicking!

Thankyou… thankyou… Patrick for your efforts and Alessandro for pointing this out!

http://www.sephiroth.it/blog/2004_12_10_weekly.html#110267803977774175

p.s. Looking at the CVS, Mr Mineault has also added Service Browser functionality (from th…

Thankyou… thankyou… Patrick for your efforts and Alessandro for pointing this out!

http://www.sephiroth.it/blog/2004_12_10_weekly.html#110267803977774175

p.s. Looking at the CVS, Mr Mineault has also added Service Browser functionality (from the IDE?).

Flash Level 9876

Oh dear 🙁 This one really can mess up a game or application if you are publishing for Flash 6 player (or 7 in depending on coding restrictions), or at least have you stumped for a few minutes…..

Your mx.transitions.Tween’s can simply stop respondi…

Oh dear 🙁 This one really can mess up a game or application if you are publishing for Flash 6 player (or 7 in depending on coding restrictions), or at least have you stumped for a few minutes…..

Your mx.transitions.Tween’s can simply stop responding, or even better, your sprites dissappear (depending on the order the following occurs).
Here’s an illustrated problem:

This can occur in a purely AS2 (class based app), but I’m going to simplify it for now and put in some timeline based code. If you are using the Tween class to perform some animation, for example, I have a “ball_mc” on stage. I use the following on the timeline:

import mx.transitions.Tween;
import mx.transitions.easing.Bounce;

attachMovie("ball_mc", "ball_mc", 1);
var t:Tween = new Tween(ball_mc,"_x",Bounce.easeOut,0,99,30,false);
t.start();

Works a treat. Now imagine I’m running some game, placing “balls” on screen at various incremental depths (I’m not using getNextHighestDepth() because its Flash Player 6), some how my depth counter gets to the magic 9876:

import mx.transitions.Tween;
import mx.transitions.easing.Bounce;

attachMovie("ball_mc", "ball_mc", 9876);
var t:Tween = new Tween(ball_mc,"_x",Bounce.easeOut,0,99,30,false);
t.start();

Now our ball dissappears, it’s depth, overwritten. Seems that mx.transitions.OnEnterFrameBeacon uses depth 9876 for it’s own, and no-one else can have it! Ar har har!

Oh well, another depth that needs to be checked on from time to time, put that one on top of the list that v2 components reserve when it comes to getNextHighestDepth() :p

Using Yamago Upload Component in Flash Player 7

For anyone wishing to use the Yamago File upload component in a Flash 7 movie, it requires a little bit of tweaking. I wrote about how to do this in this FlashCoders thread:

http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:sss:123252

Update:
O…

For anyone wishing to use the Yamago File upload component in a Flash 7 movie, it requires a little bit of tweaking. I wrote about how to do this in this FlashCoders thread:

http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:sss:123252

Update:

Ok so Chattyfig password protected the archives, which is completely understandable, so I’m pasting my replies here:

…case sensitivity in MX2004 strikes again
🙂

Just change the Object.registerClass from:

Object.registerClass(“idYamzbrowser”, Yamzbrowser);
to
Object.registerClass(“idYamzBrowser”, Yamzbrowser);

and…

Ok I dug into it a little, and found a few things to get it started…

First up if you switch the CSS to make the FORM 50% opaque, rather than 0% you can see the real (HTML) browse button moving behind the mouse, switch to FlashPlayer 7 and you’ll see the browse button jump out of the bounds of the browser window, indicating an “undefined” co-ordinate is being passed in.

If you use alert() in the Javascript to debug the parameters being passed into:

function browseEnabled(params here) {}

..you can see that some are indeed undefined, the likely cause here is Player inconsistencies and also case sensitivity again. For example “pXmin” is undefined for FlashPlayer 7 but works when published for 6.

The fix is another case problem (convert the existing code to this):

var lMin={x:lPos.xMin,y:lPos.yMin};
var lMax={x:lPos.xMax,y:lPos.yMax};

Using undocumented features such as “MMSave” is a possible cause of problems with new Player versions (so I removed it from mine, I don’t have Use Simple buttons on anyway in the IDE). Also I found that in that same “else” statement:

this.btnBrowse.onRollOver=this.btnUpload.onRollOver=nextFrame;

..needed to be changed to:

this.btnBrowse.onRollOver=this.btnUpload.onRollOver=this.rollOver;

Shockwave 10.0.1 Installer

Well this one came as a little bit of a suprise, almost completely silent. The new Shockwave player comes in a “slim” size. (The installer via browser plug-in detection is actually called “Shockwave_Installer_Slim.exe”). Macromedia has managed to shave…

Well this one came as a little bit of a suprise, almost completely silent. The new Shockwave player comes in a “slim” size. (The installer via browser plug-in detection is actually called “Shockwave_Installer_Slim.exe”). Macromedia has managed to shave over 2mb off the player size making it just under 2.5mb that’s a pretty mean feat and will no doubt help the spread of the Shockwave player by some amount. Great work MM! 😀

I must note this is only when downloaded via a browser’s auto-install feature. If you visit the player page on MM’s site you still only have a 4.6mb option. All of us Firefox 1.0 users will probably find the slim install doesn’t appear to work when the “confirmation page” is launched post-install. It just requires you close all Firefox windows first of all.

Component/sub-movieclips initialization in AS2

Here’s a thing. You attach some MovieClip to the stage and try to style or set a components properties that resides within it, only to find your efforts are ignored. Imagine you have a library symbol containing a button, and with the following AS2 clas…

Here’s a thing. You attach some MovieClip to the stage and try to style or set a components properties that resides within it, only to find your efforts are ignored. Imagine you have a library symbol containing a button, and with the following AS2 class bound to it:

import mx.controls.*;

class App extends MovieClip
{
  var a_button:Button;

  public function App()
  {
    a_button.enabled = false;  // ignored
  }
}

The reason the setting of .enabled is ignored, according to EAS2 is that Flash works from the outside in, so a child movie can see it’s parent upon creation, but not the other way around. Now this doesn’t apply to intrinsic properties, such as _rotation or _alpha, just properties and methods you have attached to a MovieClip sub-class/component through a class.

There are a few ways around it. The most simple is perhaps the temporary onEnterFrame loop:

import mx.controls.*;

class App extends MovieClip
{
  var a_button:Button;

  public function App()
  {
    this.onEnterFrame = function()
    {
      a_button.enabled = false;
      this.onEnterFrame = undefined;
    }
  }
}

All I can say is… YUK! Colin Moock illustrates a much better method (note this isn’t the exact code for plagiarism reasons):

import mx.controls.*;

class App extends MovieClip
{
  var a_button:Button;

  public function App()
  {
    var initInt = setInterval(function (app:App):Void 
    {
      if (app.a_button.label != undefined) app.init();

    }, 10, this);
    
  }
  
  public function init():Void
  {
    a_button.enabled = false;
  }
}

Now that works, but I’m really weary of declaring a function within a method in AS2 (yes you could just Delegate it or just assign to another function in the App class) but I also dislike creating a setInterval simply to check for values. Thanks to Helen Triolo for pointing me towards chapter 13 in EAS2 in the first place (from which I came up with my own solution, which is merely a different method, it offers only aesthetical “improvements” with regards to personal taste:

import mx.controls.*;

class App extends MovieClip
{
  var a_button:Button;

  public function App()
  {
    a_button.watch("initializing", init, a_button); 
  }
  
  public function init(prop, oldVal, newVal, target):Void
  {
    target.enabled = false;
  }
}

The only thing I can see here, is that you can use the same “init” method for multiple components in the 2nd example. You can also use it for multiple types of components by incorporating “typeof” if statements, to provide for custom skinning of individual component types etc.

Perhaps the easiest method tho (spurred into action by Carl-Alexandre Malartre), is just to look out for the superclass’ (MovieClip’s) onLoad event:

import mx.controls.*;

class App extends MovieClip
{
  var a_button:Button;

  public function App()
  {
    this.onLoad = init; 
  }
  
  public function init():Void
  {
    a_button.enabled = false;
  }
}

So easily missed! You can also make your App extend UIObject and subscribe addEventListener) for a “load” event. Whichever you prefer.

If I’ve missed anything (I’m pretty tired) gimme an email!

When Macromedia meets Microsoft

First of all I want to make it clear, I am a huge fan of Flash, to an obsessive level, there’s no chance of me switching to anything else anytime soon and this is not about slagging off Flash. 🙂

Ok, with that done…

Over the past year and a half…

First of all I want to make it clear, I am a huge fan of Flash, to an obsessive level, there’s no chance of me switching to anything else anytime soon and this is not about slagging off Flash. 🙂

Ok, with that done…

Over the past year and a half there’s been a lot of talk of Avalon, and Sparkle from MS, and how it might threaten Flash in the RIA market. Most of the discussions I have seen have ended with a Flash fan saying “MS isn’t aiming at the web…it’s not a browser plug-in…Flash will be fine”. Now imagine we are 2 years down the line.

Somehow this statement fails to make a realisation. MS don’t NEED to compete “on the web”, they don’t need to develop a rival browser plug-in or Central like platform. They will HAVE the platform and it won’t require an iota of effort on the part of the user. The fact that Avalon and Sparkle are a part of Longhorn means that they don’t need people to go to a webpage through a browser to use a RIA, these apps can be spread through tiny email attachments or quick to download files from links on web pages. This has been demonstrated in various movies on the MS site for some time. The keyword is SEAMLESS and MS’s “click once technology” embodies this.

These apps will of course use the internet to communicate, but it’s more of a seamless experience for the “always on” generation that becomes ever apparent, not to mention intrinsically having the “offline” capabilities of Central.

The shift from tools to content is enormous, I see the future of RIA’s being more about what they CAN do than what technology it uses (and “do I have it?”), however obvious that may sound, it’s hard not to get caught up in what technology is being used, for us geeks 😉

Odds are Internet Explorer won’t even require the user to download and save the application file to run it, it will just run in the Window when they click a link, with the Window seamlessly “turning into” the app from the browser.

No need for a plug-in, and with the ability to harness the entire power of the OS, FileSystem, Networking, 3D accelerator and all, this is seriously limitless. Wait a second, isn’t Avalon hitting Windows XP also?

Remembering that around 95% of desktops run Windows, you might hear Microsoftians say “who cares about the other 5%?”, seriously, some people really don’t, and for those who might, Mono provides .NET on Mac/Linux so who’s to say there won’t be a new equivelent for the Longhorn featurettes in the near future, let’s face it anyone running Linux will not lack the ability to install such platform, as it is they have to a year for the latest Flash plug-in, only to have it run at 1/3 less speed. Mac and “easy” distro’s of Linux (such as Knoppix) are the only worry here.

This isn’t a cry to MM because to be honest, there’s not much they can do, other than make the FlashPlayer stronger, faster and provide some brute graphical power (*roar*)… <edit> Seems Maelstrom does just this </edit> 😀

Central is a massive step forward, if it weren’t for the fact a user must choose to download Central, trust its certificates in a post SP2 era, and then install the app they wanted after Central installs.

Player size always seems to be an issue, but here’s a little shocker…Most Flash sites I now visit easily exceed the total Flash player download size over the duration, with streaming video, pictures and sound. Is it through fear of Director and Flash inhabiting the same shelf space? I think not, but still…

Well, just some thoughts, ready and willing for some good pro Flash arguments from fellow Flash developers (I really DO want MM to succeed, and I have faith) MM still rule the web, lets hope the web doesn’t melt too far into to the desktop for it to become irrelevant to the mass of home users.

For some more emphasis on “seamless” working, please watch the Higher Education video at:
http://msdn.microsoft.com/Longhorn/productinfo/conceptvid/default.aspx

Firefox 1.0 (PR)

Just another “how brilliant it is” posting on the web. As we have seen, it is rising in popularity, but IE isn’t being *that* affected just yet. This probably means Firefox is soaking up EVERYONE that isn’t using IE (on windows). Most people still find…

Just another “how brilliant it is” posting on the web. As we have seen, it is rising in popularity, but IE isn’t being *that* affected just yet. This probably means Firefox is soaking up EVERYONE that isn’t using IE (on windows). Most people still find no reason to switch, the word “browser” is irrelevant to the average home user, the “internet” just appears on their screen when they (double)click the little blue e icon on their “main screen”, and the sites they visit are just as ^&*% and ad-filled as ever with no Googling skills to be seen :p

Best features:

  • The excellent RSS button that automatically creates a folder in your bookmarks with links to all recent entries in the feed.
  • Hit ctrl+f the highlight find feature rocks and stops you from losing your place as you “tab” to the next result.