 |
Featured jobs
Featured template
View more templates
 |
 |


Next 5
diary engine
 |
 |
function tx() {
l = _global.xmldi.length;
_global.diary = [];
chkvalue = function (x) {
if (x == null || x == "") {
var f = "n/a";
} else {
var f = x;
}
return (f);
};
for (var i = 0; i<l; i++) {
var a = _global.xmldi[i];
if (a.nodeName == "diary") {
var _l10 = a.attributes.author;
var _l19 = a.attributes.date;
var _l13 = a.attributes.feeling;
var _l12 = a.attributes.pic1;
var _l11 = a.attributes.pic2;
for (var w = 0; w<a.childNodes.length; w++) {
var z = a.childNodes[w];
if (z.nodeName == "title") {
var _l8 = z.firstChild;
} else if (z.nodeName == "description") {
var _l6 = z.firstChild;
} else if (z.nodeName == "rr") {
var _l5 = z.firstChild;
}
}
}
_global.diary.push([chkvalue(_l10), chkvalue(_l19), chkvalue(_l13), chkvalue(_l12), chkvalue(_l11), chkvalue(_l8), chkvalue(_l6), chkvalue(_l5)]);
}
}
function bk(x) {
var di = _global.diary[x];
this.info.html = this.q.html=true;
this.q.htmlText = "<br>"+di[6]+"<br>";
this.info.htmlText = "Title: "+stripAll3(di[5])+"<br>Author: "+stripAll3(di[0])+"<br>Date: "+stripAll3(di[1])+"<br>";
}
function loadxmlaid() {
this.onEnterFrame = function() {
var x = clb.getBytesLoaded();
var y = clb.getBytesTotal();
var opp = "loading xml data @"+int(x/y*1000)+"/1000, Total data: "+y+"b";
this.board.t0._yscale = x/y*100;
this.board.textload.text = opp;
df.text = opp;
if (ok) {
tx();
delete this.onEnterFrame;
this.board.textload.text = errorMessage;
this.board.gotoAndPlay("yuo");
}
};
}
function logomovement(mc:MovieClip, positionx:Number) {
this.mc.onEnterFrame = function() {
var opp = positionx-this.mc._x;
if (Math.abs(opp)<1) {
delete this.mc.onEnterFrame;
} else {
this.mc._x += opp*0.315100;
}
};
}
function cmd_motion(mc:String, aph:Number, x_:Number, y_:Number, timefactor:Number) {
this[mc].o = new Object();
this[mc].o.a = this[mc].o.b=this[mc].o.c=false;
this[mc].o.alpha = aph;
delete this[mc].onEnterFrame;
this[mc].onEnterFrame = function() {
var exx:Number = x_;
var exy:Number = y_;
var xd:Number = exx-this._x;
var yd:Number = exy-this._y;
if (Math.abs(xd)<.5) {
this._x = exx;
this.o.a = true;
} else {
this._x += timefactor*xd;
}
if (Math.abs(yd)<.5) {
this._y = exy;
this.o.b = true;
} else {
this._y += timefactor*yd;
}
if (Math.abs(this.o.alpha-this._alpha)<1 and this.o.a and this.o.b) {
if (this.o.alpha == 0) {
this.removeMovieClip();
} else {
this._alpha = this.o.alpha;
}
this.o.c = true;
} else {
this._alpha += timefactor*(this.o.alpha-this._alpha);
}
if (!this.o.a || !this.o.b || !this.o.c) {
break;
} else {
delete this.onEnterFrame, exx, exy, xd, xy, this.o;
}
};
}
function oopago(page:Number) {
var lis = new Array("pupiesbrian.xml", "ddr_wai.xml");
this.attachMovie("oopa", "board", 1000);
this.board._x = 200;
this.board._y = 100;
clb.load(lis[page]);
loadxmlaid();
_root.setvirgin(100, Number(408));
}
function onFocus(focus:String) {
for (var i in this) {
if (typeof (this[i]) == "movieclip" && this[i]._name.substring(0, 4) == "book") {
var mc:String = this[i]._name;
if (mc != focus) {
cmd_motion(mc, 0, 98, this[mc]._y, .081510);
this[mc].choice1._visible = false;
} else {
this[focus].choice1._visible = false;
}
}
}
this.background._y = 9999;
}
function tagBK() {
var va:Number = this.ClO._totalframes;
var fu:Number = 0;
appear = function (m:MovieClip) {
var ap = 0;
m._alpha = ap;
m.onEnterFrame = function() {
if (m._alpha<100) {
m._alpha += 4;
} else if (m._alpha<100 and m._alpha>90) {
m._alpha += 1;
} else {
m._alpha = 100;
delete m.onEnterFrame, ap, va, fu;
}
};
};
crea = function (n:Number) {
var s:String = "book"+n;
this.ClO.duplicateMovieClip(s, n);
this[s].gotoAndStop(n+1);
this[s]._x = 100+n*(148+5);
this[s]._y = 294.1;
this[s].key = s;
this[s].series = n;
this[s].choice1.onRelease = function() {
cmd_motion(s, 100, 98, 294.1, .081510);
onFocus(this._parent.key);
oopago(this._parent.series);
};
appear(this[s]);
};
set308 = setInterval(G1=function () {
if (fu<va) {
crea(fu);
fu++;
} else {
clearInterval(set308);
}
}, 600);
}
System.useCodepage = true;
clb = new XML();
clb.ignoreWhite = true;
var debug_123 = df.text="loading xml data";
var ok = false;
var errorMessage;
clb.onLoad = function(success) {
if (success) {
if (clb.status == 0) {
_global.xmldi = clb.firstChild.childNodes;
debug_123 = "XML was loaded and parsed successfully";
if (clb.loaded) {
ok = true;
}
} else {
debug_123 = "XML was loaded successfully, but was unable to be parsed.";
}
switch (clb.status) {
case 0 :
errorMessage = "No error; parse was completed successfully.";
break;
case -2 :
errorMessage = "A CDATA section was not properly terminated.";
break;
case -3 :
errorMessage = "The XML declaration was not properly terminated.";
break;
case -4 :
errorMessage = "The DOCTYPE declaration was not properly terminated.";
break;
case -5 :
errorMessage = "A comment was not properly terminated.";
break;
case -6 :
errorMessage = "An XML element was malformed.";
break;
case -7 :
errorMessage = "Out of memory.";
break;
case -8 :
errorMessage = "An attribute value was not properly terminated.";
break;
case -9 :
errorMessage = "A start-tag was not matched with an end-tag.";
break;
case -10 :
errorMessage = "An end-tag was encountered without a matching start-tag.";
break;
default :
errorMessage = "An unknown error has occurred.";
break;
}
debug_123 = "status: "+clb.status+" ("+errorMessage+")";
delete clb;
} else {
debug_123 = "Unable to load/parse XML. (status: "+clb.status+")";
}
};
var no = 0;
Posted by: Heskeyo | website
http://www,ooxford.hk.st
|
 |
 |
 |
