My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package app.view
{
import app.Model;

import com.bumpslide.ui.LabelButton;

import flash.display.MovieClip;
import flash.events.MouseEvent;

/**
* Button in the Header that changes section
*
* @author David Knape
*/
public class SectionButton extends LabelButton
{

public var background:MovieClip;

private var _mySectionNum:uint;

private var model:Model = Model.getInstance();


override protected function addChildren():void
{
super.addChildren();

// pull target section num from instance name
_mySectionNum = parseInt(name.split('_')[1]);

// get title from model
label = model.sections[ _mySectionNum ];

// handle clicks
addEventListener(MouseEvent.CLICK, changeSection);

// update selected state when model tells us to
model.bind('currentSection', this);
}


private function changeSection(event:MouseEvent):void
{
model.currentSection = _mySectionNum;
}


/**
* Setter to receive binding from model
*/
public function set currentSection( n:int ):void {
selected = n == _mySectionNum;
}
}
}

Change log

r194 by tkdave on Jan 28, 2010   Diff
Catching up, mostly bug fixes and small
tweaks.
Go to: 
Project members, sign in to write a code review

Older revisions

r173 by tkdave on May 22, 2009   Diff
updated app template to match trunk,
source refactored and cleaned up just
a bit
r123 by tkdave on Nov 6, 2008   Diff
- finished new app template, working
on scripts
r120 by tkdave on Nov 6, 2008   Diff
adding src/bin folders
All revisions of this file

File info

Size: 1112 bytes, 56 lines
Powered by Google Project Hosting