Calling jQuery Functions From Flash

Dec 4, 2010

Recently I took on a freelance project building a Flash module for a company. There were other components to the site built in html/css by their in-house front-end team, and the team had hooked up a form to display using jQuery. They wanted a button in the Flash module trigger the form’s visibility.

At first, I thought, “no problem, jQuery is JavaScript, right? Calling JavaScript functions from Flash should be a no brainer – just use Flash’s ExternalInterface!” But for some reason, i wasn’t able to access the jQuery method. The button in Flash was clickable, but nothing happened. I wasn’t getting any JavaScript or ActionScript errors, either.

Stumped, I sat there for a few hours, debugging and trying to figure out if it was something not done right in Flash. I looked on Google as well, and couldn’t find any articles on how to call jQuery methods from Flash.

Finally, I came upon some random forum post (which I’ve now lost) where a person had asked if it was possible to trigger a button event. A lightbulb went off in my head – the jQuery method was able to be called from a button click in the html page using the jQuery $(‘#htmlElement’).click(); mouse event, would I be able to fake (or trigger) a button click event?

YES! I wrote a quick JavaScript function outside of the jQuery $(document).ready(); method whose sole purpose was to trigger the button click event, and had flash call that JavaScript Function. Code below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript">
			function jsFunction() {
				jQuery('.formLink').trigger('click');
			};

	 		$(document).ready(function() {
				function displayForm() {
				  //code that displays and hides the form goes here
				}

				 $('.formLink').click(function(){
					displayForm();
				});
			});
		</script>
	</head>
	<body>
		<!-- sample HTML Button Link -->
		<a class="formLink" href="javascript:void(0);">Ask Us</a>
	</body>
</html>

*This example points to a local copy of jQuery. Download your own copy from the Downloading jQuery page. Also, it’s good practice to place custom scripts in their own files and reference them using the script element’s src attribute, but for the sake of the example, I simply left it within the HTML.

and in Flash:

import flash.external.ExternalInterface;

ExternalInterface.call("jsFunction", "");

I decided to write a blog post on this because it took me a while to find a solution to my problem. I hope someone finds this helpful! jQuery is still relatively new to me so if you notice anything wrong with my example, or know of a better method, please feel free to comment below.

Attack Sequence Gamma – World Collabs 7 w/Justin Maller

Dec 3, 2010

This is my entry for World Collabs 7, Abduzeedo’s seventh monthly collaboration contest. I’ve had some extra time on my hands lately so I’ve decided to submit this month. I had lots of fun working on this – I used to really enjoy doing photo manipulations and I hope this gets me going again!

Attack Sequence Gamma

Justin Maller’s original ‘unfinished’ artwork:

(quoted from Abduzeedo)
What is “The World Collabs”?

“The World Collabs” will give you the possibility to work with PSD files of established artists. TWC gives you a secret in-view in the workflow of the stars and catapults you miles forward in your journey to design heaven. This way you learn to practice with different shapes, backgrounds, patterns brushes and new styles.

Every month we will offer you an unfinished piece of an experienced and accredited graphic designer to the world.

The piece will be unfinished, so you can complete the PSD-file with your very own style. This way every month you can collaborate with the best designers of the world. The final pieces will be judged by the Abduzeedo Team and the artist himself. The three best works will be rewarded with prizes.

Aviatorlove

Jun 7, 2010

Aviatorlove

Finally felt inspired to make some random artwork, it’s the first photo manipulation I’ve done in a long long time.

Featured in abduzeedo daily inspiration #522

Meredith Marsh’s Business Card Exchange

Jun 7, 2010

A Few months ago I signed up for a buisness card exchange, or #bizx, hosted by @meredithmarsh, and I submitted my business cards, designed and produced by Jamie Hoyt-Vitale, a good friend of mine. I wrapped them as carefully as I could, 4 stacks of 32 or 33 cards, the stacks individually wrapped with paper, then wrapped with a layer of cardboard and taped up, and placed into a padded envelope so the corners wouldn’t get messed up in shipment. I think I may have over padded it but hey, better safe than sorry right?

I received the package in the mail today and put off making dinner to go through the cards. I’ve always LOVED business cards and have collected ones that I thought were designed well, so I was really excited to be able to finally have them in my hands!

They came in an envelope that fit perfectly in my apartment’s mailbox:

4 stacks of cards rubber banded together, 2 of the stacks were the leftovers from those who decided they had more important things to do..

Still, it was a lot of cards, and I laid them all across the table (please forgive the messiness of the table, I had to push everything aside for enough space!)

I noticed that a lot of people went with rounded corners:

Small and differently sized business cards were also pretty popular:

I gotta say, huge text is one of my favs:

Lastly, there were a lot of spot UV coated cards, but my camera wouldn’t capture them too well..

My favorite card design of all of the cards submitted is Cathy Olson‘s card for Love at First Invite.

All in all, there were a lot of nice cards! Nice work everyone!

I took some video and put together a 15 second clip:

bizx from doitJEFFSTYLE on Vimeo.

Thanks, Meredith, for putting this all together, it was a really interesting experience!

edit:
@thedesigner4you has put together a list of almost all of the #bizx participants on twitter, check em out! You can also check out her blog post.

Here’s a few more posts by #bizx participants, Steven Trotter, Branden Silva, Artiatesia Deal, and Niki Brown.

The Thumbplay Widget: The Evolution of Rich Media Ads

Feb 12, 2010

For me, it all started in 2007. I was still pursuing my BFA in New Media Design at Rochester Institute of Technology. My friend Adam Barnum had just gotten a designer position at Thumbplay. As it turned out, they were making a huge marketing push to sell mobile content, their major product at the time being Ringtones and Wallpapers (their current services now push Full-Track MP3′s and soon, streaming music, but I digress). They had designers, but they needed a Flash person to help implement their designs. I agreed to help, and we were soon on our way.

I was doing tons of Flash banners, from regular website banner sizes (728×90, 160×600, 300×250) to even the banners that were displayed on the top of AOL Instant Messenger buddy lists. Each banner had around 4 pieces of content. The process was simple, create a template file in all shapes and sizes using their creatives, and cut and paste all the new content in. The issue here was that all of the advertisement companies enforced ridiculously strict file-size requirements (think 15-20k, really ridiculous, considering the amount of content that was in these banners), and so I would be optimizing all aspects of the banner until the banner’s file size was under the threshold. SWF file size optimization almost became a science – recreating as many of the design assets in Flash (because more images mean a larger file size, and re-drawing designs in Flash are vectors, which are math-based and have a much smaller file size), compressing images as small as they could be without the loss of quality, and using as few embedded font faces as possible.The audio previews were pulled dynamically from Thumbplay’s CDN servers, so there was no issue there. I became a machine, generating so many Flash banners over such a short period of time that my classmates had started calling me the “banner guy”, and they came to me when they needed optimization help on freelance projects that dealt with banners.

One of my contract projects shortly after that was a Flash module for a landing page, codenamed “Lefty” (above). It was a pretty simple setup, an XML-driven Flash module that displayed album art and played previews. There were next and previous buttons that would let the user cycle through content. The Flash module was placed into an image of a phone on the landing page, and the creative/marketing team at Thumbplay were extremely happy with the results. The benefit of having dynamic content powered by an external XML file was a huge time and money saver, and they were able to update the landing pages internally with new content, whenever and with whatever content they wanted.

Because of the amazing portability of this setup, they became XML-hungry addicts. XML this, XML that! Pretty soon all of the Flash banners I created for them had the great power of XML driven content behind them, and they were able to maximize impressions, which led to more subscriptions. Best of all, there was only one .SWF file per size, per design, and they were able to create banners by simply creating a new XML file and changing the XML URL flashvar that was passed into the banner.

I graduated in May of 2008, and they scooped me up to bring me in house. Most successful of all the banners was Thumbplay’s Google Gadget, a Flash widget that was served on Google’s Gadget Ad Network. The biggest advantage to this network was that Thumbplay’s marketing team could have the widget content match the webpage’s content around it, for example, a Kanye West Widget on Kanye’s Flashing Lights YouTube music video page, the popular Daft Punk soundclip site iDaft(above), or a Britney Spears widget on a popular Britney news blog(the first photo in this entry). Being able to customize an ad based on the content displayed on the page made it more likely for people to want to click it, and increased click-through rates severalfold.

For even more exposure, the folks in the business development department decided to take these ads to MySpace for Thumbplay Open, an affiliate program where artists and other partners could make referral money when people subscribed through their links. We ran into a roadblock here, because MySpace doesn’t allow link-outs from Flash modules embedded on MySpace. We managed a work around, which was just to include an html footer that linked to a general landing page. That way we could still have the customized content while being able to make our affiliates money. We were able to create the Widgetron (above), which allowed our partners to easily create customized widgets with personalized music lists, colors, and sizes. Our Affiliates would then be able to copy and paste the embed code on their sites; the whole process could take less than five minutes. Today the widgets are embedded on hundreds, if not thousands of artist MySpace sites.

The widgets were huge. At one point we were acquiring many thousands of subscription sign-ups a day! Everyone loved them, even our competitors. Over half a year later, we saw many attempts to imitate our success, with similar gadgets popping up around the web, made by rivals Jamster, Sendme Mobile, and other rival companies as well (below).

Imitation is the best form of flattery, isn’t it?

The views expressed in the above entry are my own and do not necessarily reflect those of Thumbplay, Inc.

50+ Excellent WordPress Resources

May 25, 2009

It’s been a while (in fact, it’s been several months..) since I last posted and declared my urge to become a more active blogger. As much as I really want to blog more regularly, I’m finding that free time is hard to come by these days! However, I have been keeping up with my RSS feeds and bookmarking those that I think I’ll go back to. To get my blogging back on track and to start things off, I’ve compiled a list of inspirational and helpful WordPress sources. I hope the links in this post are useful to you!

Inspiration: WordPress Design/Usage

Resources: WordPress Themes

Resources: WordPress Plugins

Tutorials, WordPress Hacks, Code Snippets, and Techniques

Tips

Other Posts to Check Out

I’d love to hear from you! Please feel free to leave me a message below if you have any questions, comments, or any other links to add to my list. Look out for other posts from me in the future by subscribing to my RSS feed, and make sure you follow me on Twitter for my latest finds!

JeffLinDesign is Now JeffStyle

Jan 26, 2009

I hope everyone’s new year was great (I know I’m a few days late..)! Much of the time during my winter holiday was spent moving my hosted files over to Media Temple and designing a logo for JeffStyle. I’ve imported all my blog entries from labs.jefflindesign over to this one, which was extremely easy thanks to the great import/export functions in WordPress! I’ve also tweaked my blog design a bit, and I’m not completely content with the entire setup, so I’ll be modifying the design from time to time to try new things out.

As 2009 has already begun, I’ve decided that I’m going push myself to be a more active blogger! I hope that will inspire myself (and maybe even others) to push my skills further and also allow me to expand my network with more talented people in the industry.

Don’t forget to subscribe to my new RSS feed (via FeedBurner), and follow me on Twitter.

FITC 2008 Recap

Apr 24, 2008

As attending FITC in Toronto for the first time last year was a life changing experience, this year I bought my super early bird ticket, in hopes of another great event. And it was. In fact, in the past year I feel that I’ve advanced pretty far in terms of knowledge related to the industry (a lot of it thanks to Matt Wright from Rokkan, Adam Barnum, and Jason Arena as well as my other professors from RIT New Media), and I’ve had a lot of enlightenment from the websites of many of the speakers that were present at FITC; it made each and every presentation that I went to all the more valuable.

This year, the amount of RIT New Media students that attended the event has almost doubled, and so we definitely didn’t get as lost in the crowd – in fact, we were the crowd! (at many of the sponsored parties, at the least! ) It’s good to see more of the underclassmen there at the event, taking advantage of both the student pricing and the close distance that Toronto is to our school. I’m sure a majority of them enjoyed the event and were inspired by the speakers.

On Sketchnotes: In my last post, I had written about Mike Rohde‘s inspirational sketchnotes from sxsw. Sketchnotes are hard. Whilst sitting at Jason ‘JTed’ Theodore‘s creative presentation, How To B.S.(BrainStorm) Better, I attempted to take sketchnotes, but I found that often JTed was speaking too quickly for me to actually take notes neatly. I ended up re-sketchnoting the notes from his presentation, which ended with the result below:

FITC Sketchnotes

Next time I’ll probably have a regular pad to jot down my notes, and rewrite/sketchnote them after the presentations. I also noticed that, at the more technical lectures, there were less to actually sketch out, hence the two liner at the end that simply was a url to Colin Moock‘s lectures (the url’s actually moock.org, and not his full name colinmoock.org).

Some of the other notable Presentations I attended were:
Si Scott - Challenging Imagination
Mike Downey – Adobe Keynote
Erik Natzke – Beyond the Knowledge: TheArt of Playing
Mario Klingemann – The Pixel Whisperer
GMUNK – GMUNKICKDOWN 08
Ralph Hauwert – Flash 2D & 3D Effects
Scott Hansen - ISO50:Blending Analogue & Digtial
Ryan Honey & Orion Tait – How Buck Goes About Making Commercials & Stuff
David Eriksson – North Kingdom – An Inside View
Jarnes Eberhardt - 2D Barcodes for Mobile Devices
Brett Forsyth – Building Multi-Touch Interfaces with Flash
Grant Skinner – My Favourite Things

Unfortunately, I missed the last three presentations, but I had hoped to watch/listen to Group 94, The Ronin & Dstrukt, and Robert Hodgin. All of the presentations I was able to attend, though, were really informational and I enjoyed them a lot. Overall this year I think it was definitely better than last, I’m really looking forward to going to FITC and other conferences like that in the future!

thanks for the linkups!:
jted!
jonezy

Creativity & Inspiration: Sketchnotes

Apr 10, 2008

A few weeks ago I had been surfing the net and found an inspirational drawing that was just drawn in a moleskine notebook ~ it was then that I impulsively ordered some moleskine sketchbooks off ebay (for cheap!) in hopes of finding new ways to being creative and inspiring myself. I received them in about a week but I’ve been busy working on new media team project stuff and enjoying this rare sunny Rochester weather, so I haven’t opened them or looked at the stack of moleskines sitting on the corner of my desk. This morning, while surfing WeHeartIt, I came upon Mike Rohde‘s sketchnotes(pictured above) from the SXSWi 2008 conference. I found them really inspirational, so I think I’m going to start keeping some sketchnotes, and I’ll probably have a moleskine in hand while at FITC! We’ll see how my sketchnotes come out! If you’re reading this post, Mike, thanks for scanning & uploading your sketchnotes, and inspiring me!

KeithBeltramini.com // Keith Beltramini

Apr 2, 2008

I helped my classmate and friend Keith Beltramini design and develop a website to display his 3D, Motion Graphics, and Animation work. His work is outstanding, so be sure to check him out!

Page 1 of 3 1  2  3 »


blog.jeffstyle.com Copyright 2009 Jeff Lin. Hosted by (mt) Media Temple.