Fake EQ
 |
 |
FakeEQ = function (mc, barnum, hspace, eqmax, bcolor, balpha, bps) {
this.vmc = mc; // timeline/movieclip to use
this.barnum = barnum; // number of bars
this.hspace = hspace; // space between bars
this.eqmax = eqmax; // peak level of bars
this.bcolor = bcolor; // color of bars
this.balpha = balpha; // alpha of bars
this.bps = bps; // rate of redraw in milliseconds
//
this.eqIntervals = [];
this.linkages = [];
this.initialize();
};
FakeEQ.prototype.initialize = function() {
if(this.eqIntervals.length<1) {
var lastx;
var bps = this.bps;
for (var i = 1; i<this.barnum+1; ++i) {
this.vmc.createEmptyMovieClip("eq_"+i, i)._x = lastx;
this.linkages["barset_"+i] = setInterval(this.redrawbars, bps, this, this.vmc["eq_"+i], this.eqmax, this.bcolor, this.balpha);
this.eqIntervals.push([this.linkages["barset_"+i], this.vmc["eq_"+i]]);
lastx = this.vmc["eq_"+i]._x+6+this.hspace;
}
delete lastx;
delete bps;
}
};
FakeEQ.prototype.redrawbars = function(func, mc, bmax, bcol, alp) {
var nob = random(bmax)+1;
var lasty;
for (var i in mc) {
mc[i].removeMovieClip();
delete mc[i];
}
for (var i = 0; i<nob; ++i) {
mc.createEmptyMovieClip("eqbar_"+i, i)._y = lasty;
if (mc["eqbar_"+i]) {
with (mc["eqbar_"+i]) {
if (i == (func.eqmax-1)) {
beginFill(parseInt("FF0000", 16), Number(alp));
} else {
beginFill(parseInt(bcol, 16), Number(alp));
}
lineTo(6, 0);
lineTo(6, 1);
lineTo(0, 1);
endFill();
}
lasty = mc["eqbar_"+i]._y-mc["eqbar_"+i]._height-1;
}
}
};
FakeEQ.prototype.clearBars = function() {
var mc = this.vmc;
var intervals = this.eqIntervals;
for (i in intervals) {
var interval = intervals[i][0];
var mclinker = intervals[i][1];
clearInterval(interval);
mclinker.removeMovieClip();
}
this.eqIntervals = [];
};
FakeEQ.prototype.restart = function() {
this.initialize();
}
FakeEQ.prototype.killeq = function() {
var i = this.vmc._name
delete this.vmc._parent[i]
for(var k in this) {
if(typeof(this[k]) == "movieclip") {
this[k].removeMovieClip()
} else {
delete this[k]
}
}
}
//
//>> BASIC USAGE:
//
createEmptyMovieClip("instancename", 1)._y = 20;
instancename = new FakeEQ(instancename, 5, 1, 5, "4D9175", 100, 100);
//
//>> instancename.clearBars()
//>> instancename.restart()
//>> instancename.killeq()
//
for(var i in this) { trace(i) }
//
// SHiZNiT@EFnet/#FLASH
Posted by: SHiZNiT | website
http://www.developemental.com
|
 |
 |
 |
