• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Drop down menu trobleshooting

New Here ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

Hi

I'm stuck with this code for a drop down menu. The error message says It's expecting a right brace before the end of the program but as far as I can tell there's already one there... Any ideas are welcome!

import flash.events.Event;

import flash.display.SimpleButton;

addEventListener (Event.ENTER_FRAME,dropmenu1);

pages.stop();

var speed:Number=.3;

function dropmenu1(e:Event) {

          if ((menu_1.mouseY<menu_1.height&&menu_1.mouseY>0) && (menu_1.mouseX<menu_1.width&&menu_1.mouseX>0)) {

          menu_1.y-=(menu_1.y) *speed;

} else {

          menu_1.y-=(55+menu_1.y) *speed;

}

function makebtn (btn:SimpleButton,frame:Number) {

          btn.addEventListener (MouseEvent.CLICK,function() {pages.gotoAndStop (frame);});

          }

makebtn (menu_1.CAT_strategy_btn,1);

makebtn (menu_1.stage_1_btn,2);

makebtn (menu_1.stage_2_btn,3);

TOPICS
ActionScript

Views

650

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 07, 2012 Sep 07, 2012

Your first function is missing its ending brace

Votes

Translate

Translate
LEGEND ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

Your first function is missing its ending brace

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

Hi Ned. That works a treat, thank you for your help. Now the problem I'm having is that the drop down menu appears from the top of the frame. I have a header at the top so the buttons need to drop down a bit further down the screen. 

menu_1.y-=(55+menu_1.y) *speed;

This code means that only the bottom button is visible and when I hover over it the rest drop into view. What I want is the same effect but just further down the screen (from 110 on the y axis to be exact.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

I don't really understand your new problem, but if you need to have something be further down the screen, move it there.  If that code is resposible for the placement, then adjust the values in it.  If the conditional code that surrounds it dictates when different actions are taken, then adjusting the conditions might help as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

Sorted it now. Thanks for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2012 Sep 07, 2012

Copy link to clipboard

Copied

LATEST

You're welcome

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines