Professional Documents
Culture Documents
horizontal slider
Copyright © 2009 SAP AG. All rights reserved.SAP, R/3, SAP NetWeaver, Duet, PartnerEdge,
ByDesign, SAP Business ByDesign, and other SAP products and services
mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP AG in Germany and other countries. Business Objects and the
Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web
Intelligence, Xcelsius, and other Business Objects products and services mentioned
herein as well as their respective logos are trademarks or registered trademarks
of Business Objects S.A. in the United States and in other countries. Business
Objects is an SAP company.All other product and service names mentioned are
the trademarks of their respective companies. Data contained in this document
serves informational purposes only. National product specifications may vary.These
materials are subject to change without notice. These materials are provided by
SAP AG and its affiliated companies ("SAP Group") for informational purposes
only, without representation or warranty of any kind, and SAP Group shall not be
liable for errors or omissions with respect to the materials. The only warranties for
SAP Group products and services are those that are set forth in the express
warranty statements accompanying such products and services, if any. Nothing
herein should be construed as constituting an additional warranty.
2009-11-03
Tutorial 1 - Creating a basic horizontal slider
Introduction
Introduction
Tutorial 1 will walk through how to create a basic horizontal slider component
in Adobe Flex Builder 3.
Refer to the Xcelsius 2008 Component Developer SDK Guide in the Create
a visual component section for the initial necessary steps for:
• Creating a project.
• Adding the Xcelsius 2008 Component Developer SDK framework.
• Creating a component file.
When an empty Flex project and the component file are created, the next
step is to write the code for the component class file.
This tutorial assumes that you have at least some knowledge of Cascading
Style Sheet (CSS), ActionScript 3.0, and MXML, the XML-based markup
language introduced by Adobe Flex.
package com.businessobjects.xcelsius.sdk.samples
{
import mx.controls.HSlider;
{
public function BasicHorizontalSlider()
{
super();
}
}
}
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
import mx.controls.Label;
import mx.styles.CSSStyle Declaration;
import mx.styles.StyleManager;
4. Also add these lines inside the class definition and above the class
constructor:
//----------------------------------
// titleText Property
//----------------------------------
[Inspectable(defaultValue="Title",
type="String")]
public function get title():String
{
return _titleText;
}
invalidateProperties();
}
}
//----------------------------------
// showTitle Property
//----------------------------------
[Inspectable(defaultValue="true",
type="Boolean")]
public function get showTitle():Boolean
{
return _showTitle;
}
//set snapInterval
this.snapInterval = 0.01;
//Title
_title = new Label();
_title.setActualSize(152, 20);
_title.y = _title.y - 20;
_title.setStyle("textAlign", TextFormatAl
ign.LEFT);
_title.minWidth = 0;
_title.minHeight = 0;
_title.selectable = false;
_title.truncateToFit = true;
_title.percentWidth = 100;
this.addChild(_title);
}
_title.visible = _showTitle;
}
playList, the title Label size needs to be updated with the current text
length.
7. Lastly, add [CxInspectableList ("title", "showTitle")] to display only title
and showTitle properties. See Default Property Sheet for more details.
8. Save and build the project.