FScrollPane KeyDown Controller Module v1.0
 |
 |
Immy asked via this thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=24938) how one could controll the scrollbars on an FScrollPane using the arrows keys. Here's my responce:
// ScrollPaneClass KeyDown Controller Module v1
// Jesse Stratford, ActionScript.org, jesse@actionscript.org
// This code is free for public use but this header must
// remain unalterred.
FScrollPaneClass.prototype.listenForArrows = function() {
var scrollInc = 5;
var this_sp = this;
this.arrowListener = new Object();
this.arrowListener.onKeyDown = function() {
var curScroll = this_sp.getScrollPosition();
if (Key.isDown(Key.LEFT)) {
var newX = Math.max((curScroll.x-scrollInc), 0);
this_sp.setScrollPosition(newX, curScroll.y);
} else if (Key.isDown(Key.RIGHT)) {
// No guard on upper bound as no method returns
// upper limit. This doesn't seem to be an issue
// as trying to exceed the upper bound does
// nothing anyway.
var newX = curScroll.x+scrollInc;
this_sp.setScrollPosition(newX, curScroll.y);
} else if (Key.isDown(Key.UP)) {
var newY = Math.max((curScroll.y-scrollInc), 0);
this_sp.setScrollPosition(curScroll.x, newY);
} else if (Key.isDown(Key.DOWN)) {
var newY = curScroll.y+scrollInc;
this_sp.setScrollPosition(curScroll.x, newY);
}
};
return this.arrowListener;
};
this.attachMovie('FScrollPaneSymbol', 'my_sp', 1);
my_sp.setScrollContent('test');
Key.addListener(my_sp.listenForArrows());
Enjoy!
Posted by: Jesse Stratford | website
http://www.actionscript.org
|
 |
 |
 |
FSScrollPane smooteScroll Extension
 |
 |
With regard to this post http://www.actionscript.org/forums/showthread.php3?s=&threadid=24557 where a user asked for assistance making a method which uses some sort of loop to smoothely scroll a scrollpane component to set coordinates, here's my solution (version 1... tested a bit but pointout bugs if you find them):
As far as I can gather you want to make it so that when you run your command the scrollPane scrolls smoothely to that position rather than just jumping once. Is that correct?
I was surprised to find such a method didn't already exist but it can be made easily enough. Add this code to the Actions layer of the ScrollPane clip (on frame 1, before the #endinticlip):
FScrollPaneClass.prototype.smootheScrollTo = function(x, y) {
if (_global.scrollInt == undefined) {
_global.scrollInt = setInterval(this, "doSmootheScrollTo", 60, x, y);
return true;
} else {
trace (_global.scrollInt)
return false
}
};
FScrollPaneClass.prototype.doSmootheScrollTo = function(x, y) {
the_sp = this;
var curScroll = the_sp.getScrollPosition();
var xDiff = curScroll.x-x;
var yDiff = curScroll.y-y;
var nextX = curScroll.x-(xDiff/10);
var nextY = curScroll.y-(yDiff/10);
the_sp.setScrollPosition(nextX, nextY);
if (Math.abs(curScroll.x-x)<=1 && Math.abs(curScroll.y-y)<=1) {
the_sp.setScrollPosition(x, y);
clearInterval(_global.scrollInt);
delete _global.scrollInt
}
};
You call it using:
myScroller_sp.smootheScrollTo(target_x, target_y);
See the thread for a working example SWF.
Posted by: Jesse Stratford | website
http://www.actionscript.org
|
 |
 |
 |
List box display NOT selected
 |
 |
list1.labelField = "name";
list1.dataProvider = [{name:"John", age:25}, {name:"Jack", age:23}, {name:"Jill", age:29}, {name:"Robert", age:27}];
but1.onRelease = function() {
trace("-All-----");
for (i=0; i<list1.length; i++) {
trace(list1.getItemAt(i).name);
}
trace("-Selected--");
for (i=0; i<list1.selectedItems.length; i++) {
trace(list1.selectedItems[i].name);
}
trace("-Not selected--");
for (i=0; i<list1.length; i++) {
if (list1.rows[i].state != 'selected') {
trace(list1.getItemAt(i).name);
}
}
};
Posted by: Alex Urquhart | website
http:\\www.alexurquhart.org
|
 |
 |
 |
Next
5
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean André Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |