A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: flash to navigate screens

Hybrid View

  1. #1
    flashmagic91
    Guest

    flash to navigate screens

    Hi,

    I wondered whether you can help me to find a way using Flash/ActionScript 3 to navigate screens in the way this website does.

    Although I am aware this would not have been achieve in the way I want to attempt but I am sure there must be away.

    As crazy as I might sound I am a Flash beginner, but I have hope =D

    http://www.sbs.com.au/dragonchildren/

  2. #2
    flashmagic91
    Guest
    Reading it back, I don't think I was as clear as I could have been.

    More simply, without all the fancy bits and bobs this webpage has I want to be able to visibly slide the screens up and down once a user

  3. #3
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    // class names (linkage) of screens in library
    var _screens:Array = ["Screen1","Screen2","Screen3","Screen4","Screen5"];
    // instance names of btns in the btnMenu
    var _btns:Array = ["btn1","btn2","btn3","btn4","btn5"];
    // class name (linkage) of menu in library
    var _menu:MovieClip = new BtnMenu();
    var _base:MovieClip = new MovieClip();
    var _current:MovieClip;
    var _num:int = 0;
    
    updateScreen();
    
    function updateScreen($e:Event=null):void {
            var classRef:Class;
            var tween:Tween;
            var newScreen:MovieClip;
            if ($e == null) {
                    classRef = getDefinitionByName(_screens[0]) as Class;
                    _current = new classRef();
                    _base.addChild(_current);
                    newScreen = _current;
                    addChild(_base);
                    addChild(_menu);
                    _menu.addEventListener(MouseEvent.CLICK, updateScreen);
            } else {
                    var num:int = _btns.indexOf($e.target.name);
                    if (num != -1 && num != _num) {
                            classRef = getDefinitionByName(_screens[num]) as Class;
                            newScreen = new classRef();
                            _base.addChild(newScreen);
                            if (num > _num) {
                                    newScreen.y = _current.height;
                                    new Tween(_current,"y",Strong.easeOut,0,0 - _current.height,1,true);
                                    tween = new Tween(newScreen,"y",Strong.easeOut,newScreen.y,0,1,true);
                            } else {
                                    newScreen.y = 0 - newScreen.height;
                                    new Tween(_current,"y",Strong.easeOut,0,_current.height,1,true);
                                    tween = new Tween(newScreen,"y",Strong.easeOut,newScreen.y,0,1,true);
                            }
                            tween.addEventListener(TweenEvent.MOTION_FINISH, function(){_base.removeChildAt(0);});
                            _num = num;
                            _current = newScreen;
                    }
            }
    }

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center