My favorites | Sign in
Project Logo
                
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* This code is part of the Bumpslide Library by David Knape
* http://bumpslide.com/
*
* Copyright (c) 2006, 2007, 2008 by Bumpslide, Inc.
*
* Released under the open-source MIT license.
* http://www.opensource.org/licenses/mit-license.php
* see LICENSE.txt for full license terms
*/
package {
import flash.utils.getTimer;

import com.bumpslide.data.type.Padding;
import com.bumpslide.tween.FTween;
import com.bumpslide.ui.Applet;
import com.bumpslide.ui.FramerateMonitor;
import com.bumpslide.ui.ScrollPanel;
import com.bumpslide.ui.TextBox;
import com.bumpslide.ui.TextPanel;
import com.bumpslide.util.LoremIpsum;

import flash.text.TextFormat;
import flash.utils.getDefinitionByName;

/**
* Bumpslide Scroll Panel Demo (see ScrollPanelTest.fla)
*/
public class Demo_04_ScrollPanel extends Applet {

// Custom skinned Panel placed on stage
public var customPanel:ScrollPanel;

// panel placed with code using default styles
public var textPanel:TextPanel;

override protected function addChildren() : void
{
// custom panel is alredy on the stage
// populate it with content from library
var asset:Class = getDefinitionByName('DummyContent') as Class;
customPanel.content = new asset();

// add another panel with just code and make this one a text panel
// it will use the default programmatic skins
textPanel = new TextPanel();
textPanel.padding = new Padding(4);
textPanel.textbox.text = LoremIpsum.TEXT;
addChild( textPanel );

// and, for fun, let's go ahead and make the text nicer.
// note: Helvetica has been embedded in this FLA
var tf:TextFormat = new TextFormat("Helvetica", 14, 0x333333 );
tf.leading = 4;
tf.letterSpacing = .7;
textPanel.textbox.textFormat = tf;
textPanel.textbox.content_txt.embedFonts = true;

// check it
addChild( new FramerateMonitor() );

// push it
updateDelay = 0;

customPanel.visible = false;
textPanel.visible = false;

trace( "Time start: " + getTimer());
FTween.fadeIn( customPanel, 0);
FTween.fadeIn( textPanel, 500);
}

/**
* On redraw, resize our panels
*/
override protected function draw() : void
{
var pad:int = 10;
var panelHeight:int = Math.round( (height-3*pad)/2 );

customPanel.move( pad, pad );
customPanel.setSize( 400, panelHeight );

textPanel.move( pad, panelHeight + 2*pad );
textPanel.setSize( width-2*pad, panelHeight );
}
}
}

Show details Hide details

Change log

r133 by tkdave on Nov 21, 2008   Diff
- removed all Tweener dependencies
- put the old fadeIn/fadeOut routines from
BaseClip into com.bumpslide.tween.Fade
- added new fadeIn/fadeOut methods to
FTween (slightly different syntax)
- updated ComboBox, Lightbox, and examples
to use new FTween fade routines
- added linear, stutter, and smooth easing
methods to FTween
- some FTween updates/fixes
- misc tweaks
Go to: 
Project members, sign in to write a code review

Older revisions

r115 by tkdave on Nov 04, 2008   Diff
- cleaned up exaples and tested slider
changes, things look stable
r106 by tkdave on Oct 13, 2008   Diff
- added comboBox and example with FLA
(examples/misc/ComboExample.fla)
- fixed grid mousewheel scrolling bug
- misc scrollpanel tweaks
r70 by tkdave on Aug 14, 2008   Diff
- added spacing to grid/gridLayout
- updated examples
- some bugfixes
All revisions of this file

File info

Size: 2910 bytes, 89 lines
Hosted by Google Code