Section 1
//Elastic (fl.transitions.easing.Elastic)
package fl.transitions.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.transitions.easing
Section 2
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 3
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 4
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 5
//MainTimeline (tour_flash_r_fla.MainTimeline)
package tour_flash_r_fla {
import flash.events.*;
import fl.transitions.easing.*;
import fl.transitions.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var description_list;
public var tn_group:MovieClip;
public var default_y:Number;
public var click_through;
public var title_list;
public var tn_url:TextField;
public var tn_desc:TextField;
public var xml_loader:URLLoader;
public var flashVars;
public var url_target_list:Array;
public var total:Number;
public var degree:Number;
public var tn_title:TextField;
public var filename_list;
public var fm_menu:ContextMenu;
public var angle:Number;
public var htl;
public var scale_factor:Number;
public var tween_duration:Number;
public var i:Number;
public var flashmo_xml:XML;
public var fm_next:SimpleButton;
public var thumbnail_group:MovieClip;
public var url_list;
public var fm_previous:SimpleButton;
public var folder:String;
public var tn:Number;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2);
}
public function tn_click(_arg1:MouseEvent):void{
var _local2:* = getFlashVar("clickTAG");
var _local3:* = getFlashVar("clickTARGET");
var _local4:MovieClip = MovieClip(_arg1.target);
var _local5:Number = parseInt(_local4.name.slice(8, 10));
}
function frame2(){
stop();
Security.loadPolicyFile("http://cachend.fling.com/crossdomain.xml");
filename_list = new Array();
url_list = new Array();
url_target_list = new Array();
title_list = new Array();
description_list = new Array();
click_through = "http://www.fling.com";
flashVars = new Object();
if (getFlashVar("htl")){
click_through = getFlashVar("htl");
};
tn = 0;
scale_factor = 0.4;
tween_duration = 0.7;
flashmo_xml = new XML();
folder = "";
xml_loader = new URLLoader();
xml_loader.load(new URLRequest("http://media.brandreachsys.com/projectm/geo_xml.htm?advertiser=Fling&id=TEST&cmp=testing&numThumbs=18&size=300x250&rating=r&prod=20"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
thumbnail_group = new MovieClip();
stage.addChild(thumbnail_group);
thumbnail_group.x = tn_group.x;
default_y = (thumbnail_group.y = tn_group.y);
tn_group.visible = false;
fm_previous.visible = false;
fm_next.visible = false;
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
}
public function load_tn():void{
var _local1:URLRequest = new URLRequest((folder + filename_list[tn]));
var _local2:Loader = new Loader();
_local2.load(_local1);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
tn++;
}
public function getFlashVar(_arg1:String):String{
var _local2:Object = LoaderInfo(this.loaderInfo).parameters;
var _local3:String = String(_local2[_arg1]);
return (_local3);
}
public function tn_out(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.target);
new Tween(_local2, "scaleX", Strong.easeOut, _local2.scaleX, scale_factor, tween_duration, true);
new Tween(_local2, "scaleY", Strong.easeOut, _local2.scaleY, scale_factor, tween_duration, true);
tn_title.text = "";
tn_desc.text = "";
tn_url.text = "";
}
public function on_wheel(_arg1:MouseEvent):void{
if (_arg1.delta > 0){
new Tween(thumbnail_group, "rotation", Strong.easeOut, thumbnail_group.rotation, (thumbnail_group.rotation + degree), tween_duration, true);
} else {
new Tween(thumbnail_group, "rotation", Strong.easeOut, thumbnail_group.rotation, (thumbnail_group.rotation - degree), tween_duration, true);
};
}
public function to_next(_arg1:MouseEvent):void{
new Tween(thumbnail_group, "rotation", Strong.easeOut, thumbnail_group.rotation, (thumbnail_group.rotation - degree), tween_duration, true);
}
public function to_previous(_arg1:MouseEvent):void{
new Tween(thumbnail_group, "rotation", Strong.easeOut, thumbnail_group.rotation, (thumbnail_group.rotation + degree), tween_duration, true);
}
public function on_loaded(_arg1:Event):void{
if (tn < total){
load_tn();
} else {
fm_previous.visible = true;
fm_next.visible = true;
fm_previous.addEventListener(MouseEvent.CLICK, to_previous);
fm_next.addEventListener(MouseEvent.CLICK, to_next);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, on_wheel);
};
var _local2:Bitmap = new Bitmap();
var _local3:MovieClip = new MovieClip();
_local2 = Bitmap(_arg1.target.content);
_local2.x = (-(_local2.width) * 0.5);
_local2.y = (-(_local2.height) * 0.5);
_local2.smoothing = true;
var _local4:* = (_local2.width + 10);
var _local5:* = (_local2.height + 10);
_local3.addChild(_local2);
_local3.graphics.beginFill(0x666666);
_local3.graphics.drawRect((-(_local4) * 0.51), (-(_local5) * 0.51), (_local4 * 1.02), (_local5 * 1.02));
_local3.graphics.beginFill(0xFFFFFF);
_local3.graphics.drawRect((-(_local4) * 0.5), (-(_local5) * 0.5), _local4, _local5);
_local3.graphics.endFill();
_local3.name = ("flashmo_" + thumbnail_group.numChildren);
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.MOUSE_OVER, tn_over);
_local3.addEventListener(MouseEvent.MOUSE_OUT, tn_out);
_local3.addEventListener(MouseEvent.CLICK, tn_click);
_local3.click_url = click_through;
_local3.scaleX = (_local3.scaleY = scale_factor);
_local3.x = (Math.cos((thumbnail_group.numChildren * angle)) * 300);
_local3.y = (Math.sin((thumbnail_group.numChildren * angle)) * 300);
_local3.rotation = (thumbnail_group.numChildren * degree);
thumbnail_group.addChild(_local3);
}
public function create_thumbnail(_arg1:Event):void{
flashmo_xml = XML(_arg1.target.data);
total = flashmo_xml.user.length();
angle = ((Math.PI * 2) / total);
degree = Math.round(((angle * 180) / Math.PI));
i = 0;
while (i < total) {
filename_list.push(flashmo_xml.user[i].@imagesrc.toString());
url_list.push(flashmo_xml.user[i].@linkurl.toString());
url_target_list.push(flashmo_xml.user[i].@target.toString());
title_list.push(flashmo_xml.user[i].@name.toString());
description_list.push(flashmo_xml.user[i].@caption.toString());
i++;
};
load_tn();
trace((("total thumbnails: " + total) + "\n"));
trace((("flashmo_xml: " + flashmo_xml) + "\n"));
}
public function tn_over(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.target);
var _local3:Number = parseInt(_local2.name.slice(8, 10));
thumbnail_group.addChild(_local2);
new Tween(_local2, "scaleX", Elastic.easeOut, _local2.scaleX, 1, tween_duration, true);
new Tween(_local2, "scaleY", Elastic.easeOut, _local2.scaleY, 1, tween_duration, true);
tn_title.text = title_list[_local3];
tn_desc.text = description_list[_local3];
tn_url.text = url_list[_local3];
}
function frame1(){
fm_menu = new ContextMenu();
fm_menu.hideBuiltInItems();
this.contextMenu = fm_menu;
}
}
}//package tour_flash_r_fla