| Package | com.pcthomatos.swfseo |
| Class | public class SWFSEO |
See also
| Property | Defined by | ||
|---|---|---|---|
| lockNav : Boolean [write-only] For enabling or disabling the locking of your navigation's position when the swf website is being scrolled.
| SWFSEO | ||
| navBold : Object [write-only] Sets the bold state of navigation text.
| SWFSEO | ||
| navFont : String [write-only] Sets the font face of navigation text.
*It is recommended that you embed your fonts using a fonts.swf file, and registering the font with in global font list. *Note: this is ignored when using swfs for navigation. | SWFSEO | ||
| navItalic : Object [write-only] Sets the italic state of navigation text.
| SWFSEO | ||
| navKerning : Object [write-only] Sets the kerning state of navigation text.
| SWFSEO | ||
| navLetterSpacing : Object [write-only] Sets the letter spacing of navigation text.
| SWFSEO | ||
| navOffTextColor : uint [write-only] Sets the off state text color of navigation text.
*Note: this is ignored when using swfs for navigation. | SWFSEO | ||
| navOnTextColor : uint [write-only] Sets the active state text color of navigation text.
*Note: this is ignored when using swfs for navigation. | SWFSEO | ||
| navOverTextColor : uint [write-only] Sets the MouseOver text color of navigation text.
*Note: this is ignored when using swfs for navigation. | SWFSEO | ||
| navSize : Object [write-only] Sets the font size of navigation text.
*Note: this is ignored when using swfs for navigation. | SWFSEO | ||
| navUnderline : Object [write-only] Sets the underline state of navigation text.
| SWFSEO | ||
| preloadBufferOnly : Boolean [write-only] Enables or disables the preloading of a sound's buffer (8 seconds) or the entire sound.
If set to true, swf website loads faster. | SWFSEO | ||
| preloaderBarBorderColor : uint [write-only] Sets the preloader loader bar border color.
| SWFSEO | ||
| preloaderBarColor : uint [write-only] Sets the preloader loader bar color.
| SWFSEO | ||
| preloaderBytesColor : uint [write-only] Sets the preloader text color for the bytes loaded / bytes total text.
| SWFSEO | ||
| preloaderCustomClass : Class [write-only] Sets a preloader Custom Class so you can design your own.
| SWFSEO | ||
| preloaderDisplay : Boolean [write-only] Sets Determines whether to display a preloader or not.
| SWFSEO | ||
| preloaderTextColor : uint [write-only] Sets the preloader text color for the preloader status text ("Initializing Loader", "Loading...").
| SWFSEO | ||
| scrollbarsEnabled : Boolean [write-only] For enabling or disabling site scrollbars.
If set to true, website scrollbars appear whenever the window is smaller than the website's minimum size. If set to false, no scrollbars will appear regardless of browser size. | SWFSEO | ||
| styleNav : Class [write-only] Sets the navigation style.
The classes to choose from are as follows: Basic for simple click through navigation.Dissolve for dissolves of both navigation and page transitions.Tween for a preset tween motion of your navigation and dissolves of page transitions.Transition for custom transition effects via event dispatches to each swf. | SWFSEO | ||
| swfMinHeight : int [write-only] Sets the global minimum height of the swf website's height - no page can be smaller than this.
| SWFSEO | ||
| swfMinWidth : int [write-only] Sets the global minimum width of the swf website's width - no page can be smaller than this.
| SWFSEO | ||
| tabFocusRect : Boolean [write-only] Enables or disables a rectangle from appearing around the currently focused navigation button via key tabbing.
| SWFSEO | ||
| tabFocusRectColor : uint [write-only] Sets the color of the rectangle appearing around the currently focused navigation button via key tabbing.
| SWFSEO | ||
| tabNavEnabled : Boolean [write-only] Enables or disables navigation from being included to the tab order.
If set to true, navigation is included in the tab order. If set to false, navigation is not included in the tab order. *Note: If a page is active it's navigation button is temporarily removed from the tab order. | SWFSEO | ||
| trackingFunction : Function [write-only] Executes the function contents on every
SWFAddressEvent.CHANGE dispatch.To disable tracking comment out everything in this function | SWFSEO | ||
| useBrowserScrollbars : Boolean [write-only] Determines if scrolling is controlled with browser scrollbars or custom flash scrollbars.
If set to true, website scrolling is controlled by the browser. | SWFSEO | ||
| Method | Defined by | ||
|---|---|---|---|
|
SWFSEO(stageP:Stage)
Creates a SWFSEO object that will be used to load in your assets and control your swf website.
| SWFSEO | ||
|
load():void
Activates SWFSEO.
Once all SWFSEO properties have been set, run this method to begin loading. | SWFSEO | ||
| lockNav | property |
lockNav:Boolean [write-only] For enabling or disabling the locking of your navigation's position when the swf website is being scrolled.
If set to true, navigation will be vertically locked when scrollbars are used. Navigation will still scroll horizontally. Flash Scrollbars will be used.
If set to false, navigation will be part of the page and will scroll when scrollbars are used. Browser Scrollbar will be used.
The default value is false.
public function set lockNav(value:Boolean):void
| navBold | property |
navBold:Object [write-only] Sets the bold state of navigation text.
Options are: true or false.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navBold(value:Object):void
See also
| navFont | property |
navFont:String [write-only] Sets the font face of navigation text.
*It is recommended that you embed your fonts using a fonts.swf file, and registering the font with in global font list.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navFont(value:String):void
See also
| navItalic | property |
navItalic:Object [write-only] Sets the italic state of navigation text.
Options are: true or false
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navItalic(value:Object):void
See also
| navKerning | property |
navKerning:Object [write-only] Sets the kerning state of navigation text.
Options are: true or false.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navKerning(value:Object):void
See also
| navLetterSpacing | property |
navLetterSpacing:Object [write-only] Sets the letter spacing of navigation text.
Value can be any number.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navLetterSpacing(value:Object):void
See also
| navOffTextColor | property |
navOffTextColor:uint [write-only] Sets the off state text color of navigation text.
*Note: this is ignored when using swfs for navigation.
The default value is 0xBFBDFB.
public function set navOffTextColor(value:uint):void
See also
| navOnTextColor | property |
navOnTextColor:uint [write-only] Sets the active state text color of navigation text.
*Note: this is ignored when using swfs for navigation.
The default value is 0xFFFFFF.
public function set navOnTextColor(value:uint):void
See also
| navOverTextColor | property |
navOverTextColor:uint [write-only] Sets the MouseOver text color of navigation text.
*Note: this is ignored when using swfs for navigation.
The default value is 0x00FF00.
public function set navOverTextColor(value:uint):void
See also
| navSize | property |
navSize:Object [write-only] Sets the font size of navigation text.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navSize(value:Object):void
See also
| navUnderline | property |
navUnderline:Object [write-only] Sets the underline state of navigation text.
Options are: true or false.
*Note: this is ignored when using swfs for navigation.
The default value is null.
public function set navUnderline(value:Object):void
See also
| preloadBufferOnly | property |
preloadBufferOnly:Boolean [write-only] Enables or disables the preloading of a sound's buffer (8 seconds) or the entire sound.
If set to true, swf website loads faster. The preloader waits until enough sound is buffered and renders movie while the rest loads in the background.
If set to false, swf website will not render until sounds are fully loaded. Best used on unreliable servers.
The default value is true.
public function set preloadBufferOnly(value:Boolean):void
| preloaderBarBorderColor | property |
preloaderBarBorderColor:uint [write-only]Sets the preloader loader bar border color.
The default value is 0x666666.
public function set preloaderBarBorderColor(value:uint):void
See also
| preloaderBarColor | property |
preloaderBarColor:uint [write-only]Sets the preloader loader bar color.
The default value is 0x66FF66.
public function set preloaderBarColor(value:uint):void
See also
| preloaderBytesColor | property |
preloaderBytesColor:uint [write-only]Sets the preloader text color for the bytes loaded / bytes total text.
The default value is 0xFF6666.
public function set preloaderBytesColor(value:uint):void
See also
| preloaderCustomClass | property |
preloaderCustomClass:Class [write-only]Sets a preloader Custom Class so you can design your own. But it must implment ULPreloaderInterface. Other preloader parameters are ignored when a custom class is used.
The default value is ULInfoScreen.
public function set preloaderCustomClass(value:Class):void
See also
| preloaderDisplay | property |
preloaderDisplay:Boolean [write-only]Sets Determines whether to display a preloader or not.
The default value is true.
public function set preloaderDisplay(value:Boolean):void
| preloaderTextColor | property |
preloaderTextColor:uint [write-only]Sets the preloader text color for the preloader status text ("Initializing Loader", "Loading...").
The default value is 0xFFFFFF.
public function set preloaderTextColor(value:uint):void
See also
| scrollbarsEnabled | property |
scrollbarsEnabled:Boolean [write-only] For enabling or disabling site scrollbars.
If set to true, website scrollbars appear whenever the window is smaller than the website's minimum size.
If set to false, no scrollbars will appear regardless of browser size.
The default value is true.
public function set scrollbarsEnabled(value:Boolean):void
See also
| styleNav | property |
styleNav:Class [write-only] Sets the navigation style.
The classes to choose from are as follows:
Basic for simple click through navigation.
Dissolve for dissolves of both navigation and page transitions.
Tween for a preset tween motion of your navigation and dissolves of page transitions.
Transition for custom transition effects via event dispatches to each swf. The old page transistions out first and then the new page transitions in afterward. If event listeners are not set in a page swf then Transition will behave like Basic
TransitionTwoPages for custom transition effects via event dispatches to each swf. The old page transitions out and new page transitions in at the same time. If event listeners are not set in a page swf then TransitionTwoPages will behave like Basic
You can also create custom nav style classes. Just follow any of the other nav style classes in com.pcthomatos.swfseo.navStyles as template and save in the same folder path.
The default value is Basic.
public function set styleNav(value:Class):void
See also
| swfMinHeight | property |
swfMinHeight:int [write-only] Sets the global minimum height of the swf website's height - no page can be smaller than this.
If scrollbarsEnabled is set to true, these height and width settings will control when scrollbars will
be visible.
If the browser window is smaller than the root swf's size then scrollbars will appear.
If the browser window is larger that the root swf's size, the root swf will by default, center horizontally.
This will happen regardless of the value of scrollbarsEnabled.
*Note: If individual pages are higher than the root swf they will override the root swf's minimum height. But if they are smaller the root swf's height takes precedence.
The default value is 550.
public function set swfMinHeight(value:int):void
See also
| swfMinWidth | property |
swfMinWidth:int [write-only] Sets the global minimum width of the swf website's width - no page can be smaller than this.
If scrollbarsEnabled is set to true, these height and width settings will control when scrollbars will
be visible.
If the browser window is smaller than the root swf's size then scrollbars will appear.
If the browser window is larger that the root swf's size, the root swf will by default, center horizontally.
This will happen regardless of the value of scrollbarsEnabled.
*Note: If individual pages are wider than the root swf they will override the root swf's minimum width. But if they are smaller the root swf's width takes precedence.
The default value is 920.
public function set swfMinWidth(value:int):void
See also
| tabFocusRect | property |
tabFocusRect:Boolean [write-only] Enables or disables a rectangle from appearing around the currently focused navigation button via key tabbing.
If set to true, a rectangle will appear highlighting which navigation button has focus.
If set to false, no rectangle will appear.
The default value is true.
public function set tabFocusRect(value:Boolean):void
See also
| tabFocusRectColor | property |
tabFocusRectColor:uint [write-only] Sets the color of the rectangle appearing around the currently focused navigation button via key tabbing.
The default value is 0xCCCCCC.
public function set tabFocusRectColor(value:uint):void
See also
| tabNavEnabled | property |
tabNavEnabled:Boolean [write-only] Enables or disables navigation from being included to the tab order.
If set to true, navigation is included in the tab order.
If set to false, navigation is not included in the tab order.
*Note: If a page is active it's navigation button is temporarily removed from the tab order.
The default value is true.
public function set tabNavEnabled(value:Boolean):void
See also
| trackingFunction | property |
trackingFunction:Function [write-only] Executes the function contents on every SWFAddressEvent.CHANGE dispatch.
To disable tracking comment out everything in this function
The default value is function():void{}.
public function set trackingFunction(value:Function):void
var swfseo:SWFSEO = new SWFSEO(stage);
swfseo.trackingFunction = function():void{
//Note that pageTracker._trackPageview has been renamed to googlePageTracker._trackPageview because of a SWFAddress duplication bug
ExternalInterface.call("googlePageTracker._trackPageview", SWFAddress.getValue());
}
var swfseo:SWFSEO = new SWFSEO(stage);
swfseo.trackingFunction = function():void{
ExternalInterface.call("dcsMultiTrack","DCS.dcssip","www.yoursitegoeshere.com","DCS.dcsuri", SWFAddress.getValue(),"WT.ti", SWFAddress.getTitle());
}
| useBrowserScrollbars | property |
useBrowserScrollbars:Boolean [write-only] Determines if scrolling is controlled with browser scrollbars or custom flash scrollbars.
If set to true, website scrolling is controlled by the browser. Liquid Layout" websites are difficult to build in this mode.
If set to false, website scrolling is controlled by custom flash scrollbars.
The default value is false.
public function set useBrowserScrollbars(value:Boolean):void
| SWFSEO | () | constructor |
public function SWFSEO(stageP:Stage)Creates a SWFSEO object that will be used to load in your assets and control your swf website.
ParametersstageP:Stage — An instance of Stage.
|
See also
| load | () | method |
public function load():void Activates SWFSEO.
Once all SWFSEO properties have been set, run this method to begin loading.
*Note: The instance of SWFSEO needs to continue to run in order to control your swf website.
// SWFSEO 1.72: Search Engine Optimization Framework for Flash - pcthomatos.com
// Copyright (c) 2009 Peterangelo C. Thomatos (pcthomatos.com) and is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
package{
import com.asual.swfaddress.SWFAddress;
import com.pcthomatos.swfseo.*;
import com.pcthomatos.swfseo.navStyles.*;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.display.Sprite;
import flash.events.Event;
import flash.external.ExternalInterface;
public class SWFSEOExample extends Sprite {
private var swfseo:SWFSEO;
public function SWFSEOExample():void {
if (stage)init_Listener();
else addEventListener(Event.ADDED_TO_STAGE, init_Listener);
}
private var init_Listener:Function = function (e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init_Listener);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeListener);
loadBg();
swfseo = new SWFSEO(stage);
setSWFSEO();
swfseo.load();
cleanMain();
cleanMain = null;
}
private var setSWFSEO:Function = function ():void { // all these settings are optional if the are not set defualt values will be used.
swfseo.swfMinWidth = 1300;
swfseo.swfMinHeight = 700;
swfseo.scrollbarsEnabled = true;
swfseo.lockNav = true;
swfseo.styleNav = Transition;
swfseo.tabNavEnabled = true;
swfseo.tabFocusRect = true;
swfseo.tabFocusRectColor = 0xCCCCCC;
swfseo.navFont = "Blackadder ITC";
swfseo.navSize = 20;
swfseo.navOverTextColor = 0x00FF00;
swfseo.navOffTextColor = 0xBFBDFB;
swfseo.navOnTextColor = 0xFFFFFF;
swfseo.navBold = true;
swfseo.navItalic = true;
swfseo.navUnderline = true;
swfseo.navKerning = true;
swfseo.navLetterSpacing = null;
swfseo.preloaderTextColor = 0xFFFFFF;
swfseo.preloaderBytesColor = 0xFF6666;
swfseo.preloaderBarColor = 0x66FF66;
swfseo.preloaderBarBorderColor = 0x666666;
swfseo.preloadBufferOnly = true;
swfseo.trackingFunction = function():void {
ExternalInterface.call("googlePageTracker._trackPageview", SWFAddress.getValue());
}
}
private final function resizeListener(e:Event):void {// place code here if you want your background to stretch or center on resize
}
private var loadBg:Function = function ():void {// if you want an overall background image or something that stretches on resize - place code in here and add code to the resizeListener if necessary
}
private var cleanMain:Function = function ():void {
loadBg = null;
setSWFSEO = null;
init_Listener = null;
swfseo = null;
}
}
}