diff options
| author | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
|---|---|---|
| committer | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
| commit | 79670053c7247d3a49b607960efd284e93f057e5 (patch) | |
| tree | 9617f6eefa38b2686ae409bf75cc27a340444eda /bPod/com | |
| parent | c53827d5d044ae5ca7ebb27acb404b7a8988918e (diff) | |
install.pl
Diffstat (limited to 'bPod/com')
33 files changed, 2057 insertions, 0 deletions
diff --git a/bPod/com/events/Event.as b/bPod/com/events/Event.as new file mode 100644 index 0000000..377ae1c --- /dev/null +++ b/bPod/com/events/Event.as @@ -0,0 +1,7 @@ + +class com.events.Event +{ + public function Event() {} + public var type:String; + public var params:Object; +};
\ No newline at end of file diff --git a/bPod/com/events/EventBroadcaster.as b/bPod/com/events/EventBroadcaster.as new file mode 100644 index 0000000..c8f3483 --- /dev/null +++ b/bPod/com/events/EventBroadcaster.as @@ -0,0 +1,32 @@ +import com.events.Event; +import mx.events.EventDispatcher; + +// var howdy:Object = new Object; +// howdy.bonghits = "five bonghits"; +// EventBroadcaster.getInstance().broadcastEvent("curtainsUp", howdy); + +class com.events.EventBroadcaster +{ + private var dispatchEvent:Function; + public var addEventListener:Function; + public var removeEventListener:Function; + private static var eventBroadcaster; + + private function EventBroadcaster() { + EventDispatcher.initialize (this); + } + + public static function getInstance():EventBroadcaster { + if (eventBroadcaster == undefined) { + eventBroadcaster = new EventBroadcaster(); + } + return eventBroadcaster; + } + + public function broadcastEvent (_eventName:String, _params:Object):Void { + var event:Event = new Event(); + event.type = _eventName; + event.params = _params; + dispatchEvent (event); + } +};
\ No newline at end of file diff --git a/bPod/com/events/RightClick.as b/bPod/com/events/RightClick.as new file mode 100644 index 0000000..df5f5d1 --- /dev/null +++ b/bPod/com/events/RightClick.as @@ -0,0 +1,15 @@ +class com.events.RightClick { + + private var rcMenu:ContextMenu; + + public function RightClick () { + rcMenu = new ContextMenu(); + rcMenu.hideBuiltInItems(); + rcMenu.customItems.push (new ContextMenuItem ("(c) 2007 carbon pictures", vanityPlate)); + _root.menu = rcMenu; + } + + private function vanityPlate():Void { +// getURL("https://www.carbonpictures.com/cgi-bin/bucky/profile?username=tfarnon"); + } +}
\ No newline at end of file diff --git a/bPod/com/feeds/FeedButton.as b/bPod/com/feeds/FeedButton.as new file mode 100644 index 0000000..d8d1ed2 --- /dev/null +++ b/bPod/com/feeds/FeedButton.as @@ -0,0 +1,36 @@ +import mx.utils.Delegate;
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+import com.events.EventBroadcaster;
+
+import com.keywords.KeywordButton;
+
+class com.feeds.FeedButton extends KeywordButton {
+
+ private var username_mc:MovieClip;
+ private var backing:MovieClip;
+ private var initialAlpha:Number;
+ private var overlay:MovieClip;
+
+ private function makeButton(_val:Object):Void {
+
+ overlay._visible = false;
+ initialAlpha = backing._alpha;
+ title_mc.title_txt.text = _val.name;
+
+ super.setPosition();
+ }
+
+ private function handleRollOver():Void {
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, 40, .4, true);
+ }
+
+ private function handleRollOut():Void {
+
+ if(visited) { var fadeVal:Number = initialAlpha; }
+ else { var fadeVal:Number = initialAlpha; }
+
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, initialAlpha, .4, true);
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/feeds/FeedItemButton.as b/bPod/com/feeds/FeedItemButton.as new file mode 100644 index 0000000..8666253 --- /dev/null +++ b/bPod/com/feeds/FeedItemButton.as @@ -0,0 +1,59 @@ +import mx.utils.Delegate;
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+import com.events.EventBroadcaster;
+
+import com.threads.ThreadButton;
+
+class com.feeds.FeedItemButton extends ThreadButton {
+
+ private var username_mc:MovieClip;
+ private var alphabet_mc:MovieClip;
+ private var backing:MovieClip;
+ private var initialAlpha:Number;
+ private var overlay:MovieClip;
+
+ private function makeButton(_val:Object):Void {
+ title_mc.title_txt.autoSize = true;
+ title_mc.title_txt.text = _val.name;
+
+ if (title_mc._height > 26) {
+ title_mc.title_txt.autoSize = false;
+ title_mc.title_txt._height = 28.1;
+ }
+
+ initialAlpha = backing._alpha;
+
+
+ title_mc._y = (_y + _height / 2) - (title_mc._height / 2) ;
+
+ // backing._height = title_mc.title_txt._height;
+
+ this.cacheAsBitmap = true;
+ super.setPosition();
+ }
+
+
+ private function handleRollOver():Void {
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, 40, .4, true);
+// makeWhite();
+ }
+
+ private function handleRollOut():Void {
+
+ if(visited) { var fadeVal:Number = initialAlpha; }
+ else { var fadeVal:Number = initialAlpha; }
+
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, initialAlpha, .4, true);
+// makeBlack();
+ }
+
+ private function makeWhite():Void {
+ title_mc.title_txt.textColor =0xFFFFFF;
+ }
+
+ private function makeBlack():Void {
+ title_mc.title_txt.textColor =0x000000;
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/feeds/FeedItemScroller.as b/bPod/com/feeds/FeedItemScroller.as new file mode 100644 index 0000000..960d5c2 --- /dev/null +++ b/bPod/com/feeds/FeedItemScroller.as @@ -0,0 +1,17 @@ +import com.oop.ScrollingMenuFrame;
+
+class com.feeds.FeedItemScroller extends ScrollingMenuFrame
+{
+ var intRate:Number = 20; // scroller speed
+
+ public function doLoad(_dataArray:Array ):Void {
+
+
+ holder_mc.attachMovie("FeedItemSelectionSystem", "feeds", 1000);
+ holder_mc["feeds"].doInit(_dataArray, "FeedItemButton" );
+
+// holder_mc._x = 0; // use as needed! this puts the horiz scroller back in view
+ holder_mc._y = 0; // when a keyword tile is clicked.
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/feeds/FeedItemSelectionSystem.as b/bPod/com/feeds/FeedItemSelectionSystem.as new file mode 100644 index 0000000..e928f73 --- /dev/null +++ b/bPod/com/feeds/FeedItemSelectionSystem.as @@ -0,0 +1,64 @@ +import com.threads.ThreadSelectionSystem; +import com.services.BuckyServices; + +class com.feeds.FeedItemSelectionSystem extends ThreadSelectionSystem { + + private var itemsPerRow:Number = 1; + private var vertSpace:Number = 1; + + public function doAction():Void { + + var theItem:Object = systemData[getCurrentSelection()]; + + var theDesc:String = stripTags (theItem.desc); + +/* if (theDesc.length <= 1 ) + trace ( stripTags (theItem.desc) ); + else + trace (theItem.link ); */ + + + getURL (theItem.link , "_blank"); + + +/* for (var prop in theItem) { + trace (prop + " : " + theItem[prop]); + }*/ + } + + + private function stripTags (s:String):String + { + var gay:Boolean = false; + + var a:Array = s.split (""); + var b:Array = new Array (); + + for (var i = 0; i < a.length; i++) + { + if (a[i] == '<') + { + gay = true; + } + else if (a[i] == '>') + { + gay = false; + } + else if (!gay) + { + b.push (a[i]); + } + } + +/* var final:String = b.join(""); + + trace ("final == " + final); + + return final; +*/ + return b.join (""); + + + } + +};
\ No newline at end of file diff --git a/bPod/com/feeds/FeedScroller.as b/bPod/com/feeds/FeedScroller.as new file mode 100644 index 0000000..2b3d835 --- /dev/null +++ b/bPod/com/feeds/FeedScroller.as @@ -0,0 +1,16 @@ +import com.oop.ScrollingMenuFrame;
+
+class com.feeds.FeedScroller extends ScrollingMenuFrame
+{
+ var intRate:Number = 20; // scroller speed
+
+ public function doLoad( _dataArray:Array ):Void {
+ trace ( "FeedScroller: doLoad");
+ holder_mc.attachMovie("FeedSelectionSystem", "feeds", 1000);
+ holder_mc["feeds"].doInit(_dataArray, "FeedItemButton" );
+
+// holder_mc._x = 0; // use as needed! this puts the horiz scroller back in view
+ holder_mc._y = 0; // when a keyword tile is clicked.
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/feeds/FeedSelectionSystem.as b/bPod/com/feeds/FeedSelectionSystem.as new file mode 100644 index 0000000..56ef7c4 --- /dev/null +++ b/bPod/com/feeds/FeedSelectionSystem.as @@ -0,0 +1,32 @@ +import com.feeds.ProcessRSS;
+import com.services.BuckyServices;
+import com.events.EventBroadcaster;
+import com.keywords.KeywordSelectionSystem;
+
+class com.feeds.FeedSelectionSystem extends KeywordSelectionSystem {
+
+ private var vertSpace:Number = 1;
+ private var theArray:Array;
+
+ private var newFeed:ProcessRSS;
+
+ private function doAction():Void {
+ return;
+// trace ( "FeedSelectionSystem: doAction");
+ eraseExistingSpinners();
+ startButtonSpinner();
+ theArray = new Array();
+ newFeed = new ProcessRSS (theArray, BuckyServices.rssProxy);
+ newFeed.loadFeed (selectedData().feed);
+ EventBroadcaster.getInstance().addEventListener("feedListMade", this);
+ }
+
+ private function feedListMade():Void {
+
+ BuckyServices.feedThreadsMC.doLoad( newFeed.target_txt , "FeedItemButton" );
+ EventBroadcaster.getInstance().broadcastEvent("switchToFeedThreadsView", this);
+ eraseExistingSpinners();
+
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/feeds/ProcessRSS.as b/bPod/com/feeds/ProcessRSS.as new file mode 100644 index 0000000..1c09d8d --- /dev/null +++ b/bPod/com/feeds/ProcessRSS.as @@ -0,0 +1 @@ +import mx.utils.Delegate;
import mx.controls.TextArea;
import com.events.EventBroadcaster;
class com.feeds.ProcessRSS {
//declare public properties:
//the TextArea component which will display the information
public var target_txt:Array;
//the address of the PHP proxy script
public var proxyURL:String;
//declare private properties:
private var _xml:XML;
private var items:Array;
private var senderObj:LoadVars;
private var loaderID:Number;
//constructor
function ProcessRSS (target:Array, proxy:String) {
target_txt = target;
proxyURL = proxy;
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = Delegate.create(this, onLoadEvent);
}
private function onLoadEvent(success:Boolean):Void {
if (success) {
//terminate any running intervals
clearInterval(loaderID);
// target_txt.text = "<p>Click a headline to open that entry in a new window.</p><br>";
//populate "items" array
items = getNodes(_xml, "item");
displayContent(items);
} else {
// target_txt.text = "<p>XML failed to load.</p>";
}
}
public function loadFeed(feedURL:String):Void {
//initialization:
//terminate any running intervals
clearInterval(loaderID);
//start with an empty array - replace any previous content
items = new Array();
//clear any previous text
// target_txt.text = "";
//reset scroll position of TextArea component
// target_txt.vPosition = 0;
//create LoadVars Object
senderObj = new LoadVars();
//assign a value to a property of the LoadVars Object
senderObj.rss = feedURL;
/*
The LoadVars.sendAndLoad method conveniently accepts an XML Object as
its target. We can send a string (url) to the PHP proxy script and
get an XML document back.
*/
senderObj.sendAndLoad(proxyURL, _xml, "GET");
/*
Use setInterval to monitor load progress every 25 milliseconds. Pass
the XML document whose download progress you wish to monitor as the 4th
argument. Ue of "this" in "this.loaderID" is critical for telling
the loadingFeedback() method in what scope to find the XML object.
Thanks to Colin Moock for the code this is based loosely on.
*/
this.loaderID = setInterval(this, "loadingFeedback", 25, _xml);
}
/*
getNodes(): a recursive method for "walking" the XML tree searching for a
match to a node name. This is based on an ActionScript 1 XML prototype by
Peter Hall. The method returns an array of all XML nodes that match "name".
It is used to populate the "items" array with all nodes in the rss document
named "item". Note that a node of nodeType 3 is a text node (a string). We
don't want to waste time with that now, so the script skips them.
*/
private function getNodes(node:XMLNode, name:String):Array {
var nodes:Array = new Array();
var c:XMLNode = node.firstChild;
while (c) {
if (c.nodeType != 3) {
if (c.nodeName == name) {
nodes.push(c);
}
nodes = nodes.concat(getNodes(c, name));
}
c = c.nextSibling;
}
return nodes;
}
/*
displayContent() is the method responsible for extracting the data I am
interested in (the text content of title, link and description) and
formatting it for the TextArea component.
*/
private function displayContent(source:Array):Void {
var entries:Number = source.length;
var currentNode:XMLNode;
var tempTitle:String;
var tempLink:String;
var tempDescription:String;
for (var i:Number = 0; i<entries; i++){
currentNode = source[i];
tempTitle = extractContent(currentNode, "title");
tempLink = extractContent(currentNode, "link");
tempDescription = extractContent(currentNode, "description");
var oneEntry:String = "<headline><a href='"+
tempLink+"' target='_blank'>"+tempTitle+
"</a></headline><p>"+
tempDescription+"</p><br>";
var tmpObj:Object = new Object();
tmpObj.name = tempTitle;
tmpObj.link = tempLink;
tmpObj.desc = tempDescription;
target_txt.push (tmpObj);
// target_txt.text += oneEntry;
}
EventBroadcaster.getInstance().broadcastEvent("feedListMade", null);
}
/*
extractContent() is a modified version of getNodes(). Like getNodes(),
it searches the source node recursively for a match to "name", but what it
returns when it does find a match is the text content of that node.
*/
private function extractContent (source:XMLNode, name:String):String {
var nodeTxt:String = "";
var c:XMLNode = source.firstChild;
while (c) {
if (c.nodeType != 3) {
if (c.nodeName == name) {
nodeTxt = c.firstChild.nodeValue;
}
nodeTxt += extractContent(c, name);
}
c = c.nextSibling;
}
return nodeTxt;
}
//the progress monitor called by setInterval
private function loadingFeedback(xmlObj:XML):Void {
var amtLoaded:Number = xmlObj.getBytesLoaded();
if (amtLoaded <= 4){
// target_txt.text = "<p>Requesting Data...</p>";
} else {
// target_txt.text = "<p>Loaded: "+ Math.floor(amtLoaded/1024) + " kilobytes</p>";
}
}
}
\ No newline at end of file diff --git a/bPod/com/files/FileButton.as b/bPod/com/files/FileButton.as new file mode 100644 index 0000000..f5adced --- /dev/null +++ b/bPod/com/files/FileButton.as @@ -0,0 +1,89 @@ +
+import com.services.BuckyServices;
+import com.threads.ThreadButton;
+
+class com.files.FileButton extends ThreadButton {
+ private var username_mc:MovieClip;
+ private var backing:MovieClip;
+ private var initialAlpha:Number;
+
+ private function handleRollOut():Void {
+// _root.thumbnail.removeMovieClip();
+ makeBlack();
+ super.handleRollOut();
+ }
+
+ private function handleRollOver():Void {
+ super.handleRollOver();
+ if ( (itemData.filetype == "JPG") ||
+ (itemData.filetype == "GIF") ||
+ (itemData.filetype == "PNG") ) { displayImageThumbnail (BuckyServices.getThumbURL (itemData.filename));
+ makeWhite();
+ }
+ }
+
+ private function displayImageThumbnail(_inURL:String):Void {
+
+ _root.imagesHolder.thumbnail.unloadMovie();
+ _root.imagesHolder.createEmptyMovieClip ("thumbnail", _root.getNextHighestDepth());
+
+ try {
+ _root.imagesHolder.thumbnail.loadMovie (_inURL);
+ }
+
+ catch (_err:Error) {}
+
+ _root.imagesHolder.thumbnail._alpha = 50;
+
+ var j:MovieClip = _root.imagesHolder.thumbnail;
+
+ j._xscale = j._yscale = 200;
+/* j._x = (Stage.width/2 - j._width/2);
+ j._y = (Stage.height/2 - j._height/2);
+*/
+
+// _root.imagesHolder.thumbnail._xscale = _root.imagesHolder.thumbnail._yscale = 250;
+ }
+
+
+
+
+ private function makeWhite():Void {
+ title_mc.title_txt.textColor =0xFFFFFF;
+ }
+
+ private function makeBlack():Void {
+ title_mc.title_txt.textColor =0x000000;
+ }
+
+
+
+ private function makeButton(_val:Object):Void {
+ title_mc.title_txt.text = _val.filename;
+ title_mc.title_txt.autoSize = true;
+
+
+ if (title_mc._height > 28.1) {
+ title_mc.title_txt.autoSize = false;
+ title_mc.title_txt._height = 28.1;
+ }
+
+ initialAlpha = backing._alpha;
+
+ if (_val.filetype == "MP3") {
+ transformTheButtonColor();
+ }
+
+
+ title_mc._y = (_y + _height / 2) - (title_mc._height / 2) ;
+
+ // backing._height = title_mc.title_txt._height;
+
+ this.cacheAsBitmap = true;
+ super.setPosition();
+ }
+
+ private function transformTheButtonColor():Void {
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/files/FileScroller.as b/bPod/com/files/FileScroller.as new file mode 100644 index 0000000..991cf9c --- /dev/null +++ b/bPod/com/files/FileScroller.as @@ -0,0 +1,15 @@ +import com.oop.ScrollingMenuFrame;
+
+class com.files.FileScroller extends ScrollingMenuFrame
+{
+ var intRate:Number = 20; // scroller speed
+
+ public function doLoad(_dataArray:Array):Void {
+ holder_mc.attachMovie("FileSelectionSystem", "files", 1000);
+ holder_mc["files"].doInit(_dataArray, "FileButton");
+
+// holder_mc._x = 0; // use as needed! this puts the vert scroller back in view
+ holder_mc._y = 0; // when a keyword tile is clicked.
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/files/FileSelectionSystem.as b/bPod/com/files/FileSelectionSystem.as new file mode 100644 index 0000000..d93ea58 --- /dev/null +++ b/bPod/com/files/FileSelectionSystem.as @@ -0,0 +1,19 @@ +import com.threads.ThreadSelectionSystem;
+import com.services.BuckyServices;
+
+class com.files.FileSelectionSystem extends ThreadSelectionSystem {
+
+ private var itemsPerRow:Number = 1;
+ private var vertSpace:Number = 1;
+
+ public function doAction():Void {
+
+ var theItem:Object = systemData[getCurrentSelection()];
+ var fileURL:String = BuckyServices.singleFilePath + theItem.filename;
+
+ _root.debug.text = theItem.theURL;
+
+ if (theItem.filetype == "MP3") { _root.player.init ( theItem ); }
+ else { getURL (theItem.theURL, "_blank"); }
+ }
+};
\ No newline at end of file diff --git a/bPod/com/graphics/BuckyGradientBox.as b/bPod/com/graphics/BuckyGradientBox.as new file mode 100644 index 0000000..ffae2de --- /dev/null +++ b/bPod/com/graphics/BuckyGradientBox.as @@ -0,0 +1,43 @@ +// +// Gradient Box!!!!!!! +// +// Created by Brian Ortiz on 2007-09-08. +// Copyright (c) 2007 BONER FACTORY LTD. All rights reserved. +// + +import flash.geom.Matrix; + +class com.graphics.BuckyGradientBox extends MovieClip + { + private var _bar:MovieClip; + private var matrix:Matrix; + private var lineWidth:Number = 2; + + public function BuckyGradientBox() + { + } + + public function initColors(inColorOne:Number, inColorTwo:Number, inColorThree:Number, inW:Number, inH:Number) + { + + if (inColorOne == undefined) + inColorOne = 0xFFFFFF; + if (inColorTwo == undefined) + inColorTwo = 0xDDDDDD; + if (inColorThree == undefined) + inColorThree = 0x000000; + + matrix = new Matrix(); + matrix.createGradientBox(inW, inH, 0, 0, 0); + + beginGradientFill("radial", [inColorOne, inColorTwo], [100, 100], [0, 0xFF], matrix); + lineStyle(lineWidth, inColorThree, 100, true, "none", "none", "miter", 1); + + moveTo(0, 0); + lineTo(inW, 0); + lineTo(inW, inH); + lineTo(0, inH); + lineTo(0, 0); + endFill(); + } + };
\ No newline at end of file diff --git a/bPod/com/keywords/KeywordButton.as b/bPod/com/keywords/KeywordButton.as new file mode 100644 index 0000000..aec9648 --- /dev/null +++ b/bPod/com/keywords/KeywordButton.as @@ -0,0 +1,95 @@ +import com.oop.UIButton;
+import com.oop.SelectionSystem;
+import mx.utils.Delegate;
+
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+
+class com.keywords.KeywordButton extends UIButton
+{
+ private var title_mc:MovieClip;
+ private var desc_mc:MovieClip;
+ private var icon_mc:MovieClip;
+ private var bg_mc:MovieClip;
+ private var gridObj:Object;
+ private var shine_mc:MovieClip;
+ private var element_mc:MovieClip;
+ private var initialAlpha:Number = 60;
+ private var initialShine:Number = 30;
+ private var tint:Number;
+
+ public var elementSymbol:String;
+
+ private var installedX:Number = 0;
+ private var installedY:Number = 0;
+
+ public function KeywordButton() {}
+
+ public function init(_selectionSystem:SelectionSystem, _id:Number, _itemData:Object, _gridObj:Object ):Void {
+ gridObj = _gridObj;
+ super.init (_selectionSystem, _id, _itemData);
+ makeButton(itemData);
+ }
+
+ public function hashColor (_inStr:String):Number {
+ switch (_inStr) {
+ case "ivory": return (0xE0E0D8);
+ case "orange": return (0xFFD799);
+ case "yellow": return (0xFFF7A8);
+ case "green": return (0xDAF4B2);
+ case "blue": return (0xCCCCFF);
+ case "purple": return (0xDDB1FF);
+ case "pink": return (0xFFAECD);
+ case "plain": return (0xE6f0f0);
+ default: return (0xFFFFFF);
+ }
+ }
+
+
+ private function makeButton(_val:Object):Void {
+ icon_mc._alpha = initialAlpha;
+ shine_mc._alpha = initialShine;
+ title_mc.title_txt.text = _val.name.toLowerCase();
+
+ var c:String = _val.name.charAt(0); // b
+ var cc:String = _val.name.charAt(1); // u
+ var u:String = c.toUpperCase(); // B (if b)
+ var uu:String = cc.toLowerCase(); // u (if U)
+ var tmp:String = u.concat (uu); // Bu
+
+ element_mc.element_txt.text = tmp;
+
+ elementSymbol = tmp;
+
+
+ var tmpColor:Number = hashColor ( _val.color.toString() );
+ element_mc.element_txt.textColor = tmpColor; // &= 0x7F7F7F;
+ setPosition();
+ }
+
+ private function setPosition():Void {
+ _x = Math.round ( (gridObj.grid_x * _width) + (gridObj.horizSpace * gridObj.grid_x));
+ _y = Math.round ( ((gridObj.grid_y-1) * _height) + (gridObj.vertSpace * (gridObj.grid_y-1)));
+
+ installedX = _x;
+ installedY = _y;
+ }
+
+ private function handleRollOver():Void {
+ var tTween = new Tween(icon_mc, "_alpha", Regular.easeOut, icon_mc._alpha, 100, 1, true);
+ var shineTween = new Tween(shine_mc, "_alpha", Regular.easeOut, shine_mc._alpha, 0, .2, true);
+ }
+
+ private function handleRollOut():Void
+ {
+ if(visited) { var fadeVal:Number = initialAlpha; }
+ else { var fadeVal:Number = initialAlpha; }
+
+ var tTween = new Tween (icon_mc, "_alpha", Regular.easeOut, icon_mc._alpha, initialAlpha, 1, true);
+ var shineTween = new Tween (shine_mc, "_alpha", Regular.easeOut, shine_mc._alpha, initialShine, .2, true);
+ }
+
+ public function setSelected():Void
+ {
+ }
+}
\ No newline at end of file diff --git a/bPod/com/keywords/KeywordScroller.as b/bPod/com/keywords/KeywordScroller.as new file mode 100644 index 0000000..5bcda46 --- /dev/null +++ b/bPod/com/keywords/KeywordScroller.as @@ -0,0 +1,67 @@ +import com.oop.ScrollingMenuFrame; + +class com.keywords.KeywordScroller extends ScrollingMenuFrame +{ + var intRate:Number = 14; // scroller speed + var adornments:Number = 0 ; + + var tagArray:Array; + + public function doLoad(_dataArray:Array):Void { + holder_mc.attachMovie("KeywordSelectionSystem", "keywordTiles", 1000); + holder_mc["keywordTiles"].doInit(_dataArray, "KeywordButton"); + } + + public function insertAdornment():Void { + adornments++; + var adorn:MovieClip = holder_mc["keywordTiles"].attachMovie ("adornment", "adornment" + adornments , this.getNextHighestDepth()-adornments ); + _root.debug.text += "\nadorn: " + adorn; + adorn._y = _height; + } + + public function insertFeeds():Void { + holder_mc.attachMovie ("FeedSelectionSystem", "feeds", 2000); + holder_mc["feeds"]._y = _height; + holder_mc["feeds"].doInit ( buckyFeeds() , "KeywordButton"); + } + + public function insertTags(_inArray:Array):Void { + holder_mc.attachMovie ("KeywordSelectionSystem", "tags", 3000); + holder_mc["tags"]._y = _height; + holder_mc["tags"].doInit ( _inArray , "TagButton"); + } + + public function buckyFeeds():Array { + +// return []; + var feeds:Array = [ + {name:"bboing", color:"yellow", feed:"http://feeds.feedburner.com/boingboing/iBag" }, + {name:"drawn", color:"plain", feed:"http://drawn.ca/feed/" }, + {name:"daily rotn", color:"orange", feed:"http://feeds.dailyrotten.com/dailyrotten.rss" }, + + {name:"slashdot", color:"green", feed:"http://rss.slashdot.org/Slashdot/slashdot" }, + {name:"trailers", color:"blue", feed:"http://images.apple.com/trailers/rss/newtrailers.rss" }, + {name:"info", color:"yellow", feed:"http://feeds.infosthetics.com/infosthetics" }, + + {name:"reddit", color:"orange", feed:"http://reddit.com/.rss" }, + {name:"jerkcity", color:"yellow", feed:"http://www.jerkcity.com/jc.rss" }, + {name:"d.lic.us", color:"purple", feed:"http://del.icio.us/rss/" }, + + {name:"w4m", color:"pink", feed:"http://sfbay.craigslist.org/search/w4m?query=&minAsk=min&maxAsk=max&hasPic=1&format=rss" }, + {name:"m4m", color:"pink", feed:"http://sfbay.craigslist.org/search/m4m?query=&minAsk=min&maxAsk=max&hasPic=1&format=rss" }, + {name:"casual", color:"pink", feed:"http://sfbay.craigslist.org/search/cas?query=&minAsk=min&maxAsk=max&hasPic=1&format=rss" }, + + {name:"art farts", color:"ivory", feed:"http://www.asciiartfarts.com/farts.rss" } + + + + ]; + + + return (feeds); + + } + + + +};
\ No newline at end of file diff --git a/bPod/com/keywords/KeywordSelectionSystem.as b/bPod/com/keywords/KeywordSelectionSystem.as new file mode 100644 index 0000000..45183f4 --- /dev/null +++ b/bPod/com/keywords/KeywordSelectionSystem.as @@ -0,0 +1,85 @@ +import com.tubes.BuckyThreadTube; +import com.events.EventBroadcaster; +import com.oop.GridSelectionSystem; +import com.services.BuckyServices; + +class com.keywords.KeywordSelectionSystem extends GridSelectionSystem { + + private var tube:BuckyThreadTube; + private var cockblocker:Boolean = false; // to discourage crazy button clickage + private var lastClicked:Number; // failsafe for crazy button clickage + + private function doAction():Void { + if (!cockblocker) { + eraseExistingSpinners(); + lastClicked = currentSelection; + BuckyServices.setActiveKeyword ( selectedData() ); + EventBroadcaster.getInstance().addEventListener("threadListMade", this); + var tag_preamble:String; + if (selectedData().isTag) { + tag_preamble = "tag_"; + } else { + tag_preamble = ""; + } + tube = new BuckyThreadTube ( BuckyServices.threads + tag_preamble + selectedData().name); + startButtonSpinner(); + cockblocker = true; + } + } + + private function eraseExistingSpinners():Void { + for (var i:Number = 0 ; i < listItems.length ; i++) { + var t:MovieClip = listItems[i]; + t.element_mc._visible = true; + t.element_mc.element_txt.text = t.elementSymbol; + t["spinnerHolder"].removeMovieClip(); // kill if exists .. fail silently if not + } + EventBroadcaster.getInstance().removeEventListener("threadListMade", this); + } + + private function startButtonSpinner():Void { + var t:MovieClip = listItems[currentSelection]; + t.element_mc._visible = false; + t.createEmptyMovieClip ("spinnerHolder", t.getNextHighestDepth()); + t["spinnerHolder"].attachMovie ("Spinner", "spinner" , 100, {_x:40, _y:29, _width:27, _height:27}); + } + + + private function threadListMade (_evt:Object):Void { + eraseExistingSpinners(); + + if ((tube.articles.length != undefined) && (tube.articles.length != 0)) { + BuckyServices.threadsMC.doLoad( tube.articles, "ThreadButton" ); + EventBroadcaster.getInstance().broadcastEvent("switchToThreadsView", this); + BuckyServices.setActiveKeyword ( selectedData() ); + setCurrentSelection ( currentSelection ); + cockblocker = false; + } + + else if (tube.articles.length == 0) { + drawFrownyFace(); + cockblocker = false; + } + + else { trace ("sigh, some other weird scenario"); } + } + + + private function drawFrownyFace():Void { + listItems[lastClicked].element_mc.element_txt.text = listItems[lastClicked].elementSymbol = ":("; + } + + public function setSelection(_id:Number):Void { + + // overriding existing selection system's setSelection so tiles that get + // clicked do not killMouseEvents() -- the same tile can be clicked over and over. + + listItems[currentSelection].setUnselected(); + currentSelection = _id; + listItems[currentSelection].setSelected(); + doAction(); + } + + +}; + diff --git a/bPod/com/oop/GridSelectionSystem.as b/bPod/com/oop/GridSelectionSystem.as new file mode 100644 index 0000000..c9694ca --- /dev/null +++ b/bPod/com/oop/GridSelectionSystem.as @@ -0,0 +1,49 @@ +import com.oop.SelectionSystem;
+
+class com.oop.GridSelectionSystem extends SelectionSystem
+{
+ private var itemsPerRow:Number = 3;
+ private var currentRow:Number = 0;
+ private var currentColumn:Number = 0;
+
+ //space between rows and columns
+ private var horizSpace:Number = -6; //60;
+ private var vertSpace:Number = 0; //50;
+
+ public function GridSelectionSystem() {}
+
+ private function attachButtonItems():Void {
+ //get placement object according to counts
+ for (var i:Number = 0; i < systemData.length; i++) {
+ updateGrid(i);
+ var item:MovieClip = this.attachMovie(exportName, "Item_" + i, i );
+ item.init(this, i, systemData[i], getItemPositionObj());
+ listItems.push(item);
+ }
+ }
+
+
+
+ private function updateGrid(_index:Number) {
+ if(!(_index % itemsPerRow)) { currentColumn = 0; currentRow++; }
+ else { currentColumn++; }
+ }
+
+
+ private function getItemPositionObj():Object {
+ var obj:Object = new Object();
+ obj.horizSpace = horizSpace;
+ obj.vertSpace = vertSpace;
+ obj.grid_x = currentColumn;
+ obj.grid_y = currentRow;
+ return obj;
+ }
+
+
+
+ private function selectedData():MovieClip {
+ return systemData[ getCurrentSelection() ];
+ }
+
+
+}
\ No newline at end of file diff --git a/bPod/com/oop/ScrollingMenuFrame.as b/bPod/com/oop/ScrollingMenuFrame.as new file mode 100644 index 0000000..5c91751 --- /dev/null +++ b/bPod/com/oop/ScrollingMenuFrame.as @@ -0,0 +1,148 @@ +
+class com.oop.ScrollingMenuFrame extends MovieClip
+{
+ private var hotSpot_mc:MovieClip; // used to detect mouse events
+ private var holder_mc:MovieClip; // holder for the flat-list SelectionSystem
+ private var hotSpotMask:MovieClip; // bluh .. also used i guess
+
+ private var initY:Number;
+ private var initX:Number;
+
+ private var initHolderX:Number;
+ private var initHolderY:Number;
+
+ var intRate:Number = 10; // scroller speed
+
+
+ public function ScrollingMenuFrame() {
+ doInit();
+ }
+
+
+/* public function doLoad(_dataArray:Array):Void {
+ holder_mc.attachMovie("KeywordSelectionSystem", "keywordTiles", 1000);
+ holder_mc["keywordTiles"].doInit(_dataArray, "KeywordButton");
+ }
+*/
+ public function enableMenu():Void {
+ initMenuScroll();
+ initMouseWatch();
+ setHotSpot(true);
+ }
+
+
+ public function disableMenu():Void {
+ killMouseWatch();
+ killMenuScroll();
+ setHotSpot(false);
+ }
+
+
+ private function doInit():Void {
+
+ initY = _x;
+ initX = _y;
+
+ initHolderX = holder_mc._x;
+ initHolderY = holder_mc._y;
+
+ initMenuScroll();
+
+ holder_mc.onMouseDown = function() {
+ if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
+// _parent.disableMenu();
+ }
+ }
+ }
+
+
+ private function setHotSpot(_isMenuEnabled:Boolean):Void {
+ if (_isMenuEnabled) {
+ hotSpot_mc.onRollOver = undefined;
+ } else {
+ hotSpot_mc.onRollOver = function() {
+ this._parent.enableMenu();
+ }
+ }
+ }
+
+
+
+ private function initMouseWatch():Void {
+ this.onMouseMove = function() {
+ if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
+ disableMenu();
+ }
+ }
+ }
+
+
+ private function killMouseWatch():Void {
+ this.onMouseMove = undefined;
+ }
+
+
+ private function initMenuScroll():Void {
+ this.onEnterFrame = function() {
+ if ((holder_mc._height >= hotSpotMask._height) || (holder_mc._width >= hotSpotMask._width)) {
+ doMenuScroll();
+ }
+ }
+ }
+
+
+ private function killMenuScroll():Void {
+ this.onEnterFrame = undefined;
+ }
+
+
+ private function doMenuScroll():Void {
+ var intTop:Number = initHolderY;
+ var intLeft:Number = initHolderX;
+ var intBottom:Number = intTop + hotSpotMask._height;
+ var intRight:Number = intLeft + hotSpotMask._width;
+
+
+ var intZero:Number = (intBottom + intTop) / 2;
+ var intZeroW:Number = (intRight + intLeft) / 2;
+
+ var intMousePos:Number = _ymouse - intZero;
+ var intMousePosW:Number = _xmouse - intZeroW;
+
+ var intMaxUp:Number = intTop - intZero;
+ var intMaxLeft:Number = intLeft - intZeroW;
+ var intMaxDown:Number = intBottom - intZero;
+ var intMaxRight:Number = intRight - intZeroW;
+
+ var _isHit:Boolean = this.hitTest(_root._xmouse, _root._ymouse, true);
+
+ if (_isHit) {
+
+ if (holder_mc._height > hotSpotMask._height ) {
+
+ // top & bottom bounds check
+
+ if (intMousePos > 0) { // below intZero? scroll up
+ holder_mc._y = Math.max(holder_mc._y - intRate * Math.pow((intMousePos/intMaxDown),2), intBottom - holder_mc._height) ;
+ }
+ else if (intMousePos < 0) { // above intZero? scroll down
+ holder_mc._y = Math.min(holder_mc._y + intRate * Math.pow((intMousePos/intMaxUp),2), intTop );
+ }
+
+
+ // left & right bounds check
+
+/* if (intMousePosW > 0) { // right of intZero? scroll left
+ holder_mc._x = Math.max(holder_mc._x - intRate * Math.pow((intMousePosW/intMaxRight),2), intRight - holder_mc._width);
+ }
+ else if (intMousePosW < 0) { // left of intZero? scroll right
+ holder_mc._x = Math.min(holder_mc._x + intRate * Math.pow((intMousePosW/intMaxLeft),2), intLeft);
+ }
+*/
+
+ }
+
+ }
+
+ }
+}
diff --git a/bPod/com/oop/SelectionSwitcher.as b/bPod/com/oop/SelectionSwitcher.as new file mode 100644 index 0000000..f5685ea --- /dev/null +++ b/bPod/com/oop/SelectionSwitcher.as @@ -0,0 +1,194 @@ +import mx.utils.Delegate;
+import com.services.BuckyServices;
+import com.events.EventBroadcaster;
+import mx.transitions.easing.Regular;
+import mx.transitions.Tween;
+
+class com.oop.SelectionSwitcher extends MovieClip
+{
+ private static var slideAround:Boolean = true; // turn off while debugging only
+
+ private var selectionsMC:MovieClip; // all scrolling selection systems
+ private var initX:Number; // where they start
+ private var initY:Number;
+
+ private var bb:MovieClip; // back button
+
+ private var bbX:Number; // starting positions of nav buttons;
+ private var thX:Number;
+ private var kwX:Number;
+
+ private var initAlpha:Number = 70;
+
+ private var openKeywordsBtn:MovieClip; // open keywords button
+ private var openThreadBtn:MovieClip; // open threads button
+
+ private var currentView:String; // might as well be a string
+ private var agreedAlpha:Number = 75;
+ private var slideAmountX:Number = 210;
+ private var slideAmountY:Number = 210;
+ private var slideSpeed:Number = .4
+ private var activeThread:String; // to open a new browser window instead of
+ // switching to keyword/thread/file view.
+
+ public function SelectionSwitcher() {
+ establishStartingPoints();
+ EventBroadcaster.getInstance().addEventListener("switchToKeywordsView", this);
+ EventBroadcaster.getInstance().addEventListener("switchToThreadsView", this);
+ EventBroadcaster.getInstance().addEventListener("switchToFilesView", this);
+
+ EventBroadcaster.getInstance().addEventListener("switchToFeedThreadsView", this);
+
+
+ bb.onRelease = Delegate.create (this, handleBackButton);
+ openKeywordsBtn.onRelease = Delegate.create (this, handleOpenKeywordsBtn);
+ openThreadBtn.onRelease = Delegate.create (this, handleOpenThreadBtn);
+ }
+
+ private function handleBackButton():Void {
+ switch (currentView) {
+ case "threads" : switchToKeywordsView(); break;
+ case "files" : switchToThreadsView(); break;
+ case "feeds" : switchToFeedsView(); break;
+ default : break;
+ }
+ }
+
+ private function establishStartingPoints():Void {
+ initX = selectionsMC._x;
+ initY = selectionsMC._y;
+ bbX= bb._x;
+ thX= openThreadBtn._x;
+ kwX= openKeywordsBtn._x;
+ currentView = "keywords";
+ hideBackButton();
+ hideOpenThreadBtn();
+ hideOpenKeywordsBtn();
+
+ bb._alpha = openKeywordsBtn._alpha = openThreadBtn._alpha = initAlpha;
+ }
+
+ private function swapPlaces(_inA:MovieClip, _inB:MovieClip):Void {
+
+ var oldX:Number = _inA._x;
+ var oldY:Number = _inA._y;
+
+ _inA._x = _inB._x;
+ _inA._y = _inB._y;
+
+ _inB._x = oldX;
+ _inB._y = oldY;
+ }
+
+ private function handleOpenKeywordsBtn():Void {
+ switchToKeywordsView();
+ }
+
+ public function handleOpenThreadBtn():Void {
+ getURL ( BuckyServices.activeThreadPath , "_blank");
+ }
+
+ public function switchToKeywordsView(_evt:Object):Void {
+ removeAnyThumbnails();
+ hideBackButton();
+ hideOpenKeywordsBtn();
+ hideOpenThreadBtn();
+ _root.thumbnail.removeMovieClip();
+
+ // swapPlaces ( BuckyServices.threadsMC , BuckyServices.feedThreadsMC );
+
+ if (slideAround) {
+ var sTween = new Tween(selectionsMC, "_x", Regular.easeOut, selectionsMC._x, initX, slideSpeed, true);
+ }
+ currentView = "keywords";
+ }
+
+
+ public function switchToFeedsView(_evt:Object):Void {
+ removeAnyThumbnails();
+ hideBackButton();
+ hideOpenKeywordsBtn();
+ hideOpenThreadBtn();
+ _root.thumbnail.removeMovieClip();
+
+// swapPlaces ( BuckyServices.threadsMC , BuckyServices.feedThreadsMC );
+
+ if (slideAround) {
+ var xTween = new Tween(selectionsMC, "_x", Regular.easeOut, selectionsMC._x, initX, slideSpeed, true);
+ var yTween = new Tween(selectionsMC, "_y", Regular.easeOut, selectionsMC._y, initY, slideSpeed, true);
+ }
+ currentView = "feeds";
+ }
+
+
+
+
+ public function switchToThreadsView(_evt:Object):Void {
+ removeAnyThumbnails();
+ hideOpenKeywordsBtn();
+ hideOpenThreadBtn();
+ _root.thumbnail.removeMovieClip();
+
+ if (slideAround) {
+ var sTween = new Tween(selectionsMC, "_x", Regular.easeOut, selectionsMC._x, -slideAmountX, slideSpeed, true);
+ sTween.onMotionFinished = Delegate.create (this, showBackButton);
+ }
+ currentView = "threads";
+ }
+
+
+
+ public function switchToFeedThreadsView(_evt:Object):Void {
+ removeAnyThumbnails();
+ hideOpenKeywordsBtn();
+ hideOpenThreadBtn();
+ _root.thumbnail.removeMovieClip();
+
+ if (slideAround) {
+ var sTween = new Tween(selectionsMC, "_y", Regular.easeOut, selectionsMC._y, -slideAmountY, slideSpeed, true);
+ var sTween = new Tween(selectionsMC, "_x", Regular.easeOut, selectionsMC._x, -slideAmountX, slideSpeed, true);
+ sTween.onMotionFinished = Delegate.create (this, showBackButton);
+ }
+ currentView = "feeds";
+ }
+
+
+
+
+
+
+
+ public function switchToFilesView(_evt:Object):Void {
+// removeAnyThumbnails();
+ showOpenKeywordsBtn();
+ showOpenThreadBtn();
+
+ if (slideAround) {
+ var sTween = new Tween(selectionsMC, "_x", Regular.easeOut, selectionsMC._x, -slideAmountX*2, slideSpeed, true);
+ sTween.onMotionFinished = Delegate.create (this, showBackButton);
+ }
+ currentView = "files";
+ }
+
+
+
+
+
+
+
+ public function removeAnyThumbnails():Void {
+ _root.imagesHolder.thumbnail.unloadMovie();
+ }
+
+
+ private function showBackButton():Void { bb._x = bbX; }
+ private function showOpenKeywordsBtn():Void { openKeywordsBtn._x = kwX; }
+ private function showOpenThreadBtn():Void { openThreadBtn._x = thX; }
+
+ private function hideBackButton():Void { bb._x = -5000; }
+ private function hideOpenKeywordsBtn():Void { openKeywordsBtn._x = -5000; }
+ private function hideOpenThreadBtn():Void { openThreadBtn._x = -5000; }
+
+
+
+}
diff --git a/bPod/com/oop/SelectionSystem.as b/bPod/com/oop/SelectionSystem.as new file mode 100644 index 0000000..2c89bf0 --- /dev/null +++ b/bPod/com/oop/SelectionSystem.as @@ -0,0 +1,89 @@ +/*
+ Manages a set of UI Buttons and controls selection state
+*/
+
+class com.oop.SelectionSystem extends MovieClip
+{
+
+//----------------------------------------------------------------------------------
+
+
+
+ // Data array passed in at instantiation
+ private var systemData:Array;
+
+ // Linkage name of button clip
+ private var exportName:String;
+
+ // Store our current state as a number
+ private var currentSelection:Number;
+
+ // Store references to our items
+ private var listItems:Array;
+
+
+
+
+
+//----------------------------------------------------------------------------------
+
+ public function SelectionSystem()
+ {
+
+ }
+
+//----------------------------------------------------------------------------------
+
+ public function doInit(_systemData:Array, _exportName:String):Void
+ {
+ systemData = _systemData;
+ exportName = _exportName;
+ listItems = new Array();
+ attachButtonItems();
+
+ }
+
+
+
+ public function setSelection(_id:Number):Void
+ {
+ if(currentSelection!=_id)
+ {
+ listItems[currentSelection].setUnselected();
+ currentSelection = _id;
+ listItems[currentSelection].setSelected();
+ doAction();
+ }
+ }
+
+ private function attachButtonItems():Void {
+ //override
+ }
+
+
+ private function doAction():Void
+ {
+ //override
+ }
+
+
+ // Getter/setters
+
+ public function getSystemData():Array
+ {
+ return systemData;
+ }
+
+ public function getCurrentSelection():Number
+ {
+ return currentSelection;
+ }
+
+ public function setCurrentSelection(_val:Number):Void
+ {
+ currentSelection = _val;
+ }
+
+
+
+}
\ No newline at end of file diff --git a/bPod/com/oop/UIButton.as b/bPod/com/oop/UIButton.as new file mode 100644 index 0000000..035c16c --- /dev/null +++ b/bPod/com/oop/UIButton.as @@ -0,0 +1,171 @@ +
+
+import com.oop.SelectionSystem;
+
+class com.oop.UIButton extends MovieClip
+{
+
+//--------------------------------------------------------------------------------------------
+
+ // Stores a reference to a SelectionSystem instance
+ private var selectionSystem:Object;
+
+ // Numeric id passed in by SelectionSystem when attached
+ private var id:Number;
+
+
+
+
+ // Keeps track of the selection status of this clip
+ private var selected:Boolean;
+
+ // Holds any custom visual information (such as title)
+ private var itemData:Object;
+
+ // stores the history of this item
+ private var visited:Boolean;
+
+
+
+
+//--------------------------------------------------------------------------------------------
+// constructor
+//--------------------------------------------------------------------------------------------
+
+ public function UIButton()
+ {
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Set up our reference, ID, and item data
+ then take care of the clip's ui
+ */
+ public function init(_selectionSystem:SelectionSystem, _id:Number, _itemData:Object ):Void
+ {
+ selectionSystem = _selectionSystem;
+ itemData = _itemData;
+ id = _id;
+ _focusrect = false;
+ initMouseEvents();
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Select this clip. It will stay visually selected
+ because the mouse is rolled over it
+ */
+ private function setSelected():Void
+ {
+ selected = visited = true;
+ killMouseEvents();
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Unselect this clip
+ */
+ private function setUnselected():Void
+ {
+ selected = false;
+ initMouseEvents();
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ private function setTitle(_val:Object):Void
+ {
+ // override
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ private function setPosition():Void
+ {
+ //override
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Tell selectionSystem about the click and pass this clips ID with it
+ */
+ private function handleRelease():Void
+ {
+ selectionSystem.setSelection(id);
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ private function handlePress():Void
+ {
+ //override
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ private function handleRollOver():Void
+ {
+ //override
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ private function handleRollOut():Void
+ {
+ //override
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Capture all of our mouse events and pass them
+ to the internal hander methods
+ */
+ private function initMouseEvents() : Void
+ {
+ useHandCursor = false;
+ onRollOver = handleRollOver;
+ onRollOut = handleRollOut;
+ onReleaseOutside = handleRollOut;
+ onPress = handlePress;
+ onRelease = handleRelease;
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ /*
+ Remove all mouse events while the clip is selected
+ */
+ private function killMouseEvents():Void
+ {
+ useHandCursor = false;
+ delete onRollOver;
+ delete onRollOut;
+ delete onReleaseOutside;
+ delete this.onPress;
+ delete this.onRelease;
+ }
+
+//--------------------------------------------------------------------------------------------
+// Getter/Setters
+//--------------------------------------------------------------------------------------------
+
+ public function getId():Number
+ {
+ return id;
+ }
+
+//--------------------------------------------------------------------------------------------
+
+ public function setId(_val:Number):Void
+ {
+ id = _val;
+ }
+
+//--------------------------------------------------------------------------------------------
+
+}
diff --git a/bPod/com/player/Player.as b/bPod/com/player/Player.as new file mode 100644 index 0000000..81acd3b --- /dev/null +++ b/bPod/com/player/Player.as @@ -0,0 +1,131 @@ +
+import mx.utils.Delegate;
+import com.services.BuckyServices;
+
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+
+
+class com.player.Player extends MovieClip
+{
+ var songList:Array;
+ public static var s:Sound;
+
+ var currentSongTitle:String;
+ var currentSongInfo:String;
+
+ var backing:MovieClip;
+ var collapseBtn:MovieClip;
+ var infoBtn:MovieClip;
+ var playPauseBtn:MovieClip;
+
+
+ var collapsed:Boolean;
+ var dragging:Boolean;
+ var initted:Boolean;
+ var infoState:Boolean;
+ var isPlaying:Boolean;
+
+ var title_txt:TextField;
+
+ var initBacking:Number;
+ var oldX:Number;
+ var oldY:Number;
+
+ public function Player() {
+ initted = dragging = collapsed = infoState = useHandCursor = _focusrect = isPlaying = false;
+ }
+
+
+ public function init(_inObject:Object):Void {
+
+ if (!initted) {
+ var t:Tween = new Tween(this, "_y", Elastic.easeOut, _y, 120, 1, true);
+ initted = true;
+ }
+
+ infoBtn.gotoAndStop ("info");
+ infoBtn._rotation = 0;
+ infoState = false;
+ collapseBtn.gotoAndStop ("collapse");
+ playPauseBtn.gotoAndStop ("pauseIcon");
+
+ isPlaying = true;
+
+ currentSongTitle = _inObject.filename;
+ title_txt.text = currentSongTitle;
+ songList.push (_inObject.theURL);
+ initBacking = backing._alpha;
+
+ currentSongInfo = BuckyServices.activeKeyword + " > " + BuckyServices.activeThread;
+
+
+ stopAllSounds();
+
+
+ s = new Sound(_root);
+ s.loadSound ( _inObject.theURL , true );
+ s.start();
+ }
+
+
+
+
+ private function doCollapse():Void {
+ if (!collapsed) {
+ oldX = _x; oldY = _y;
+ var vFunc:Function = function () {
+ var xTween = new Tween(this, "_x", Regular.easeOut, _x, 11, .2, true);
+ var yTween = new Tween(this, "_y", Regular.easeOut, _y, 9, .2, true);
+ collapsed = true;
+ }
+ var bTween = new Tween (collapseBtn, "_rotation", Regular.easeOut, collapseBtn._rotation, 90, .4, true);
+ var rTween = new Tween (this, "_rotation", Regular.easeOut, _rotation, -90, .4, true);
+ rTween.onMotionFinished = Delegate.create (this, vFunc);
+ } else {
+ var xTween = new Tween(this, "_x", Regular.easeOut, _x, oldX, .4, true);
+ var bTween = new Tween (collapseBtn, "_rotation", Elastic.easeOut, collapseBtn._rotation, 0, .8, true);
+ var yTween = new Tween(this, "_y", Regular.easeOut, _y, oldY, .4, true);
+ rTween = new Tween (this, "_rotation", Regular.easeOut, _rotation, 0, .4, true);
+ collapsed = false;
+ }
+ }
+
+ private function doInfoBtn():Void {
+ var r:Number = infoState == true ? 0 : 180;
+ title_txt.text = infoState == true ? currentSongTitle : currentSongInfo;
+ new Tween(infoBtn, "_rotation", Regular.easeOut, infoBtn._rotation, r, .4, true);
+ infoState = !infoState;
+ }
+
+
+ private function doPlayPause():Void {
+ if (isPlaying) { s.stop(); isPlaying = false; playPauseBtn.gotoAndStop ("playIcon"); }
+ else { s.start(); isPlaying = true; playPauseBtn.gotoAndStop ("pauseIcon"); }
+ }
+
+
+ private function onPress():Void {
+ if (collapseBtn.hitTest (_root._xmouse, _root._ymouse)) {
+ doCollapse();
+ }
+ else if (infoBtn.hitTest (_root._xmouse, _root._ymouse))
+ {
+ doInfoBtn();
+ }
+ else if (playPauseBtn.hitTest (_root._xmouse, _root._ymouse))
+ {
+ doPlayPause();
+ }
+ else {
+ var aTween:Tween = new Tween(this, "_alpha", Regular.easeOut, _alpha, 20, .4, true);
+ startDrag(this);
+ }
+ }
+
+ private function onRelease():Void {
+ stopDrag();
+ var aTween:Tween = new Tween(this, "_alpha", Regular.easeOut, _alpha, 100, .4, true);
+ }
+
+}
\ No newline at end of file diff --git a/bPod/com/player/Visuals.as b/bPod/com/player/Visuals.as new file mode 100644 index 0000000..2a4ac7b --- /dev/null +++ b/bPod/com/player/Visuals.as @@ -0,0 +1,85 @@ + + +class com.player.Visuals extends MovieClip { + +// private var theRoot:MovieClip; + private var numParticles:Number = 10; + private var minDist:Number = 50; + private var springAmount:Number = .001; + + private var vbounds:MovieClip; + + public function Visuals() {} + + public function init():Void + { + setMask (vbounds); + + for(var i:Number=0; i< numParticles;i++) { + var particle:MovieClip = this.attachMovie("particle", "p" + i, i); + particle._x = Math.random() * vbounds._width; + particle._y = Math.random() * vbounds._height; + particle.vx = Math.random() * 6 - 3; + particle.vy = Math.random() * 6 - 3; + particle._xscale = particle._yscale = 10 + Math.random() * 100; + particle.mass = particle._xscale / 100; + } + +// onEnterFrame = initAnimation; + + + } + + private function onEnterFrame():Void + { + for(var i:Number = 0;i<numParticles;i++) + { + var particle:MovieClip = this["p" + i]; + particle._x += particle.vx; + particle._y += particle.vy; + if(particle._x > vbounds._width) { + particle._x = vbounds._x; + } + else if(particle._x < -10) { + particle._x = vbounds._width; + } + if(particle._y > vbounds._height) { + particle._y = vbounds._y; + } + else if(particle._y < -46) { + particle._y = vbounds._height; + } + } + + clear(); + for(i=0;i<numParticles-1;i++) + { + var partA:MovieClip = this["p" + i]; + for(var j:Number = i+1;j<numParticles;j++) { + var partB:MovieClip = this["p" + j]; + spring(partA, partB); + } + } + } + + function spring(partA:MovieClip, partB:MovieClip):Void + { + var dx:Number = partB._x - partA._x; + var dy:Number = partB._y - partA._y; + var dist:Number = Math.sqrt(dx*dx + dy*dy); + if(dist < minDist) + { + lineStyle(1, 0xffffff, 100 - dist / minDist * 100); + moveTo(partA._x, partA._y); + lineTo(partB._x, partB._y); + var ax:Number = dx * springAmount; + var ay:Number = dy * springAmount; + partA.vx += ax / partA.mass; + partA.vy += ay / partA.mass; + partB.vx -= ax / partB.mass; + partB.vy -= ay / partB.mass; + } + } + + +};
\ No newline at end of file diff --git a/bPod/com/services/BuckyServices.as b/bPod/com/services/BuckyServices.as new file mode 100644 index 0000000..d2d8560 --- /dev/null +++ b/bPod/com/services/BuckyServices.as @@ -0,0 +1,133 @@ + + +class com.services.BuckyServices { + + // on-stage movie clip references: + public static var keywordsMC:MovieClip = _root.switcher.selectionsMC.keywordsMC; + public static var threadsMC:MovieClip = _root.switcher.selectionsMC.threadsMC; + public static var filesMC:MovieClip = _root.switcher.selectionsMC.filesMC; + + // scrollers for feeds + public static var feedThreadsMC:MovieClip = _root.switcher.selectionsMC.feedThreadsMC; + public static var feedItemsMC:MovieClip = _root.switcher.selectionsMC.feedItemsMC; + + + // http:// or https:// ? + public static var urlRoot:String; + + // rss proxy processing: + public static var rssProxy:String = "www.carbonpictures.com/tfarnon/bucky/services/beta/buckyRSSproxy.php"; + + // constructors for php query strings which return lists of data +// public static var keywords:String = "www.carbonpictures.com/tfarnon/bucky/services/beta/buckyk.php"; + public static var keywords:String ;// = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_k" +// public static var threads:String = "www.carbonpictures.com/tfarnon/bucky/services/beta/buckyth.php?k="; + public static var threads:String ; // = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_th?k="; +// public static var files:String = "www.carbonpictures.com/tfarnon/bucky/services/beta/buckyf.php?pid="; + public static var files:String ; // = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_f?pid=" + +// public static var tags:String; + + // bucky-specific paths -- these are SET IN STONE until julian instructs otherwise +// public static var singleFilePath:String = "www.carbonpictures.com/bucky/data/"; + public static var singleFilePath:String ; // = "kitchenhacklab.foodhacking.com/bucky/data/"; +// public static var singleThreadPath:String = "www.carbonpictures.com/cgi-bin/bucky/details?id="; + public static var singleThreadPath:String ; // = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/details?id=" + + // repository of active (ever-changing) settings ---------------------------------- + + public static var activeKeyword:String; // human readable keyword name + + public static var activeThread:String; // human readable thread name + public static var activeThreadID:Number; // bucky thread ID + public static var activeThreadPath:String; // full URL to active thread + + public static var activeFile:String; // human readable filename + public static var activeFileID:Number; // bucky file ID + public static var activeFilePath:String; // full URL to active mp3, jpg, gif, etc. + + public static var activeUserID:Number; // human readable user name + public static var activeUserName:String; // bucky user ID + + // end repository ----------------------------------------------------------------- + + + public function BuckyServices() {} + + public static function init():Void + { + var u:String = _url.slice (4,5); + + switch ( u ) { case ":" : urlRoot = "http://"; break; + case "s" : urlRoot = "https://"; break; + } + + _root.debug.text = urlRoot + _root.keywords; + + // these variables now magially come to us via the + // SWFObject html, instead of being hardcoded + // inside a flash movie + +// if (_root.keywords != undefined ) +// { + keywords = urlRoot + _root.keywords; + threads = urlRoot + _root.threads; + files = urlRoot + _root.files; + singleFilePath = urlRoot + _root.singleFilePath; + singleThreadPath = urlRoot + _root.singleThreadPath; + rssProxy = urlRoot + rssProxy; + +/* } + else + { +*/ +/* keywords = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_k" + threads = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_f?pid=" + files = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/services_th?k=" + singleFilePath = "kitchenhacklab.foodhacking.com/bucky/data/" + singleThreadPath = "kitchenhacklab.foodhacking.com/cgi-bin/bucky/details?id=" + rssProxy = urlRoot + rssProxy; + + } +*/ + } + + public static function setActiveKeyword (_inObj:Object):Void { + activeKeyword = _inObj.name; + _root.debug.text += "\nKEYWORD: " + activeKeyword; + + } + + + public static function setActiveThread (_inObj:Object):Void { + activeThread = _inObj.name; + activeThreadID = _inObj.id; + activeThreadPath = singleThreadPath + activeThreadID; + _root.debug.text += "\nTHREAD:" + activeThread; + } + + public static function setActiveFile (_inObj:Object):Void { + activeFile = _inObj.filename; + activeFilePath = urlRoot + singleFilePath + activeFile; + _root.debug.text += "\nFILE: " + activeFilePath; + } + + public static function setActiveUserID (_inNumber:Number):Void { + activeUserID = _inNumber; + _root.debug.text += "\n" + activeUserID; + } + + public static function setActiveUserName (_inString:String):Void { + activeUserName = _inString; + } + + public static function getThumbURL (_inName:String):String { + + return ( singleFilePath + activeThreadID + "/.thumb/b." + _inName ); + //"www.carbonpictures.com/bucky/data/" + + + + } + + +};
\ No newline at end of file diff --git a/bPod/com/tags/TagButton.as b/bPod/com/tags/TagButton.as new file mode 100644 index 0000000..b2d908e --- /dev/null +++ b/bPod/com/tags/TagButton.as @@ -0,0 +1,95 @@ +import com.oop.UIButton;
+import com.oop.SelectionSystem;
+import mx.utils.Delegate;
+
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+
+class com.tags.TagButton extends UIButton
+{
+ private var title_mc:MovieClip;
+ private var desc_mc:MovieClip;
+ private var icon_mc:MovieClip;
+ private var bg_mc:MovieClip;
+ private var gridObj:Object;
+ private var shine_mc:MovieClip;
+ private var element_mc:MovieClip;
+ private var initialAlpha:Number = 60;
+ private var initialShine:Number = 30;
+ private var tint:Number;
+
+ public var elementSymbol:String;
+
+ private var installedX:Number = 0;
+ private var installedY:Number = 0;
+
+ public function KeywordButton() {}
+
+ public function init(_selectionSystem:SelectionSystem, _id:Number, _itemData:Object, _gridObj:Object ):Void {
+ gridObj = _gridObj;
+ super.init (_selectionSystem, _id, _itemData);
+ makeButton(itemData);
+ }
+
+ public function hashColor (_inStr:String):Number {
+ switch (_inStr) {
+ case "ivory": return (0xE0E0D8);
+ case "orange": return (0xFFD799);
+ case "yellow": return (0xFFF7A8);
+ case "green": return (0xDAF4B2);
+ case "blue": return (0xCCCCFF);
+ case "purple": return (0xDDB1FF);
+ case "pink": return (0xFFAECD);
+ case "plain": return (0xE6f0f0);
+ default: return (0xFFFFFF);
+ }
+ }
+
+
+ private function makeButton(_val:Object):Void {
+ icon_mc._alpha = initialAlpha;
+ shine_mc._alpha = initialShine;
+ title_mc.title_txt.text = _val.name.toLowerCase();
+
+ var c:String = _val.name.charAt(0); // b
+ var cc:String = _val.name.charAt(1); // u
+ var u:String = c.toUpperCase(); // B (if b)
+ var uu:String = cc.toLowerCase(); // u (if U)
+ var tmp:String = u.concat (uu); // Bu
+
+ element_mc.element_txt.text = tmp;
+
+ elementSymbol = tmp;
+
+
+ var tmpColor:Number = hashColor ( _val.color.toString() );
+ element_mc.element_txt.textColor = tmpColor; // &= 0x7F7F7F;
+ setPosition();
+ }
+
+ private function setPosition():Void {
+ _x = Math.round ( (gridObj.grid_x * _width) + (gridObj.horizSpace * gridObj.grid_x));
+ _y = Math.round ( ((gridObj.grid_y-1) * _height) + (gridObj.vertSpace * (gridObj.grid_y-1)));
+
+ installedX = _x;
+ installedY = _y;
+ }
+
+ private function handleRollOver():Void {
+ var tTween = new Tween(icon_mc, "_alpha", Regular.easeOut, icon_mc._alpha, 100, 1, true);
+ var shineTween = new Tween(shine_mc, "_alpha", Regular.easeOut, shine_mc._alpha, 0, .2, true);
+ }
+
+ private function handleRollOut():Void
+ {
+ if(visited) { var fadeVal:Number = initialAlpha; }
+ else { var fadeVal:Number = initialAlpha; }
+
+ var tTween = new Tween (icon_mc, "_alpha", Regular.easeOut, icon_mc._alpha, initialAlpha, 1, true);
+ var shineTween = new Tween (shine_mc, "_alpha", Regular.easeOut, shine_mc._alpha, initialShine, .2, true);
+ }
+
+ public function setSelected():Void
+ {
+ }
+}
\ No newline at end of file diff --git a/bPod/com/threads/ThreadButton.as b/bPod/com/threads/ThreadButton.as new file mode 100644 index 0000000..296c15f --- /dev/null +++ b/bPod/com/threads/ThreadButton.as @@ -0,0 +1,57 @@ +import mx.utils.Delegate;
+import mx.transitions.easing.*;
+import mx.transitions.Tween;
+import com.events.EventBroadcaster;
+
+import com.keywords.KeywordButton;
+
+class com.threads.ThreadButton extends KeywordButton {
+
+ private var username_mc:MovieClip;
+ private var alphabet_mc:MovieClip;
+ private var backing:MovieClip;
+ private var initialAlpha:Number;
+ private var overlay:MovieClip;
+
+ private function makeButton(_val:Object):Void {
+ overlay._visible = false;
+ initialAlpha = backing._alpha;
+ title_mc.title_txt.text = _val.name;
+ username_mc.username_txt.text = _val.user;
+
+ var ok:String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ var stru:String = _val.name.toUpperCase();
+ var strc:String = stru.charAt(0);
+ var strl:String = stru.charAt(1).toLowerCase();
+
+ if ( ok.indexOf (strc) != -1)
+ alphabet_mc.alphabet_txt.text = strc + strl;
+ else
+ alphabet_mc.alphabet_txt.text = "";
+
+ super.setPosition();
+ }
+
+ private function handleRollOver():Void {
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, 40, .4, true);
+// makeWhite();
+ }
+
+ private function handleRollOut():Void {
+
+ if(visited) { var fadeVal:Number = initialAlpha; }
+ else { var fadeVal:Number = initialAlpha; }
+
+ var tTween = new Tween(backing, "_alpha", Regular.easeOut, backing._alpha, initialAlpha, .4, true);
+// makeBlack();
+ }
+
+ private function makeWhite():Void {
+ title_mc.title_txt.textColor =0xFFFFFF;
+ }
+
+ private function makeBlack():Void {
+ title_mc.title_txt.textColor =0x000000;
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/threads/ThreadScroller.as b/bPod/com/threads/ThreadScroller.as new file mode 100644 index 0000000..2aecde6 --- /dev/null +++ b/bPod/com/threads/ThreadScroller.as @@ -0,0 +1,15 @@ +import com.oop.ScrollingMenuFrame;
+
+class com.threads.ThreadScroller extends ScrollingMenuFrame
+{
+ var intRate:Number = 20; // scroller speed
+
+ public function doLoad(_dataArray:Array , _buttonType:String):Void {
+ holder_mc.attachMovie("ThreadSelectionSystem", "threads", 1000);
+ holder_mc["threads"].doInit(_dataArray, _buttonType );
+
+// holder_mc._x = 0; // use as needed! this puts the horiz scroller back in view
+ holder_mc._y = 0; // when a keyword tile is clicked.
+ }
+
+};
\ No newline at end of file diff --git a/bPod/com/threads/ThreadSelectionSystem.as b/bPod/com/threads/ThreadSelectionSystem.as new file mode 100644 index 0000000..c94b57d --- /dev/null +++ b/bPod/com/threads/ThreadSelectionSystem.as @@ -0,0 +1,74 @@ +import com.keywords.KeywordSelectionSystem;
+import com.events.EventBroadcaster;
+import com.tubes.BuckyFileTube;
+import com.services.BuckyServices;
+
+class com.threads.ThreadSelectionSystem extends KeywordSelectionSystem {
+
+ private var itemsPerRow:Number = 1;
+ private var vertSpace:Number = 1;
+ private var tube:BuckyFileTube;
+
+ private function doAction():Void {
+ eraseExistingSpinners();
+ BuckyServices.setActiveThread( selectedData() );
+ EventBroadcaster.getInstance().addEventListener("fileListMade", this);
+ tube = new BuckyFileTube ( BuckyServices.files + selectedData().id );
+ startButtonSpinner();
+ }
+
+
+ private function showSelectedFeedback():Void {
+ for (var i:Number = listItems.length ; i >= 0 ; i--) {
+ var t:MovieClip = listItems[i];
+
+ t.overlay._visible = ( currentSelection == i) ? true : false;
+
+ }
+ }
+
+ private function eraseExistingSpinners():Void {
+ for (var i:Number = 0 ; i < listItems.length ; i++) {
+ var t:MovieClip = listItems[i];
+ t.alphabet_mc._visible = true;
+ t.username_mc.username_txt.text = systemData[i].user;
+ t["spinnerHolder"].removeMovieClip(); // kill if exists .. fail silently if not
+ }
+ EventBroadcaster.getInstance().removeEventListener("threadListMade", this);
+ }
+
+ private function startButtonSpinner():Void {
+ var t:MovieClip = listItems[currentSelection];
+ t.alphabet_mc._visible = false;
+ t.username_mc.username_txt.text = "loading!!!";
+ t.createEmptyMovieClip ("spinnerHolder", t.getNextHighestDepth());
+ t["spinnerHolder"].attachMovie ("Spinner", "spinner" , 100, {_x:196, _y:15, _width:18, _height:18});
+ }
+
+
+ private function fileListMade (_evt:Object):Void {
+
+ eraseExistingSpinners();
+
+ _root.debug.text = tube.articles.length;
+
+ if (( tube.articles.length != undefined) && ( tube.articles.length != 0 )) {
+
+ BuckyServices.setActiveThread ( selectedData() );
+
+ setCurrentSelection ( currentSelection );
+ showSelectedFeedback();
+
+ BuckyServices.filesMC.doLoad( tube.articles , "FileButton" );
+
+ EventBroadcaster.getInstance().broadcastEvent("switchToFilesView", null);
+
+ } else if ( tube.articles.length == 0 ) {
+
+ _root.switcher.handleOpenThreadBtn();
+ var t:MovieClip = listItems[currentSelection];
+ t.username_mc.username_txt.text = "opening " + selectedData().user + "'s thread..";
+
+ }
+ }
+};
\ No newline at end of file diff --git a/bPod/com/tubes/BuckyFileTube.as b/bPod/com/tubes/BuckyFileTube.as new file mode 100644 index 0000000..958523b --- /dev/null +++ b/bPod/com/tubes/BuckyFileTube.as @@ -0,0 +1,29 @@ +import com.events.EventBroadcaster; +import com.tubes.BuckyTube; + +class com.tubes.BuckyFileTube extends BuckyTube { + + public function BuckyFileTube(_inQuery:String) { + super (_inQuery); + } + + private function buildArray():Void { + articles = new Array(); + for ( var i=0 ; i < theTube.numItems ; i++) { + var fileNameStr:String = new String( theTube["filename"+i] ); + var fileSizeStr:String = new String( theTube["size"+i] ); + var urlStr:String = new String( theTube["url"+i] ); + var filetypeStr:String = new String( theTube["filetype"+i] ); + + var tmpObj:Object = new Object(); + tmpObj.filename = fileNameStr; + tmpObj.filesize = fileSizeStr; + tmpObj.filetype = filetypeStr; + tmpObj.theURL = urlStr; + +// if (filetypeStr == "MP3" || filetypeStr == "JPG" || filetypeStr == "GIF") + articles.push (tmpObj); + } + EventBroadcaster.getInstance().broadcastEvent("fileListMade", null); + } +};
\ No newline at end of file diff --git a/bPod/com/tubes/BuckyKeywordTube.as b/bPod/com/tubes/BuckyKeywordTube.as new file mode 100644 index 0000000..cff96ef --- /dev/null +++ b/bPod/com/tubes/BuckyKeywordTube.as @@ -0,0 +1,46 @@ +import com.events.EventBroadcaster; +import com.tubes.BuckyTube; + +class com.tubes.BuckyKeywordTube extends BuckyTube { + + public var tags:Array; + private var tagColor:Number = 0xFFFFFF; + + public function BuckyKeywordTube(_inQuery:String) { + super (_inQuery); + tags = new Array(); + } + + private function buildArray() { + articles = new Array(); + + + for ( var i=0 ; i < theTube.numItems ; i++) { + var keywordStr:String = new String( theTube["keyword"+i] ); + var colorStr:String = new String( theTube["color"+i] ); + + var tmpObj:Object = new Object(); + tmpObj.name = keywordStr; + tmpObj.color = colorStr; + + articles.push (tmpObj); + } + + if ( theTube.numTags ) + { + + for (var i:Number = 0 ; i < theTube.numTags ; i++) + { + var tagName:String = new String( theTube["tag"+i] ); + + var tmpObj:Object = new Object(); + tmpObj.name = tagName; +// tmpObj.color = tagColor; + tmpObj.isTag = 1; + tags.push (tmpObj); + } + } + + EventBroadcaster.getInstance().broadcastEvent("curtainsUp", null); + } +};
\ No newline at end of file diff --git a/bPod/com/tubes/BuckyThreadTube.as b/bPod/com/tubes/BuckyThreadTube.as new file mode 100644 index 0000000..f0fc0ad --- /dev/null +++ b/bPod/com/tubes/BuckyThreadTube.as @@ -0,0 +1,26 @@ +import com.events.EventBroadcaster; +import com.tubes.BuckyTube; + +class com.tubes.BuckyThreadTube extends BuckyTube { + + public function BuckyThreadTube(_inQuery:String) { + super (_inQuery); + } + + private function buildArray() { + articles = new Array(); + for ( var i=0 ; i < theTube.numItems ; i++) { + var titleStr:String = new String( theTube["title"+i] ); + var userStr:String = new String( theTube["user"+i] ); + var idStr:String = new String( theTube["id"+i] ); + + var tmpObj:Object = new Object(); + tmpObj.name = titleStr; + tmpObj.user = userStr; + tmpObj.id = idStr; + + articles.push (tmpObj); + } + EventBroadcaster.getInstance().broadcastEvent("threadListMade", null); + } +};
\ No newline at end of file diff --git a/bPod/com/tubes/BuckyTube.as b/bPod/com/tubes/BuckyTube.as new file mode 100644 index 0000000..8e57a80 --- /dev/null +++ b/bPod/com/tubes/BuckyTube.as @@ -0,0 +1,23 @@ +import com.events.EventBroadcaster; +import mx.utils.Delegate; + +class com.tubes.BuckyTube { + + private var query:String; + private var theTube:LoadVars; + public var articles:Array; + + public function BuckyTube(_inQuery:String) { + query = _inQuery; + init(); + } + + private function init() { + theTube = new LoadVars(); + theTube.onLoad = Delegate.create (this, buildArray); + theTube.sendAndLoad( query, theTube, "POST"); + } + + private function buildArray() {} // override plz; + +};
\ No newline at end of file |
