</p> <p><?php</p> <p> $testString = "This is a test ‘ with ‘ several apostrophes’";<br /> echo $testString . "<br />"; // This is a test ‘ with ‘ several apostrophes’<br /> $testString = urlencode( $testString );<br /> echo $testString . "<br />"; // This+is+a+test+%27+with+%27+several+apostrophes%27<br /> $testString = urldecode( $testString );<br /> echo $testString . "<br />"; // This is a test ‘ with ‘ several apostrophes’<br /> ?></p> <p>
PHP urlencode() and urldecode()
April 16th, 2010Adobe Air, SQLite, and apostrophes
March 16th, 2010I’m currently developing an Air application and I run into a problem inserting file names with apostrophe (because apostrophe are used as string delimiter). There are several ways to handle this problem. You can add two apostrophes, and Jake Churchill has made a function for this.
While working with back-end I’ve used PHP’s utf8_encode edit: I meant rawurlencode() quite a lot, and AS3 has several similar functions, but there is only one that encodes apostrophes, and it’s called escape(). So what you can do is escape() the strings to be inserted into SQLite, and use unescape() after receiving the string back from the database.
Here is an example with escape() and unescape() used in AS3:
var testString:String = "This is a test ‘ with ‘ several apostrophes’";<br /> trace( testString ); // This is a test ‘ with ‘ several apostrophes’<br /> testString = escape( testString );<br /> trace( testString ); //This%20is%20a%20test%20%27%20with%20%27%20several%20apostrophes%27<br /> testString = unescape( testString );<br /> trace( testString ); //This is a test ‘ with ‘ several apostrophes’
Here is an example with rawurlencode and rawurldecode() used in PHP:
$testString = "This is a test ‘ with ‘ several apostrophes’";<br /> echo $testString . "<br />"; // This is a test ‘ with ‘ several apostrophes’<br /> $testString = rawurlencode( $testString );<br /> echo $testString . "<br />"; // This%20is%20a%20test%20%27%20with%20%27%20several%20apostrophes%27<br /> $testString = rawurldecode( $testString );<br /> echo $testString . "<br />"; // This is a test ‘ with ‘ several apostrophes’
Christmas Card
December 23rd, 2009This was my first AS3 attempt that I did at Christmas 2007. I been too busy to create a new one so I reuse it with a new image
Merry Christmas And Happy New Year all friends and fellow Flashers out there!
PS: You can drag, shake and throw me around!
Nigerian lottery mail in Norwegian
October 27th, 2009Today I finally got what I’ve been waiting for in many years; A business proposal that is too good to be true, in Norwegian. Mr. Patrick Chan sounds credible and I have allready contacted him. He only needed $10.000 to get started, the money is allready transfered to his (nigerian) account and I’m very excited while I’m waiting for my profit.
Here is the letter in full if others want to do business with him as well. His Norwgian is pretty good as well, almost as good as google translater:
Subject: Jeg trenger din partnerskap
Attention
Jeg er Mr. Patrick KW Chan direktшr og finansdirektшr i Hang Seng Bank Ltd, Hong Kong. Jeg har en lukrativ forretning forslaget av gjensidig interesse е dele med dere, det innebжrer overfшring av en stor pengesum. Jeg fikk referanse i mitt sшk etter noen som passer mine foreslеtte forretningssamarbeid. Hvis du er interessert i е jobbe med meg kontakte meg via min private e-post (ptrcchnn@yahoo.com.hk) for ytterligere detaljer
Ditt tidligst svar pе dette brevet vil bli verdsatt.
Mr. Patrick Chan
E-post: ptrcchnn@yahoo.com.hk
I just say: Go for it!
Attention
Jeg er Mr. Patrick KW Chan direktшr og finansdirektшr i Hang Seng Bank Ltd, Hong Kong. Jeg har en lukrativ forretning forslaget av gjensidig interesse е dele med dere, det innebжrer overfшring av en stor pengesum. Jeg fikk referanse i mitt sшk etter noen som passer mine foreslеtte forretningssamarbeid. Hvis du er interessert i е jobbe med meg kontakte meg via min private e-post (ptrcchnn@yahoo.com.hk) for ytterligere detaljer
Ditt tidligst svar pе dette brevet vil bli verdsatt.
Mr. Patrick Chan
E-post: ptrcchnn@yahoo.com.hk
Flash on the Beach 2009 review
October 6th, 2009Seb Lee-Delisle – PV3D:
Rating: Average
My reason for average rating is that Seb appeared to be a bit unprepared this time, and there was a lot of repetition from his session on FOTB from last year. However, repetition never hurts and he is a great speaker with undisputable skills. He showed us some fantastic both released and unreleased work he did for [the company name I can't tell]
. The course diploma however was nothing more than a gimmick with no practical use.
Richard Galvan:
Rating: Poor
Richard Galvan exposes nothing! I didn’t expect much from this session because they are holding their cards tight until the AdobeMAX conference. This is a pity because the Flash on the Beach conference deserves much more! The opening show with the singing guys was very cool though.
Keith Peters:
Rating: Very good
This was a very good session from which I learned a lot. He talked about programming challenges that I have experienced myself, and he also talked about how you may solve them. Very good!
Carlos Ulloa:
Rating: Good
Carlos is a bright guy who undoubtedly has given a lot to the Flash community, but unfortunately he is not a great speaker. I will still give him the rating “Good” for his indisputable skills and the great work he showed us.
Rob Chiu:
Rating: Very good!
Even though this has nothing to do with Flash, it is always inspiring to see Rob’s work. He makes short films that have a clear message, without tipping over the edge to become sentimental.
DR.WOOHOO:
Hmmm, too much story telling I’m afraid. I would like to see more of his work, not all the persons he admires on old and unsharp pictures. I might have missed some points here and there, but to me the whole session was a bit diffuse. I hope he will come back next year to show us some of his own work because he is a very clever and likeable guy.
Elevator pitch:
Rating: Very good
This was a WINNER! Three minutes is a very short time indeed but I was very impressed by most of the speakers who appeared well prepared, and most of them managed communicate their message out to the audience in just three minutes. Very well organized as well! Unfortunately I don’t remember a single name, but I will mention the speaker who talked about ASAXB in particular as both entertaining and informative.
Grant Skinner:
Rating: Very good
A very informative session with loads of useful tips on how to optimize your code in Flash. Simply one of the best!
Joa Ebert:
Very good
Holy shit!! What can I say? The man got standing ovations from a bunch of nerds! Shouldn’t Adobe give him an award and pay him a lot of money for just being alive?
Jeremy Thorp:
Rating: none
I attended this session 15 minutes late and my brain was still overheated after Joa’s session so I can’t rate this one.
Paul Burnett:
Both entertaining and informative! I will download the source codes and play with them. A good introduction to the world of Pixel Bending!
Craig Swann:
Rating: Poor
It was entertaining on some kind of level, but way off-topic and not so inspiring considering the subject of the conference. Sorry Craig, I’m sure you are a great guy and I would love to chat with you in a pub, but this simply wasn’t good enough.
Koen de Weggheleire:
Rating: Very good
I like Koen! He is funny and unpretentious. I joined his session last year as well. I was a little bit disappointed in the beginning because I thought it would be about vector used in physics, but this was about the data type vector. Still it was very informative and a great introduction to vectors.
Mario Klingemann:
Rating: Very good
I love this man! I love his nerdiness and dedication and skills as a programmer, but also as a speaker. It was sad that he could not finish his session. Mario is one of few people who can talk for one hour or more without being boring.
Colin Moock:
Rating: Average
I have read many of his books, watched “The lost actionscript weekend” and I find the Union server interesting, but this was basically a long sales pitch.
Jam Throwndown:
Rating: Very good
Another winner! A great idea! Maybe this is such a good idea that it should apply to all of the sessions. Give the speakers only 20 – 30 minutes and strip away some of the shit-chat. Again Joa’s live Java coding session was mind-blowing. Doing what he did requires such skills and balls that he can’t possibly be human!
Ralph Hauwert:
Rating: Very good
I attended Ralph’s workshop last year and enjoyed it very much! The same goes for this session. Ralph is a great speaker, pleasant, and a man with great skills. I hope that he will come next year as well. It is a shame that he is leaving the Papervision3D team.
Joshua Davis:
Rating: Good
Joshua is very entertaining, but most of his session is old stuff that I’ve seen before. He started by saying that this would be the last session in a few years, and I think that is a good idea. I like him very much and I’ve always admired his work. He has and will always be a “Flash hero” to me. But we need to see something new, and I am sure he will show us some great things in the future.
PV3D:
Rating: Average
My reason for average rating is that Seb appeared to be a bit unprepared this time, and there was a lot of repetition from his session on FOTB from last year. However, repetition never hurts and he is a great speaker with undisputable skills. He showed us some fantastic both released and unreleased work he did for [the company name I can't tell]
. The course diploma however was nothing more than a gimmick with no practical use.
Richard Galvan:
Rating: Poor
Richard Galvan exposes nothing! I didn’t expect much from this session because they are holding their cards tight until the AdobeMAX conference. This is a pity because the Flash on the Beach conference deserves much more! The opening show with the singing guys was very cool though.
Keith Peters:
Rating: Very good
This was a very good session from which I learned a lot. He talked about programming challenges that I have experienced myself, and he also talked about how you may solve them. Very good!
Carlos Ulloa:
Rating: Good
Carlos is a bright guy who undoubtedly has given a lot to the Flash community, but unfortunately he is not a great speaker. I will still give him the rating “Good” for his indisputable skills and the great work he showed us.
Rob Chiu:
Rating: Very good!
Even though this has nothing to do with Flash, it is always inspiring to see Rob’s work. He makes short films that have a clear message, without tipping over the edge to become sentimental.
DR.WOOHOO:
Hmmm, too much story telling I’m afraid. I would like to see more of his work, not all the persons he admires on old and unsharp pictures. I might have missed some points here and there, but to me the whole session was a bit diffuse. I hope he will come back next year to show us some of his own work because he is a very clever and likeable guy.
Elevator pitch:
Rating: Very good
This was a WINNER! Three minutes is a very short time indeed but I was very impressed by most of the speakers who appeared well prepared, and most of them managed communicate their message out to the audience in just three minutes. Very well organized as well! Unfortunately I don’t remember a single name, but I will mention the speaker who talked about ASAXB in particular as both entertaining and informative.
Grant Skinner:
Very good
A very informative session with loads of useful tips on how to optimize your code in Flash. Simply one of the best!
Joa Ebert:
Very good
Holy shit!! What can I say? The man got standing ovations from a bunch of nerds! Shouldn’t Adobe give him an award and pay him a lot of money for just being alive?
Jeremy Thorp:
Rating: none
I attended this session 15 minutes late and my brain was still overheated after Joa’s session so I can’t rate this one.
Paul Burnett:
Both entertaining and informative! I will download the source codes and play with them. A good introduction to the world of Pixel Bending!
Craig Swann:
Rating: Poor
It was entertaining on some kind of level, but way off-topic and not so inspiring considering the subject of the conference. Sorry Craig, I’m sure you are a great guy and I would love to chat with you in a pub, but this simply wasn’t good enough.
Koen de Weggheleire:
Rating: Very good
I like Koen! He is funny and unpretentious. I joined his session last year as well. I was a little bit disappointed in the beginning because I thought it would be about vector used in physics, but this was about the data type vector. Still it was very informative and a great introduction to vectors.
Mario Klingemann:
Rating: Very good
I love this man! I love his nerdiness and dedication and skills as a programmer, but also as a speaker. It was sad that he could not finish his session. Mario is one of few people who can talk for one hour or more without being boring.
Colin Moock:
Rating: Average
I have read many of his books, watched “The lost actionscript weekend” and I find the Union server interesting, but this was basically a long sales pitch.
Jam Throwndown:
Rating: Very good
Another winner! A great idea! Maybe this is such a good idea that it should apply to all of the sessions. Give the speakers only 20 – 30 minutes and strip away some of the shit-chat. Again Joa’s live Java coding session was mind-blowing. Doing what he did requires such skills and balls that he can’t possibly be human!
Ralph Hauwert:
Rating: Very good
I attended Ralph’s workshop last year and enjoyed it very much! The same goes for this session. Ralph is a great speaker, pleasant, and a man with great skills. I hope that he will come next year as well. It is a shame that he is leaving the Papervision3D team.
Joshua Davis:
Rating: Good
Joshua is very entertaining, but most of his session is old stuff that I’ve seen before. He started by saying that this would be the last session in a few years, and I think that is a good idea. I like him very much and I’ve always admired his work. He has and will always be a “Flash hero” to me. But we need to see something new, and I am sure he will show us some great things in the future.
Joa Ebert Flash on the Beach session and Java live coding
September 25th, 2009John Davey has released the video from Joa’s session, you can find at the bottom on the Flash on the Beach website.
Many have asked for video of Joa Ebert‘s session on Flash on the Beach. The good news is that I filmed the last 43 minutes of Joa’s session, and that I also filmed his crazy mindblowing 9 minutes and 40 seconds live Java coding session in the Jam Throwdown. The downside is that the light condition during his session wasn’t good enough for my iPhone so the projector screen is sometimes totally overexposed, but during the live coding part the light condition was way better.
I’m home for a few hours to repack because we are going to visit some friends far away up in the mountains this weekend without internet connection and I don’t have the time to make smaller versions of the file before I come back. Therefore the file size is pretty big because with 43 minutes of filming iPhone produces approximately 1.1GB of data. I made a compressed version on the hotel in Brighton, it’s about half the size and I have added this as well as the raw data files to my home server (which has 30 MBit upload) and here is the links.
Update: Joa’s live session on Vimeo
- Joa’s session on Flash on the Beach uncompressed from iPhone ( 1.1 GB )
- Joa’s session on Flash on the Beach compressed f4v ( 510 MB )
- Joa’s live Java coding ( 316 MB )
Enjoy!
My Flash on the Beach schedule
September 15th, 2009This is my preliminary Flash on the Beach schedule:
Sunday:
- Seb Lee-Delisle’s workshop “Papervision3D 2.0″
Monday:
- 09.00 Adobe’s keynote
- 10.00 Keith Peters: “Casual Game Architecture: How to finish coding a game without despising it“
And here comes the first conflict. I liked Carlo’s session last year, but I also find inverse kinematics very interesting, and especially this quote from the description I find very interesting: “… focus on both timeline- and ActionScript-based solutions.”
- 11.30 Carlos Ulloa: “HelloEnjoy“
- 11.30 Rich Shupe: “Lead the Hand and the Arm will Follow: Inverse Kinematics in Flash CS4“
This one is tricky as well! I joind Rob’s session two years ago and enjoyed it very much, on the other hand it is will be very interessting to see what kind of questions Adobe will get, and which answers he will give.
- 13.30 Rob Chiu: “Fear/Love”
- 13.30 Adobe Town Hall: “Town Hall Meeting“
- 14.15 Joshua Hirsch: “Big Spaceship : Fun Begets Quality“
- 16.00 Hilman Curtis: “Telling Stories“
- 20.00 Joel Gethin Lewis: “Epiphany”
Thuesday
- 09.00 Elevator Pitch
- 10.15 Grant Skinner: “Quick as a Flash“
- 11.30 Joa Ebert: “Leaving The Sandbox“
- 13.30 Richard Lord: “Application Frameworks: The good, the bad, and the ugly“
- 14.45 Paul Burnett: “More than Bending Pixels“
- 16.00 Contrast: “Unconventional Web Applications“
- 20.00 Craig Swann: “Choose Your Own Adventure“
Wednesday:
- 09.00 Koen de Weggheleire: “PLAY with Vectors !“
- 10.50 Mario Klingemann: “Connecting the Dots“
Colin Moock or Seb Lee-Delisle,it is impossible to choose! :
- 11.30 Colin Moock: “Union and MegaPhone“
- 11.30 Seb Lee-Delisle: “Work / Play“
- 13.30 Jam Throwdown: “6 Speakers – 10 Mins Each“
Jared’s session sounds (no pun intended) interessting, but I joined Raph’s workshop last year and it was very educational!
- 14.45 Jared Flicklin: “Seeing Sound – Sound Visualization in Nature & Code“
- 14.45 Ralph Hauwert: “Research Realtime graphics with Flash 10“
- 16.00 Joshua Davis: “Space“
Bug in Flex SDK?
June 9th, 2009There is a strange behavior in the Flex SDK (currently version: 3.4.0.7653) that I think is not intended. If you try to load a SWF file using the Loader class inside a class named Main the SWF is never instantiated. To recreate what I think have to be a bug do as follow:
Copy the class below into either FlashDevelop (with Flex SDK) or Flex, and compile it, and you will see that neither Event.INIT or Event.COMPLETE is dispatched. Then try to rename the file, class and constructor to whatever you want but “Main”, and you can see that the SWF is loaded and both Event.INIT and Event.COMPLETE is dispatched.
Update: As Philippe writes in a comment to this article there is a class called “Main” in the loaded SWF. It was a conflict, not a bug.
I’ll leave the article as it is anyway as a reference for others. Here is an updated FlashDevelop project with the changes Philippe suggested: LoadStuff.zip
Here is the FlashDevelop project I used to test this: loadstuff.zip
package<br />
{</p>
<p> import flash.display.Loader;<br />
import flash.display.Sprite;<br />
import flash.events.*;<br />
import flash.net.URLRequest;<br />
import org.casalib.util.StageReference;</p>
<p> /**<br />
* …<br />
* @author Thomas Gabrielsen<br />
*/<br />
public class Main extends Sprite<br />
{</p>
<p> private var _loader:Loader;<br />
private var _container:Sprite;</p>
<p> public function Main():void<br />
{</p>
<p> if ( stage ) init();<br />
else addEventListener( Event.ADDED_TO_STAGE, init );</p>
<p> }</p>
<p> private function init( e:Event = null ):void<br />
{</p>
<p> removeEventListener( Event.ADDED_TO_STAGE, init );</p>
<p> var req:URLRequest = new URLRequest( "assets/SideMenu.swf" );<br />
_loader = new Loader();<br />
_loader.load( req );</p>
<p> _loader.contentLoaderInfo.addEventListener(Event.INIT, loadInitHandler);<br />
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);<br />
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);<br />
_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgressHandler);</p>
<p> }</p>
<p> private function loadInitHandler( event:Event ):void<br />
{</p>
<p> trace( "==============\r THE LOADED SWF IS INSTANTIATED \r==============" );</p>
<p> }<br />
private function loadCompleteHandler( event:Event ):void<br />
{</p>
<p> trace( "==============\r LOADING IS COMPLETE \r==============" );<br />
addChild( _loader );</p>
<p> } </p>
<p> private function errorHandler( event:IOErrorEvent ):void<br />
{</p>
<p> trace( "==============\r IO ERROR \r==============" );</p>
<p> }<br />
private function loadProgressHandler( event:ProgressEvent ):void<br />
{</p>
<p> var percent:Number = event.bytesLoaded / event.bytesTotal * 100;<br />
if (percent == 100) trace( "==============\r 100% LOADED \r==============" );</p>
<p> }</p>
<p> } </p>
<p>}
I got my Flash on the Beach ticket!
May 18th, 2009After hectic reloading the FOTB ticket page when the counter reached 0, it all of a sudden went up to 2 hours again. I waited patiently and did a reload once in a while just to check and then, when it was about 30 minutes left, the ticket was allready on sale and the 50 super cheap tickets was allready sold out! You kind of fooled me there FOTB. Anyway, I buyed the Whole Enchilada with the ByteArray workshop at a Super Early Bird price! I’m really looking forward to this conference. But if I meet you Jon late at night, I have a bone to pick with with you about the “Tickes goes on Sale”-counter!
Sound visualizer in Flash
April 28th, 2009Per Kristian Stoveland held a cool presentation of his Sound Spectrum Analyzer at FUGN (Flash user group Norway) in the beginning of April. Inspired by this session I decided to try this my self.
I remembed seeing a beutifull graphic called “Imagination” made by Paul Neave, which he also had released as open source. So I grabbed my copy of it and tweaked a little bit and instead of mouse interaction I hooked it up with the SoundMixer.computeSpectrum() in Flash. I turned out pretty cool I think!
This is my first attempt so there will be more to come. The source code need to be cleaned up so I will release it later. The awesome soundtrack is by virgill & tasium.




