PDA

View Full Version : Flash menu in html page



flashbe
October 22nd, 2008, 10:51 PM
I have just started to experiment with flash so this question comes from a newbie:

I created a flash menu (which I'm pretty happy with) with the following action script code;

about_mc.onRollOver = function () {
about_mc.gotoAndPlay("_over");
}
about_mc.onRollOut = function () {
about_mc.gotoAndPlay("_out");
}

videos_mc.onRollOver = function () {
videos_mc.gotoAndPlay("_over");
}
videos_mc.onRollOut = function () {
videos_mc.gotoAndPlay("_out");
}

photos_mc.onRollOver = function () {
photos_mc.gotoAndPlay("_over");
}
photos_mc.onRollOut = function () {
photos_mc.gotoAndPlay("_out");
}

training_mc.onRollOver = function () {
training_mc.gotoAndPlay("_over");
}
training_mc.onRollOut = function () {
training_mc.gotoAndPlay("_out");
}

nutrition_mc.onRollOver = function () {
nutrition_mc.gotoAndPlay("_over");
}
nutrition_mc.onRollOut = function () {
nutrition_mc.gotoAndPlay("_out");
}

news_mc.onRollOver = function () {
news_mc.gotoAndPlay("_over");
}
news_mc.onRollOut = function () {
news_mc.gotoAndPlay("_out");
}

links_mc.onRollOver = function () {
links_mc.gotoAndPlay("_over");
}
links_mc.onRollOut = function () {
links_mc.gotoAndPlay("_out");
}

Then to link the menus to the respective html pages, I added the following:

about_mc.onRelease = function () {
getURL("about.html"};
}
videos_mc.onRelease = function () {
getURL("videos.html"};
}
photos_mc.onRelease = function () {
getURL("photos.html"};
}
training_mc.onRelease = function () {
getURL("training.html"};
}
nutrition_mc.onRelease = function () {
getURL("nutrition.html"};
}
news_mc.onRelease = function () {
getURL("news.html"};
}
links_mc.onRelease = function () {
getURL("links.html"};
}

But it is not working??? I tried the add the second code block to the same ac file as the first code block, and to a separate ac file, but nothing works??

Help please!

flashbe
October 22nd, 2008, 10:59 PM
Oh, and this is the error I'm getting:

**Error** Scene=Scene 1, layer=action, frame=1:Line 2: ')' or ',' expected
getURL("about.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 6: ')' or ',' expected
getURL("videos.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 10: ')' or ',' expected
getURL("photos.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 14: ')' or ',' expected
getURL("training.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 18: ')' or ',' expected
getURL("nutrition.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 22: ')' or ',' expected
getURL("news.html"};

**Error** Scene=Scene 1, layer=action, frame=1:Line 26: ')' or ',' expected
getURL("links.html"};

Total ActionScript Errors: 7 Reported Errors: 7


I have no clue what went wrong..:hurt:

glosrfc
October 23rd, 2008, 12:31 AM
The clue is in the error message...')' or ',' expected
So close off the getURL functions with a ) instead of a }

flashbe
October 23rd, 2008, 03:00 PM
You saved my day!

Sometimes one don't see the forest because of all the trees:)

Thank you so much!!