Help with Interview Question! arrgh! Flash dynamic text Integration, xml etc

Hi Guys, First post…

I need to answer this question and do what it asks for a job interview… Trouble is… my strengths are html/css/photoshop rarther than my flash.

I was wondering if anyone would be kind enough to point me in the right direction for solving this thing. It would really help get me started.

I hope to work on researching and doing this over the weekend for hand in Monday morning…

The Task…

  1. Create a static flash ad, The ad must contain a flash button graphic that can have a dynamic label applied. In other words, the text label on the button should be able to be set from outside the flash file. Create a click area the entire size of the unit that will go to a dynamic url, again that can be set from outside the flash file.

  2. Create a simple (can be blank visually) html page and embed the flash inside the page. The dynamic button label and url should somehow be set or specified in this html page.

  3. There are a number of ways to pass in the dynamic variables. In a word doc, please briefly describe what method you used and some alternate methods.

ANY help regarding this is really appreciated. I’m not sure what part 2 means… perhaps they are wanting me to create a php form type field where the user puts in the desired button text and chooses a site they want the add to link to (this is sent to an external txt or xml or something?) which then in turn updates the appearance of the flash banner and affects where it links to automatically?

I really a bit in the dark at this stage…

Help! Thank you so much.
David

Hi David.

Probably shouldn’t help you with this, as it is sort of cheating, but I will.

For passing the data into the Flash, check out my article here on how to get data into Flash: http://fcOnTheWeb.com/articles/flashvars/

It’s perfect for what you’re after, as the button label and URL can be set in the HTML where you embed the movie and then used inside the movie as required.

As for a couple of alternate methods, you could pass in that data through XML (which is easy in Flash), or from a PHP file using the loadVars function.

Actually, what country are you in and who is this job with? It sounds like a good job for me! Haha.

Hope that helps, and good luck!

Chris, just about to dive into your link, looks very very very very useful indeed, thank you very very much. Time to get cracking. i’ll let you know how i get on! The alternate methods you mentioned… for you why do you think flashvars is the way to go rather than them?

here we go then…

Hi Chris,

I’ve got the dynamic text working from looking at your files. However when I try to open the swf file directly i get this message:

“TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at flashvar_as3_fla::MainTimeline/frame1()”

This is the case with your files too. It works fine in the html page i have embedded it into though.

I’m on a mac tonight, doubt that makes a difference…

I’m learning on my feet here but even i can see i have to make the parameter on frame one a non null… question is how…

Off the top of my head, if you try and open the SWF directly it’ll get upset because the parameter it’s requiring isn’t available - that’s set in the HTML. So if it’s not launched from the HTML page there’s no parameter.

FlashVars is the best way to go here as it’s the quickest and easiest way to solve this problem. While PHP and XML are much more scalable in the long run, they take longer to set up and, in my opinion, add a level of complexity not necessary here.

thank you Chris! you’ve been a great help.