Saturday, July 31, 2010

BP14_Flash3


Success! But wow does Flash have a lot bugs in it. Although the screen shot I have on this blog post shows what I created, it does not show the animation or ActionScript code I had to figure out. Go to my site to check it out (click HERE).

Basically tweens (the animations or movements) are very fickle things when converting them into symbols (what you need to do to create a button or link and to write code in it). After some troubleshooting I had the convertion process down.

So, after I had my nice text (that represented each page on my AR site) and nice animations, I needed to allow a visitor to be able to click on the word and go to that Webpage. In order to do that you need to write ActionScript code. Here is an example of what the code looks like:

button_ar.addEventListener(MouseEvent.CLICK, goAr);
function goAr(e:MouseEvent):void {
navigateToURL(new URLRequest("http://web.me.com/antosb/Site_2/index.html"));
}

Jibberish! Basically the code is saying "hey, Flash, pay attention when somebody clicks here (addEventListener(MouseEvent.CLICK goAr) and create a function, or program, called 'goAr' (which is short for "go to Action Research Webpage"). So it creates the function 'goAr' which navigates to a URL of my choosing (navigateToURL(new URLRequest("http://web.me.com/antosb/Site_2/index.html")). The URL I want goes in quotes. And repeate 13 times for each Webpage!"

My timeline was sloppy and my coding had bugs, but I worked through it. I am happy I had some background (very very very small background) in Flash programming because it really helped me marry the Flash timeline for Webpage creation and the functions it is able to execute.

I am looking forward to more Flash programming! Nerd!

PS. I also had to figure out how to insert my Flash .swf file into iWeb, which was a huge pain. If anybody ever needs help with that, I have a nice template to expedite the process. But wow they don't make it easy!

1 comment:

  1. Awesome stuff Bryan! Might need to use you as a resource for doing some of the Flash stuff. I also checked out the Flash tutorials for my last blogging assignment. Would love to get some of that into my AR website as well. Looks good man!

    ReplyDelete