Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 3 of 3

Thread: I'm stuck! Please help... Its those pesky button arrays

  1. #1

    I'm stuck! Please help... Its those pesky button arrays

    Hello, I have been trying to solve this for a week now, sadly to no avail. I need to change the box format that this code puts my buttons into. I would like it just to be one line of buttons.

    //////// Code:

    fm_button.visible = false;

    import caurina.transitions.Tweener;

    var menu_label:Array = new Array("Media", "Shop", "Team", "Events", "News", "Contact" );

    var total:Number = menu_label.length;
    var i:Number = 0;
    var j:Number = 0;
    var page:Number;
    var main_menu:MovieClip = new MovieClip();
    var box_group:MovieClip = new MovieClip();

    for( i = 0; i < total; i++ )
    var btn = new flashmo_button();
    btn.name = "flashmo_btn" + i;
    btn.x = -400; //Have tried to change to: btn.x = i * 100 + 15;

    btn.flashmo_click_area.addEventListener( Event.ENTER_FRAME, btn_enter );
    btn.flashmo_click_area.addEventListener( MouseEvent.ROLL_OVER, btn_over );
    btn.flashmo_click_area.addEventListener( MouseEvent.ROLL_OUT, btn_out );
    btn.flashmo_click_area.addEventListener( MouseEvent.CLICK, btn_click );

    var each_substring:Array = menu_label[i].split("|");
    btn.flashmo_button_label.fm_label.text = each_substring[0];
    btn.item_url = each_substring[1];
    btn.item_no = i;
    btn.flashmo_icon.gotoAndStop( i + 1 );


    function btn_over(e:MouseEvent):void
    e.target.parent.over = true;

    function btn_out(e:MouseEvent):void
    e.target.parent.over = false;

    function btn_click(e:MouseEvent):void
    var mc = e.target.parent;

    if( mc.item_url != undefined )
    navigateToURL( new URLRequest( mc.item_url ), "_parent" );

    function btn_enter(e:Event):void
    var mc = e.target.parent;

    if( mc.over == true )

    function change_page(no:Number):void
    page = no + 1;

    for( i = 0; i < 40; i++ )
    var box = new flashmo_box();
    box.name = "flashmo_box" + i;
    box.alpha = 0;

    ///////// End Code

    I have tried to change the btn.x to btn.x = i * 100 + 15; which put a second menu up for 1 sec before it disappears and leaves me with the original. Any help would be greatly appreciated, Thanks for your time.

  2. #2
    rimacy's Avatar
    Registered Schmoozer
    what happens when you remove the code in the enter frame handler when you have the progressive btn.x code?
    Last edited by rimacy; April 14th, 2012 at 08:28 PM.

  3. #3
    Quote Originally Posted by rimacy View Post
    what happens when you remove the code in the enter frame handler when you have the progressive btn.x code?
    If I remove btn.flashmo_click_area.addEventListener( Event.ENTER_FRAME, btn_enter ); it does the same thing and the hole menu shakes. Is this what you meant? I am fairly new to as3. Thanks!
    Last edited by seth42; April 14th, 2012 at 10:08 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012