Hi guys,
I have a very simple flash project that I need to be completed tommorow or my head is in the block! I am new to Flash and Actionscript but work well with PHP so do have some idea of what I am doing but, this has left me stumped and in trouble if I don’t get it done!
Basically my movie is very simple. I have a background and after a short break my first scene flys on with one link then leaves - then the second with a different link, then the third.
I converted all links to buttons and gave them instance names ‘button1_btn’, button2_btn’ and ‘button3_btn’ and then added my new layer for the action script.
Below is the actionscript I used to make the buttons work:
var buttons:Array = [button1_btn, button2_btn, button3_btn];
var urls:Array = ["http://mywebsite.com**", [URL=“http://mywebsite.com”][URL=“http://mywebsite.com/subsciptions”]http://mywebsite.com**/subsciptions**, "**[URL=“http://mywebsite.com/archive”]http://mywebsite.com/archive"];
for (var i:int = 0; i < buttons.length; i++) {
buttons*.addEventListener(MouseEvent.CLICK, buttonClicked);
}
function buttonClicked(event:MouseEvent):void {
for (var i:int = 0; i < buttons.length; i++) {
if (event.currentTarget == buttons*) {
navigateToURL(new URLRequest(urls*));
}
}
}
When I try to preview this in an HTML browser - all I get is my blank background scene with no animation.
When I try to preview in Flash I get this error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at banner_new_fla::MainTimeline/frame1()
I can’t see anything one with ‘frame1’ as it refers to!
I’m really confused and have spent hours on google etc tring to find the solution. All I have got is different codes that I have tried and had similar results. The best I can achieve is to get one button working or the whole animation playing but no buttons working!
I have to have this fiished in the next 2 hours so am in the s**t! If anyon could help it would be truly appreciated!
Thanks in advance.