Opening a ThickBox iframe from Flash

If you don’t know what is ThickBox, check it out here: http://jquery.com/demo/thickbox/

That’s some nice way to present content on your site right? Anyway, I’ve been playing around with ThickBox for quite some time now, and a recent project required me to call up a ThickBox iframe from within Flash itself.

As the documentation on the site only provided HTML help on how to implement ThickBox, I had to look for a way to do this myself. A search on Google yielded a few complicated ways to do this, which I did not think was effective since they involved writing of new Javascript functions. Then, I found this article which describes how to do almost exactly what I wanted - but, it requires a writing of a new function. And, it is opening an image, and not an iframe.

With what I learnt from the article, I went to take a look at ThickBox’s code. Thanks to their neat comments, I understood how the functions work after a few minutes, and I implemented what I learnt from the article (which is how to use ExternalInterface) to do exactly what I wanted.

The idea is to call the Javascript function that launches a iFrame ThickBox from thickbox.js. The function name is actually tb_show, with 3 parameters that you can pass in, namely, the caption, url and imageGroup. Obviously, what I need to pass in here is the URL.

Therefore, with the ExternalInterface, this is the code I need to put into Flash:

[code lang="actionscript"]
import flash.external.ExternalInterface;
Button.onRelease = function(){
ExternalInterface.call(”tb_show” , null ,”page.html?KeepThis=true&TB_iframe=true&height=150&width=150″ , false);
}
[/code]

If that doesn’t make sense to you, you need to see how ThickBox is launched with HTML originally:

[code lang="html"]
Click Here
[/code]

You can see that it requires the a tag to have a “thickbox” class. Which is why you can’t just use a getURL in Flash.

I hope this helps people out there. =)

Tips for Sorenson Squeeze

- make sure frame rate is the same as swf
- set to uncompressed audio if video is in timeline.

The reason for point 2 is because flash will automatically compress audio in embedded FLVs, so if you compress audio in Sorenson, you’re getting your audio compressed again in Flash. That’s compression twice!

End of Google adsense testing

I’ve removed all the Google ads. My experimentation tells me that I will need to allocate time to practice SEO and to maximise adsense income. lol.

The ads have been here a little over 2 months, and I got about US$3.60 from it. But I can’t withdraw anything until I get $100 of course, so I pretty much earned $0.

I’ve changed the theme of the site to prepare for a custom theme. This theme for now, I think has more readability and looks more organised than the iTheme one.

If you would like to see the iTheme skin instead, do let me know.

Adobe Thermo

I always thought Flex should have a UI interface like Flash does, so that designers or beginners can start to do Flex. After looking at Adobe Thermo, which Adobe very mysteriously decided to launch as a seperate product. I found what was supposed to be there!

With Adobe Thermo, you’re supposed to be able to directly import your PSD, and start working on it to be a Flex application. Things like scrollbars, lists, buttons, with rollover states and some animations. You can do all that with a GUI now, with absolutely no coding at all.

But if you are a very experienced Flex coder, you would want to have control over the code. Guess what? Thermo has it too! I’m not going to delve any deeper into this absolutely cool and amazing product, I’ll just let a video which Aral Balkan took at the Adobe Event.

http://aralbalkan.com/1050

Enjoy!

Have you seen this site? : 75.UFC.com

I’m starting this new “section” on DesignFission for now. It’s called “Have you seen this site?”.

In this section, I will post sites that I think that are either:

  • Technical Excellence - Sites that are made with really cool skill and technical know how.
  • Amazing Aesthetics - Sites that are really beautiful in terms of look.
  • Slick Transitions - Sites that have really cool transitions. I find this very important in a site recently. Smooth transitions seperate a good site from an amazing site.

So for the first site for this section. It’s a site by Red Interactive. The site where you get your own person and you can jump around and interact with all the users checking out the site at the same time. Their domain name is really cool too.

But we aren’t talking about their portfolio site. That’s been talked about enough I think. What we want to see is http://75.ufc.com. I’m rating this site under the Technical Excellence category, and Slick Transitions too.

The entire site feels and works so seamlessly that it no longer feels like a website. A good and fast streaming server can be thanked for the speed, but I think Red did a really good job presenting the information.

Click on one of the sections and you will notice that the URL will change to one with a variable behind as well. This lets you access the particular section of the site immediately, probably for viral usages.

Overall, this site really gave me a intuitive experience and although not a boxing fan, I actually stayed to watch a few videos.

Check out another of the UFC site also by Red if you’re interested, which is almost as good as 75 in my opinion.

Resources Update

It’s been some time since I’ve posted some resources for Web Designers/Developers. A quick trip to Digg yielded me 2 sites that each have their own list of resources.

The first is 100 (Legal) Sources for Free Stock Images.

The next one is 77 Resources to Simplify your Life as a Web Designer.

iPod classic or touch?

I’m stuck between the 2.

It’s going to be my first iPod for myself and I don’t know which one I should take! Here’s a picture showing the pros and cons of each model.

ipod.jpg

As you can see, the price of the iPod touch is a big con, and so is the small hard flash disk capacity. The wifi is a major boost though. Being able to check my mail on the go for free at one of the wireless hotspots in singapore is very enticing indeed.

Then again, battery life is important for an NS man. But how long am I really going to care about the battery life? Only for the 2 weeks confinement I guess. I’m not very excited about swiping through interfaces with my fingers though. The last time i tried it, it was exciting for 5mins at most, and then I got tired of it. =x

So what should I get? A classic, or a touch? That is the question.

Updates

I just came back from watching a late night movie(Balls of Fury), it was hilarious and lame at the same time. Maggi Q was amazingly sexy lah. You guys should go watch it. It relieves stress. lol.

Anyway, I met up with Isaac as well, who was desperate to look at girls cos of the 2 weeks confinement he just finished. =P He looks funny when he’s “botak”. I took some pictures of him botak as well, due to popular demand. Check your mailboxes, group 11 ppl!

Zoundry

This is my first post with Zoundry, a desktop blog publishing tool.

Anyone who uses WordPress should check this out! It’s really easy to setup, and it’s totally free. So go check it out. ;)


Technorati : , , ,
Del.icio.us : , , ,
Ice Rocket : , , ,
Flickr : , , ,
Zooomr : , , ,
Buzznet : , , ,
Riya : , , ,
43 Things : , , ,

Updates

It has been a really busy and fulfilling week for me. After the period of drought, there’s this flood now! I’m talking about freelance projects that is.

I’ve been contacted by previous clients. Contacted by people whom I do not know, and I do not know where they got my contact from. Contacted by recommendation. Contacted to replace/cover up for people going to NS. lol.

I guess from now till I enlist, I’ll be busy already. It came at good timing, I’ve been broke for a while now. =P

Enough about myself now. I’m just here actually to post something exciting for everyone to share. Yeah, I always share. =P I don’t keep what I know to myself, unlike many people I know.

So here’s the news - Gotoandlearn.com is back up! If you haven’t been there, get there now. I hope I can open a site one day that is as helpful as his!