Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Finally Finished FlowerHarp



Hi Flashkit,

I finally finished the musical toy I've been working on all summer. Thanks for your help, especially DawsonK! Here's the FLA.

http://bitsong.com/forBoards.html



FlashKit > Flash Help > Flash ActionScript
Posted on: 08-23-2007, 10:12 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

The MAMMA Of All Prototypes Is Finally Finished
I have finally finished, after 5 days a code that dynamically creates everything to do with a gallery, and while there could be one or two extra tweeks put in, if you are going to use it you can do it yourself. It preloads thumbnails, determines if it needs a scroller, loads images, scales them to a box of your choosing, preloads the main images etc etc etc.

Its Flash MX by the way(just in case you didn't know)

here is my test file
http://buggedcom.50megs.com/protogallery.html
I've been informed / found out that my server that the preview of the gallery was hosted on just ran out of bandwidth, 512mb in 6 days!!!!! and the preview was all that was on there. I've signed another account up and the preview can be found at

http://buggedcom2.50megs.com/photoGallery_7i.html

although give me a few mins to set it up properly.

here is the code

Code:
// If you would like to see this in action please go to
// http://buggedcom.50megs.com/protogallery.html
//
MovieClip.prototype.photoGallery = function(path, trgt, seed, maxSeed, format, fIn, thumbX, thumbY, thumbOutline, maskHeight, arrowSize, scrollSpeed, w, h, lbH, dist, jpgLoadTxt, txtXPos, txtYPos, txtStyle, fontName, txtSize, txtClr, html, bold, Italic, boxWidth, boxHeight, imageX, imageY, boxCentred, imageCentred, trgtImage) {
_global.maxSeed = maxSeed;
_global.seed = seed;
_global.path = path;
_global.thumbX = thumbX;
_global.thumbY = thumbY;
_global.format = format;
_global.trgtImage = trgtImage;
_global.imageCentred = imageCentred;
_global.dist = dist;
_global.boxWidth = boxWidth;
_global.imageX = imageX;
_global.imageY = imageY;
_global.fIn = fIn;
_global.scrollSpeed = scrollSpeed;
seedOrig = seed;
path._x = thumbX;
path._y = thumbY;
imageBox(boxHeight, imageY, boxCentred);
thumbBox(thumbOutline, maskHeight);
howManyNails(txtStyle, jpgLoadTxt, txtXPos, txtYPos, fontName, txtSize, txtClr, bdr, bdrClr, html, bold, italic);
path.createEmptyMovieClip("thumbs", 1);
path.thumbs._x = -dist;
scrollMask(maskHeight, thumbX, thumbY);
loadThumbnails(trgt, format, dist, prev_x, prev_w);
drawBar(w, h, lbH, dist);
onEnterFrame = function () {
imageProgressBarRun();
removeImageBar();
imageSquash();
imageCentre();
loadIn(path.imageStuff.image);
needArrows(arrowSize, dist, h);
path.thumbs["thumb"+seed].onPress = Press;
path.thumbs["thumb"+seed].onRelease = Release;
path.thumbs["thumb"+seed].onEnterFrame = EnterFrame;
if (allFadedIn != true) {
loadingBarRun(txtStyle);
if (seed<maxSeed) {
prev_x = path.thumbs["thumb"+seed]._x;
prev_w = path.thumbs["thumb"+seed]._width;
if (path.thumbs["thumb"+seed]._width>0) {
removeBars();
if (path.thumbs["thumb"+seed]._alpha>=100) {
_global.seed = seed += 1;
drawBar(w, h, lbH, dist, prev_x, prev_w);
loadThumbnails(trgt, format, dist, prev_x, prev_w);
} else {
loadIn(path.thumbs["thumb"+seed]);
}
}
} else if (seed == maxSeed && path.thumbs["thumb"+seed]._width>0) {
loadOut(path.totalLB);
loadOut(path.totalLBB);
path[jpgLoadTxt].removeTextField();
removeBars();
loadIn(path.thumbs["thumb"+maxSeed]);
if (path.thumbs["thumb"+seed]._alpha>100) {
allFadedIn = true;
}
}
}
};
};
//
// Fading functions
//
function loadIn(mc) {
if (mc.getBytesLoaded() == mc.getBytesTotal() && mc._alpha<100 && mc._width>0) {
if (mc._alpha<100) {
mc._alpha += fIn;
}
}
}
function loadOut(mc) {
mc._alpha -= fIn;
}
//
// Thumbnail loading, masking and scrolling functions
//
function thumbAlign() {
if (alignThumbs == true) {
_global.thumbX = thumbX=boxWidth-2*thumbX;
}
}
function loadThumbnails(trgt, format, dist, prev_x, prev_w) {
path.thumbs.createEmptyMovieClip("thumb"+seed, seed).loadMovie(trgt+seed+format+"?nocache="+getDate(), path.thumbs["thumb"+seed]);
path.thumbs["thumb"+seed]._alpha = 0;
path.thumbs["thumb"+seed]._x = prev_x+prev_w+dist;
}
function scrollMask(maskHeight, thumbX, thumbY) {
path.createEmptyMovieClip("scrollMask", maxSeed+5);
path.thumbs.setMask(path.scrollMask);
path.scrollMask.lineStyle(.25, 0x999999, 100);
path.scrollMask.beginFill(0xFF0000, 40);
path.scrollMask.moveTo(0, 0);
path.scrollMask.lineTo(Stage.width-2*thumbX, 0);
path.scrollMask.lineTo(Stage.width-2*thumbX, maskHeight);
path.scrollMask.lineTo(0, maskHeight);
path.scrollMask.lineTo(0, 0);
path.scrollMask.endFill();
}
function thumbBox(thumbOutline, maskHeight) {
if (thumbOutline == true) {
path.createEmptyMovieClip("thumbBox", 2);
path.thumbBox.lineStyle(.25, 0x999999, 100);
path.thumbBox.moveTo(-2, -2);
path.thumbBox.lineTo(Stage.width-2*thumbX+2, -2);
path.thumbBox.lineTo(Stage.width-2*thumbX+2, maskHeight+2);
path.thumbBox.lineTo(-2, maskHeight+2);
path.thumbBox.lineTo(-2, -2);
}
}
function needArrows(arrowSize, dist, h) {
if (path.scrollMask._width<path.thumbs._width) {
if (runMeOnce != true) {
drawArrows(arrowSize);
placeArrows(arrowSize, dist, h);
runMeOnce == true;
path.arrows.arrowLeft._alpha = path.arrows.arrowRight._alpha=100;
}
path.arrows.arrowLeft.onPress = pAL;
path.arrows.arrowRight.onPress = pAR;
path.arrows.onMouseUp = rA;
path.thumbs.onEnterFrame = scrollDirection;
}
}
function drawArrows(arrowSize) {
path.createEmptyMovieClip("arrows", 3);
path.arrows.createEmptyMovieClip("arrowLeft", 1);
path.arrows.arrowLeft.lineStyle(.25, 0x999999, 100);
path.arrows.arrowLeft.beginFill(0x666666, 40);
path.arrows.arrowLeft.moveTo(0, 0);
path.arrows.arrowLeft.lineTo(0, 3*arrowSize/5);
path.arrows.arrowLeft.lineTo(-arrowSize/2, 3*arrowSize/5);
path.arrows.arrowLeft.lineTo(-arrowSize/2, 4*arrowSize/5);
path.arrows.arrowLeft.lineTo(-arrowSize, 3*arrowSize/10);
path.arrows.arrowLeft.lineTo(-arrowSize/2, -arrowSize/5);
path.arrows.arrowLeft.lineTo(-arrowSize/2, 0);
path.arrows.arrowLeft.lineTo(0, 0);
path.arrows.arrowLeft.endFill();
path.arrows.createEmptyMovieClip("arrowRight", 2);
path.arrows.arrowRight.lineStyle(.25, 0x999999, 100);
path.arrows.arrowRight.beginFill(0x666666, 40);
path.arrows.arrowRight.moveTo(0, 0);
path.arrows.arrowRight.lineTo(arrowSize/2, 0);
path.arrows.arrowRight.lineTo(arrowSize/2, -arrowSize/5);
path.arrows.arrowRight.lineTo(arrowSize, 3*arrowSize/10);
path.arrows.arrowRight.lineTo(arrowSize/2, 4*arrowSize/5);
path.arrows.arrowRight.lineTo(arrowSize/2, 3*arrowSize/5);
path.arrows.arrowRight.lineTo(0, 3*arrowSize/5);
path.arrows.arrowRight.lineTo(0, 0);
path.arrows.arrowRight.endFill();
}
function placeArrows(arrowSize, dist, h) {
if (thumbX+5>arrowSize) {
path.arrows.arrowLeft._x = -1.2*dist-5;
path.arrows.arrowRight._x = Stage.width-2*thumbX+dist+5;
path.arrows.arrowRight._y = path.arrows.arrowLeft._y=arrowSize/5;
} else {
path.arrows.arrowLeft._x = arrowSize+5;
path.arrows.arrowRight._x = 2*arrowSize;
path.arrows.arrowRight._y = path.arrows.arrowLeft._y=-arrowSize-2*h;
}
}
function pAL() {
path.thumbs.thumbsMove = -1;
path.thumbs.thumbsSlowDown=0;

}
function pAR() {
path.thumbs.thumbsMove = 1;
path.thumbs.thumbsSlowDown=0;

}
function rA() {
path.thumbs.thumbsSlowDown=1;
}
function scrollDirection() {
if (path.thumbs.thumbsMove == 1) {
if(runOncei!=true){
path.thumbs.scrollSpeed= scrollSpeed;
runOncei=true;
}
if(path.thumbs.thumbsSlowDown==0){
runOncei=false;
}
path.thumbs._x -= path.thumbs.scrollSpeed;
if (path.thumbs._x<-(path.thumbs._width)+(Stage.width-(2*thumbX))){
path.thumbs._x = -(path.thumbs._width)+(Stage.width-(2*thumbX));
}
} else if (path.thumbs.thumbsMove == -1) {
if(runOncei!=true){
path.thumbs.scrollSpeed= scrollSpeed;
runOncei=true;
}
if(path.thumbs.thumbsSlowDown==0){
runOncei=false;
}
path.thumbs._x += path.thumbs.scrollSpeed
if (path.thumbs._x>-dist) {
path.thumbs._x = -dist;
}
}
if (path.thumbs.thumbsSlowDown==1 && path.thumbs.thumbsMove == 1){
path.thumbs.scrollSpeed=0.85*path.thumbs.scrollSpeed;
if(path.thumbs.scrollSpeed<=0.05 ){
path.thumbs.thumbsMove=0;
path.thumbs.thumbsSlowDown=0;
runOncei=false;
}
} else if (path.thumbs.thumbsSlowDown==1 && path.thumbs.thumbsMove == -1){
path.thumbs.scrollSpeed=0.85*path.thumbs.scrollSpeed;
if(path.thumbs.scrollSpeed<=-0.05 ){
path.thumbs.thumbsMove=0;
path.thumbs.thumbsSlowDown=0;
runOncei=false;
}
}
}
function drawBar(w, h, lbH, dist, prev_x, prev_w) {
path.thumbs.createEmptyMovieClip("loadingBarBox"+seed, 2*maxSeed+seed);
path.thumbs["loadingBarBox"+seed]._x = prev_x+prev_w+dist;
path.thumbs["loadingBarBox"+seed].lineStyle(.25, 0x999999, 100);
path.thumbs["loadingBarBox"+seed].moveTo(0, h);
path.thumbs["loadingBarBox"+seed].lineTo(w, h);
path.thumbs["loadingBarBox"+seed].lineTo(w, h-lbH);
path.thumbs["loadingBarBox"+seed].lineTo(0, h-lbH);
path.thumbs["loadingBarBox"+seed].lineTo(0, h);
path.thumbs.createEmptyMovieClip("loadingBar"+seed, maxSeed+seed);
path.thumbs["loadingBar"+seed]._xscale = 0;
path.thumbs["loadingBar"+seed]._x = prev_x+prev_w+dist;
path.thumbs["loadingBar"+seed].lineStyle(.25, 0x999999, 0);
path.thumbs["loadingBar"+seed].beginFill(0x999999, 100);
path.thumbs["loadingBar"+seed].moveTo(0, h);
path.thumbs["loadingBar"+seed].lineTo(w, h);
path.thumbs["loadingBar"+seed].lineTo(w, h-lbH);
path.thumbs["loadingBar"+seed].lineTo(0, h-lbH);
path.thumbs["loadingBar"+seed].lineTo(0, h);
path.thumbs["loadingBar"+seed].endFill();
}
function loadingBarRun(txtStyle) {
path.thumbs.byteL = path.thumbs["thumb"+seed].getBytesLoaded();
path.thumbs["loadingBar"+seed]._xscale = (path.thumbs.byteL/path.thumbs["thumb"+seed].getBytesTotal())*100;
loadingTxt(txtStyle);
path.totalLB._xscale = (seed/maxSeed)*100;
}
function removeBars() {
path.thumbs["loadingBar"+seed].removeMovieClip();
path.thumbs["loadingBarBox"+seed].removeMovieClip();
if (path.totalLB._alpha<0) {
path.totalLB.removeMovieClip();
path.totalLBB.removeMovieClip();
}
}
//
// Thumbnail loading progress functions
//
function howManyNails(txtStyle, jpgLoadTxt, txtXPos, txtYPos, fontName, txtSize, txtClr, bdr, bdrClr, html, bold, italic) {
path.createTextField(jpgLoadTxt, maxSeed, txtXPos, txtYPos, 200, 10);
path[jpgLoadTxt].autosize = true;
path[jpgLoadTxt].html = html;
path[jpgLoadTxt].type = "dynamic";
path[jpgLoadTxt].wordWrap = true;
path[jpgLoadTxt].selectable = false;
textFormat = new TextFormat();
textFormat.font = fontName;
textFormat.size = txtSize;
textFormat.color = "0x"+txtClr;
textFormat.bold = bold;
textFormat.italic = italic;
path[jpgLoadTxt].setNewTextFormat(textFormat);
loadingTxt(txtStyle);
xWidth = path[jpgLoadTxt].textWidth+10;
yHeight = path[jpgLoadTxt].textHeight/2;
path.createEmptyMovieClip("totalLBB", maxSeed+4);
path.totalLBB._x = xWidth;
path.totalLBB._y = txtYPos;
path.totalLBB.lineStyle(.25, 0x999999, 100);
path.totalLBB.moveTo(0, yHeight);
path.totalLBB.lineTo(60, yHeight);
path.totalLBB.lineTo(60, yHeight+(yHeight/2));
path.totalLBB.lineTo(0, yHeight+(yHeight/2));
path.totalLBB.lineTo(0, yHeight);
path.createEmptyMovieClip("totalLB", maxSeed+3);
path.totalLB._x = xWidth;
path.totalLB._y = txtYPos;
path.totalLB.lineStyle(.25, 0x999999, 0);
path.totalLB.beginFill(0x999999, 100);
path.totalLB.moveTo(0, yHeight);
path.totalLB.lineTo(60, yHeight);
path.totalLB.lineTo(60, yHeight+(yHeight/2));
path.totalLB.lineTo(0, yHeight+(yHeight/2));
path.totalLB.lineTo(0, yHeight);
path.totalLB.endFill();
path.totalLB._xscale = 0;
}
function loadingTxt(txtStyle) {
if (txtStyle == 1) {
path[jpgLoadTxt].text = maxSeed-seed+" thumbnails left to load. ";
} else if (txtStyle == 2) {
path[jpgLoadTxt].text = seed+" out of "+maxSeed+" thumbnails have loaded. ";
} else if (txtStyle == 3) {
if (maxSeed<10) {
addSpace = " ";
} else if (maxSeed<100) {
addSpace = " ";
} else if (maxSeed<1000) {
addSpace = " ";
}
path[jpgLoadTxt].text = " "+seed+" / "+maxSeed+addSpace;
} else if (txtStyle == 4) {
path[jpgLoadTxt].text = "There are "+(maxSeed-seed)+" more thumbnails to load. ";
}
}
//
// Main image box, loading, progress, positioning and size control functions
//
function imageBox(boxHeight, imageY, boxCentred) {
path.createEmptyMovieClip("imageStuff", -10);
if (boxCentred == true) {
_global.imageX = imageX=((Stage.width/2)-(boxWidth/2));
}
path.imageStuff.createEmptyMovieClip("imageBox", -10);
path.imageStuff.imageBox._x = -thumbX;
path.imageStuff.imageBox._y = -thumbY;
path.imageStuff.imageBox.lineStyle(.25, 0x999999, 100);
path.imageStuff.imageBox.beginFill(0xffffff, 100);
path.imageStuff.imageBox.moveTo(imageX, imageY);
path.imageStuff.imageBox.lineTo(imageX+boxWidth, imageY);
path.imageStuff.imageBox.lineTo(imageX+boxWidth, imageY+boxHeight);
path.imageStuff.imageBox.lineTo(imageX, imageY+boxHeight);
path.imageStuff.imageBox.lineTo(imageX, imageY);
path.imageStuff.imageBox.endFill();
path.imageStuff.createEmptyMovieClip("image", -9);
path.imageStuff.image._x = -thumbX+imageX;
path.imageStuff.image._y = -thumbY+imageY;
}
function imageLoad() {
path.imageStuff.image._alpha = 0;
path.imageStuff.image.loadMovie(trgtImage+path.iLoadNumber+format+"?nocache="+getDate(), 1);
}
function imageProgressBar() {
barWidth = boxWidth/2;
barHeight = barWidth/30;
if (barHeight<5) {
barHeight = 5;
}
path.imageStuff.createEmptyMovieClip("imageLoadingBarBox", maxSeed+2);
path.imageStuff.imageLoadingBarBox.lineStyle(.25, 0x999999, 100);
path.imageStuff.imageLoadingBarBox.moveTo(0, 0);
path.imageStuff.imageLoadingBarBox.lineTo(barWidth, 0);
path.imageStuff.imageLoadingBarBox.lineTo(barWidth, barHeight);
path.imageStuff.imageLoadingBarBox.lineTo(0, barHeight);
path.imageStuff.imageLoadingBarBox.lineTo(0, 0);
path.imageStuff.createEmptyMovieClip("imageLoadingBar", maxSeed+1);
path.imageStuff.imageLoadingBar.lineStyle(.25, 0x999999, 0);
path.imageStuff.imageLoadingBar.beginFill(0x666666, 100);
path.imageStuff.imageLoadingBar.moveTo(0, 0);
path.imageStuff.imageLoadingBar.lineTo(barWidth, 0);
path.imageStuff.imageLoadingBar.lineTo(barWidth, barHeight);
path.imageStuff.imageLoadingBar.lineTo(0, barHeight);
path.imageStuff.imageLoadingBar.lineTo(0, 0);
path.imageStuff.imageLoadingBar.endFill();
path.imageStuff.imageLoadingBar._xscale = 0;
path.imageStuff.imageLoadingBarBox._x = path.imageStuff.imageLoadingBar._x=-thumbX+imageX+boxWidth/4;
path.imageStuff.imageLoadingBarBox._y = path.imageStuff.imageLoadingBar._y=-thumbY+imageY+(2*path.imageStuff.imageBox._height/3);
}
function imageProgressBarRun() {
path.imageStuff.imageLoadingBar._xscale = (path.imageStuff.image.getBytesLoaded()/path.imageStuff.image.getBytesTotal())*100;
}
function removeImageBar() {
if (path.imageStuff.imageLoadingBar._xscale>=100) {
path.imageStuff.imageLoadingBar.removeMovieClip();
path.imageStuff.imageLoadingBarBox.removeMovieClip();
}
}
function imageCentre() {
if (imageCentred == true && path.imageStuff.image._width>0) {
if (r1 != true) {
pIX = path.imageStuff.image._x;
pIY = path.imageStuff.image._y;
r1 = true;
}
path.imageStuff.image._x = pIX+(path.imageStuff.imageBox._width-path.imageStuff.image._width)/2;
path.imageStuff.image._y = pIY+(path.imageStuff.imageBox._height-path.imageStuff.image._height)/2;
}
}
function imageSquash() {
if (path.imageStuff.image._width>path.imageStuff.imageBox._width && path.imageStuff.image._height<path.imageStuff.imageBox._height && path.imageStuff.image._width>0) {
path.imageStuff.image._xscale = (path.imageStuff.imageBox._width/path.imageStuff.image._width)*100;
path.imageStuff.image._yscale = path.imageStuff.image._xscale;
} else if (path.imageStuff.image._height>path.imageStuff.imageBox._height && path.imageStuff.image._width<path.imageStuff.imageBox._width && path.imageStuff.image._width>0) {
path.imageStuff.image._yscale = (path.imageStuff.imageBox._height/path.imageStuff.image._height)*100;
path.imageStuff.image._xscale = path.imageStuff.image._yscale;
} else if (path.imageStuff.image._height>path.imageStuff.imageBox._height && path.imageStuff.image._width>path.imageStuff.imageBox._width && path.imageStuff.image._width>0) {
xS = (path.imageStuff.imageBox._width/path.imageStuff.image._width)*100;
yS = (path.imageStuff.imageBox._height/path.imageStuff.image._height)*100;
if (xS<yS) {
path.imageStuff.image._xscale = path.imageStuff.image._yscale=xS;
} else if (xS>yS) {
path.imageStuff.image._xscale = path.imageStuff.image._yscale=yS;
}
}
}
function squashReset() {
path.imageStuff.image._xscale = path.imageStuff.image._yscale=100;
}
//
// Image selection functions
//
function Release() {
if (path.iLoadNumber != this.iNumber) {
this.b = true;
path.iLoadNumber = this.iNumber;
squashReset();
imageLoad();
imageProgressBar();
}
}
function ReleaseOutside() {
this.b = false;
}
function EnterFrame() {
if (this.runOnce != true) {
this.iNumber = seed;
this.runOnce = true;
}
if (this.b == true) {
this.blink();
}
}
MovieClip.prototype.blink = function() {
(this.blinkTimer == null) ? this.blinkTimer=getTimer()+40 : null;
if (getTimer()>=this.blinkTimer) {
this.times += 0.5;
if (this.times == .5 || this.times == 1.5) {
this._alpha = 30;
} else if (this.times == 1 || this.times == 2) {
this._alpha = 100;
}
this.blinkTimer = null;
}
if (this.times>=2) {
this._alpha = 100;
this.blinkTimer = null;
this.b = false;
this.times = 0;
}
};
//
//
//usage
//
//
_root.createEmptyMovieClip("empty", 1);
photoGallery(_root.empty/*path*/, "thumbnails/DCP_"/*target*/, 1/*seed*/, 15/*maxSeed*/, ".jpg"/*format*/, 10/*fIn*/, 254/*thumbX*/, Stage.height-100/*thumbY*/, false/*thumbOutline*/, 80/*maskHeight*/, 15/*arrowSize*/, 10/*scrollSpeed*/, 50/*w*/, 10/*h*/, 3/*lBh*/, 5/*dist*/, jpgCount/*jpgLoadTxt*/, 0/*txtXPos*/, -20/*txtYPos*/, 2/*txtStyle*/, "Arial"/*fontName*/, 11/*txtSize*/, 999999/*txtClr*/, false/*html*/, false/*bold*/, false/*italic*/, 300/*boxWidth*/, 300/*boxHeight*/, 0/*imageX*/, 50/*imageY*/, true/*boxCentred*/, true/*imageCentred*/, "images/DCP_"/*trgtImage*/);
//
//
//
// This prototype assumes that the thumbnails and images are labeled in a consecutive order
// for example, the thumbnails go th_1, th_2, th_3 etc and the corresponding pictures have to
// go im_1, im_2, im_3 etc etc.
//
// Explaination of variables below:
// path is the target path to the empty mc that the gallery will load into.
// trgt is the directory to the thumbnails including the name beginner (ie thumbnails/DCP_45, the trgt = thumbnails/DCP_)
// seed is the begining thumnail that you want to load.
// maxSeed is the final image in the series, or the final image that you want loaded in.
// format is either ".jpg" or ".png" depending on the type of file you are using.
// fIn is the fading in and out rate of the thumbails and other stuff.
// thumbX is the starting x position of the thumbnails.
// thumbY is the starting y position of the thumbnails.
// thumbOutline is either true or false depending on if you want a border around the thumbnail scroller.
// maskHeight is the height of the mask that hides the other thumbs in the scroller.
// arrowSize is the size of the arrows in the scroller.
// scrollSpeed is the rate in which you can scroll through the thumbs.
// w is the width of the thumbnail loading bar.
// h is the y position of the thumbnail loading bar.
// lbH is the height of the thumbnail loading bar.
// dist is the distance apart you want the thumnails from each other.
// jpgLoadTxt is what you want to name the created txt box ( in " " ) to see how many thumbs are left to load.
// txtXPos is the x position of the how many left to load txt box.
// txtYPos is the y position of the how many left to load txt box.
// txtStyle is the syle in which you will count down the loading thumbnails ( 1,2,3,4 ) .
// // // 1 = 241 thumbnails left to load.
// // // 2 = 9 out of 250 thumbnails have loaded.
// // // 3 = 9 / 250
// // // 4 = There are 241 more thumnails left to load.
// fontName is the name of the system font you want to use for the how many left to load txt box ( ie "Arial").
// txtSize is the size of the font for the how many left to load txt box.
// txtClr is the text colour of the how many left to load txt box ( in hex form, ie for white FFFFFF ).
// html is true or false depending if you want the html format switched on or of for the how many left to load txt box.
// bold is true or false for the how many left to load txt box.
// italic is true or false for the how many left to load txt box.
// boxWidth is the width of the image box.
// boxHeight is the height of the image box.
// imageX is the x position of the image box.
// imageY is the y position of the image box.
// boxCentred is true or false depending on if you want the image box centred to the stage along the x-axis. If true, it overides imageX but not imageY.
// imageCentred is true or false depending if you want to centre the loaded photo to the middle of the image box.
// trgtImage is the target directory that you images are stored in including the name beginner (ie images/DCP_45, the trgtImage = images/DCP_)
//
// That's about all i can be arsed to explain. It is a long code and it is my first major piece of programming so although I think it's top notch
// I'm sure it could be narrowed down somewhat. If you have any additions or changes to the script please post them, it'll be great feedback
// for me.
//
// ta ta
// buggedcom
// (aka OliverLillie)
//



enjoy it if you use it, it took a lot of blood sweat and tears
[Edited by buggedcom on 09-19-2002 at 10:59 AM]

I Finally Finished My New Website Design
Here: www.kocompany.com

check it out and tell me what you think.
don't forget to check out everything.

Finally; First Flash Website Finally Done
Hey Guys... just wanted to let you know after all this time..

I finally finished a huge flash project, and I just finished it. Got the approval and now it is live.
This is my first flash website I've created and it turned out very good from what everyone is telling me. I think I did a pretty good job for a first time. Can't wait to start my next flash website now.

WOO HOO! Finally

Thanks again guys for all the help in these forums, and helping me get thru this.

Here is the website I am referring too.
http://www.3vmedia.com

YES Ive Finally Done It
iv finally created my website!!!!!!! woohoo!!!!!!!!
http://www.geocities.com/ilikezelda2
(P.S i know the email link doesnt work yet!)

Here It Is Finally
I can't get everything to work the same way...you'll see once you download it.

I Finally Got It
some of you may remember a post i made several times a while back about getting a movie clip to play both forwards and backwards infinately. this is for a virtual tour that i'm doing with panoramic views that are in mpg format so i need the user to feel like they are spinning around in the room (no i dont have quick time vr) so the movie needed to play in both directions without skipping or stopping at the end.

i finally got it!
an awesome guy on http://www.friendsofed.com 's forums for flash named Pickles23 helped me out with this one. i implemented his solution and got it to work.

here's the file if anyone is interested or ever has a need to make a panoramic view.

Something Cool From Me, Finally?
Well, my client has been bugging me because his site-in-progress won't open properly on various resolutions, so I wrote a little thing as an intro that might be neat for some people. I know that usually browser sniffing is automatic and behind the scenes, but for someone like me, who rarely maximizes a browser, I opted for a more visual and 'choice driven' approach. One of the books I bought introduced me to MX's ability to state the size of the window, and I just went from there.

If you look at the swf, resize your browser to the dimensions someone with a 640x480 display might have, an 800x600, and anything over that (i.e., 1024x768 and over). It automatically tells you what size your browser is at (not your resolution per se, if you consider the fact that you may be browsing with a window that's only 3/4s of maximum for your resolution); it also gives you a recommendation as to what size to open the new window to launch the page at.

For me, this means, if you've typed the address in from a window sized as you'd normally size it, even if you are at a 1024x768 display, but like small windows, then you will be prompted to open the site at a size similar to that.

I don't know if it's of value to anyone or not, but I'm ALWAYS the one asking questions, and this time I did something cool myself. I hope it's not just me.

I've included the .fla as well.

I really just want feedback, since it's so simple, but I'm still proud for some reason.

My browser res numbers in the if statements may be off a bit, but I haven't played with that part yet, just got home


http://members.rogers.com/sgphoto/index.html

http://members.rogers.com/sgphoto/index.fla


Shawn

On The Path Finally
Okay Im making some progress finally. However when I teset it never plays the preloader animation, even when I Show Streaming.

Heres what I have

Frame 1

stop();
loadMovie("pre.swf","mc_holder1");

onClipEvent (enterFrame){
framesLoaded = Math.ceil ((_parent.getBytesLoaded() / _parent.getBytesTotal()) *100);
gotoAndStop (framesLoaded);
info.text = framesLoaded + "% completed";
if (framesLoaded >= 100) {
_root.gotoAndPlay(2);
}
}

Frame 2

stop();
loadMovie("intro.swf","mc_holder1");

onClipEvent (enterFrame){
framesLoaded = Math.ceil ((_parent.getBytesLoaded() / _parent.getBytesTotal()) *100);
gotoAndStop (framesLoaded);
info.text = framesLoaded + "% completed";
if (framesLoaded >= 100) {
_root.gotoAndPlay(3);
}

Frame 3

stop();
loadMovie("menu.swf","mc_holder1");

Finally, A Test ...
Hi all,

I finally had a chance to mock up what I am having problems with. The attached is an archive of the fla file. Note, I have 3 buttons, the first 2 are supposed to link to 2 separate scenes (destination 1 and destination 2) As you will see, they both go to destination 2, but nevertheless the transition proceeds in the manner I desire - they finish playing scene1 and go to another scene.

The 3rd button (product development) uses labels and roots as previously suggested and still does not work.

Any suggestions?

THANKS!

Can Someone Finally Explain This ?
no one has really given me a good answer or posted a helpful fla. Basically if you go to any of these sites:

especially this one:
http://www.unfortunateeventsmovie.com/intro.html
(animated RASTER preloader)

http://troymovie.warnerbros.com/
(raster image in preloader)

http://avp-movie.com/
(large raster images in background)

and finally sincity movie website has a preloader between scenes that's a raster gun and animated.

HOW do all these preloaders show up 1%-100% ??? when I put just a raster image in the background my preloader shows up at 40%+, and NO I don't have any linkage or music/mp3 streaming and I even do it in a separate scene that will go to next scene when preloader is done.
would be great if someone could post a similar preloader to the unfortunateevents website - at least a raster that's animated and shows the preloader going from 1-100..

Finally Upload From Php To XML To SWF :)
hi all i try alot to upload from php to XML to SWF

i write a php file to export the urls of my vcard script then i write in flash this code


Code:

var theXML:XML = new XML();
theXML.ignoreWhite = true;

theXML.onLoad = function() {
var nodes = this.firstChild.childNodes;

myLoad0.contentPath =nodes[0].firstChild.nodeValue;
myLoad1.contentPath =nodes[1].firstChild.nodeValue;
myLoad2.contentPath =nodes[2].firstChild.nodeValue;
}

theXML.load("http://3afooor.com/filename.php");
but i confused when i want to write the for loop to the loaders i have

i put 3 loaders in the page give them instance names then manually assign the nodes of XML for them

so hoe will be the for loop

this is the final swf file after uploading the images from the DB

http://3afooor.com/php/fainally1.swf

also i dont know why the loding is not work but it is not important at this time


the toturial is in the gotoandlearn website which is very strong site

thx alot again and i am waitting u

Finally Flash SEO
I've been working on Flash's "flaws" for 5 years and why they were causing SEO problems. Finally I've found a way to fix them all. Today I received my proof from Google and Aol that my techniques worked!

First problem the dreaded back button. I've taken this script from free scripts on the web and floating around. I molded it to fit my style and my technique. My sites now use the browser history to go back through and all flash website. This was a major SEO problem before because some search engines wouldn't give you any position if you couldn't use the back button.

Second problem, the detection system. The older flash detection systems would take you back through the flash detection system with one click. Google gave you 0 rank if your site did this. With the new detection system and swfObject.js we don't deal with that anymore. Also the click to activate is gone, ahh nice!

Third problem, deep linking. This works now as a bonus to the back button. I can link to my site's portfolio page by sending this link out, Ohio Web Design
Again this is an all flash site embedded into one html page.

Fourth and biggest problem, SEO in general, no content to crawl. Well using the swfObject technique your html alternate content gets replaced with the Flash file if the Flash detection is passed. Why is this important? Google doesn't follow the javascript files to load your flash content so they use your alternate html content to rank your site. Of course you can cheat with this and just place any old content in your alternate content. But be aware this is a black hat technique and you will get caught and banned from google. I asked on their webmaster forums and was answer by google employees themselves. You must make sure that your alternate content is very similar to your content in your site.

My proof? Last week I finished adjusting my alternate content and resubmitted my site to Google. Before this I had 0 ranking on any search engine. You could only find me by typing richardson graphics in the search engine. Because web design is such a large field my keywords were carefully selected so that the competition is a smaller group. Any seo company will tell you to narrow your market and you'll get better results. I did mine keywords for Ohio Flash Website Design. This search is done on average of 1000 times a month, which is way more than my small company can handle. I'm on page 1 for 14 different keyword combinations of my main 7 keywords. Aol also picked me up and I have just as much rank with them.

Google's biggest ranker is links, I have 0 links with google. Check marketleap.com and you'll see, I only have 4 total. Now I will be building my links so I can move up the rankings in broader categories like flash web design.

Thanks to all of those who have every contributed any code to helping Flash become equal or better than html... the day has arrived where I can stop losing jobs when being compared to html.

I Finally Upgraded
For those of you coaxing me to upgrade to mx 2004, well..
I did it today. Its official. Ive been assimilated.

Finally Its Working But...Plz Help Me.
Hi!I finally got my code working.
Here is what I did:

on the preloader scene I put this code on the first frame:

soundurl1 = "plastic.mp3";
mySound = new Sound();
mySound.onLoad = function(success){
if(success){
this.start(0, 999);
}
}
soundurl2 = "daygoby.mp3";
mySound = new Sound();
mySound.onLoad = function(success){
if(success){
this.start(0, 999);
}
}

and on my main scene I called up this function on the first frame and on the buttons I use to play the songs.

Now both my preloader and my songs works but the songs take a little while to start.is there any way to complete load the songs on the preloader scene or animation so when it comes to the main scene the songs are loaded and it starts playing immediatly?
because I have a MC thaT is a woman dancing and she starts to dance whithout music.

or how would I check if the mp3 file was loaded so I could show the user the song was being loaded.

thx

Preloader Finally Working, But....
thanx to everyone for the help so far. i finally got a preloader working, however, it looks like is preloads, but must not load enough of the movie or something...here's a link to see what i mean.
pleeeeeeeeeeeeeeeeeeeeeeeeeeeez. -dahui

www.focusomr.com/trustedadvisor

//frame 1(loop)

ifFrameLoaded ("end") {
gotoAndPlay ("start");
}
-----------------------------

//frame 2 (cont. loop)
gotoAndPlay (1);

Finally Got It To Work(here's The Script)
After many headaches, it works perfectly now. This menu will scroll, right or left, slower or faster, depending on where your mouse is positioned. AND it WILL NOT scroll off the screen. THE SCRIPT is SIMPLE!

_root.onEnterFrame = function() {
myMovieClip._x = myMovieClip._x+(0.5*Stage.width-_xmouse)/10
}
if(myMovieClip <= -550) {myMovieClip = -550}
if(myMovieClip >= 550) {myMovieClip = 550}

the numbers in the "if" statement determine where the scrolling will stop.
You will have to play with those numbers to get it exactly where you want it depending on the width of you Clip or where on the stage you want it to stop.
Otherwise it works!!!!

Finally My Photography Website
hi all hope u like it

http://majedali.com

any comments

Try, Catch, Finally Statements
Dear all,

I read senocular article about the use of try, catch and finally statements and finally I understood their use (thanks senocular). However, I doubt came out, If a have a preloader using those statements in the COMPLETE event function (Event.COMPLETE), it is not necessary to have a specific function for handle errors (for example IOErrorEvent.IO_ERROR)? Or the idea behind to have a specific function for handle errors is, it will capture all the errors and “catch” statement only those I declare?

I hope, I explained myself well.

Thanks

Finally, Hardware Acceleration?
I'm not necessarily encouraging it, but I've got some interest in the latest beta version of the Flash player. (Here's the link to download the browser plug-in.) The press release (again, link) mentions some neat stuff:
A strengthened connection to JS through the ExternalInterface API
Vector graphics acceleration for multi-core machines
"Hardware scaling" in full-screen mode, "for improved video performance and quality"

What, pray tell, does "hardware scaling" mean? It sounds like it could be a feature limited to video in full-screen mode. But do you think it could pave the way for hardware acceleration?

Flex I Finally Get To Be The One Asking The Question...
Of course, this is NOT my first time posting something only to look like a total moron with a decent post count, but I recently made a discovery and a decision.

As plenty here know, I'm an adamant Linux user. I HATE windows, and prefer not to use a Mac if I can put Linux on it. There was only one problem with that: My equally adamant love for programming flash. So, I have a windows box with Flash CS3 on it, and that's how I code.

Well, today, someone pointed me to a WORKING tutorial to get flash on Linux. I already knew that I COOOUUULLD emulate CS3 through wine, but I wasn't willing. So I did this, literally just now, and viola! Except... it's Flex. I'm used to Flash.

I'm used to a document class. I'm used to frames. I'm used to a lot of import statements and crazy packages importing eachother. I'm also used to trace().
Flex doesn't work quite the same way. It's still AS3, but... it's new to me. Can someone point me off in the right direction to how I need change my programming and structure philosophy to be a Flex user? (I'm very well versed in XML, namespaces, etc, so the mxml isn't baffling me, I just don't know what all the elements are).
I also would like to know what I do to see trace output. I've been playing with it for about 5 minutes now, and haven't figured out a single thin gother than the <mx:Script/> tag for directly putting AS3 into the mxml file.

Fractal4D Finally Released
Get the release here! http://mattkenefick.com/blog/2008/11...first-release/


Originally mentioned in this thread as a concept: http://www.kirupa.com/forum/showthread.php?t=312712

All Flash Forum Finally Found It Again
Here it is, I knew I seen one and it looks very proffesional. The one at www.flash-db.com wasnt that good.

Here's the link guys, I know I wasnt the only one searching, lol.

http://www.phpforflash.com

Finally Stopped Pulling My Hair Out
Finally....a solution to my frustrating problem with scrolling a dynamic text box. And of course, (even more frustrating) is how simple the solution was.

I thought that posting the solution may help out someone else experiencing trouble with a similar issue.

Thanks to kslakait at ActionScript.org for helping out.

gave the dynamic text box an instance name of:
code: ttt

I accessed this instance via: code: _parent.ttt

and changed scroll properties for each button:

code:
//attached to scroll up button
on (press) {
_parent.ttt.scroll -= 1;
}

//attached to scroll down button
on (press) {
_parent.ttt.scroll += 1;
}


and TA DAAA!!! when you click the up or down arrows, the text scrolls!!! (note: the slide bar doesn't scroll the text, i just removed it from my file)

so there you go.

Astro, I Finally Got The File Shrunk
Thank you for your efforts.

I have managed to remove graphics and all other extraneous stuff and WinZipped (v.9.0)it using Maximum Enhanced Deflate.

I won't have access to the internet until Friday. See you then.
...and thanks again!

Michael

Finally Upgrading Flash From 4.0, But Have A Few Questions First.
Hi. I've been running Flash 4.0 since it came out... I got the 5.0 upgrade, but for some reason I've just been so comfortable with 4 that I've just stayed using that forever and haven't really looked to upgrade (I've been able to do everything I've ever been able to think up in 4, so I just haven't bothered to upgrade... it if ain't broke, don't fix it ). But now, I recently got a job with a production studio and they told me that they really really REALLY want me to learn the latest version so I can start doing some crazy things with them. I'm open minded, so I'm going to upgrade and get started learning all the new stuff. I just had a few questions to ask you guys before I get started.

- I basically learned flash 4.0 from the Flash Bible by Reinhardt & Lentz. I'm sure that there's one for the newest version, and was just wondering if it would be a good idea to pick up to help me re-learn everything I've missed out on in the past few updates.

- Have they made it easier to incorporate scroll bars by any chance?

- One thing I have no idea how to do in 4.0 would be making something like a DVD menu... can you do this in the most recent version by any chance? (that'd be sweet )

If there's anything awesome about the latest Flash version that you think is super-sexy and I should immediately check out upon upgrade, please let me know... time to stop being behind the times!

-Chris

Woohoo Emoticons Finally Easy In AS3
I don't normally make spontaneous jubilant posts (especially about AS3, heh) but I have to say I just stumbled upon all the new advanced text metric functions added in AS3, and I'm stoked. I have had to make elaborate, accurate emoticon renderers twice in the past, and they were hundreds of lines of code and still not quite perfect.

In AS3? What took most of the code before is now one line -- just grab the coordinates of an emoticon string token via TextField.getCharBoundaries, and plop your graphic there.

A rough sample thrown together, 28 lines of code:
http://abeall.com/files/flash/tests/.../emoticons.swf
http://abeall.com/files/flash/tests/.../emoticons.fla

Woohoo! Even with all the text styles changes, the positioning is perfect. One thing that AS3 makes a lot simpler.

Finally A Solution To All Your Firewall Problems
I finally have answer to all of you who are seeking this question.


When the Flash Player encounters the connect() method, it attempts to connect to your FCS following a very specific pattern. It first attmpts to connect over port 1935, then port 433, then port 80 and then it automatically attempts to tunnel through by sending rtmp data over http also called RTMPT it turns out the automatic sequence of attempts is fine for many situations however you may find some users can't make a connection (well , the NetConnection can't) because their firewall blocks data from traveling through port 1935. If those users can connect to any website surely they can use port 80 .And even if their setup blocks rtmp surely they can use RTMPT over port 80 because its really just plain http ...you might think the final attempt by flash player RTMPT on port 80 to be failsafe however the problem is that if you are running your webserver on the same machine as FMS then they can't both use port 80 at the same time....a perfectly legitimate solution is to use to computers one for the webserver and one for FMS ......two computers probably means you need to specify the domain in your rtmp (rtmp://mydomain.com/video).

To force the flash player to try to connect through a specific port other than the defaults as specified above.....write rtmp as ....my_nc.connect("rtmp::8500/mydomain.com/video);

FlashMX2004 by Phillip Kerman

I Finally Got A .html To Load Into A Textfield
I have an external HTML file that I got to load into a text area component, which has the instance name of myTextField. However, I have a couple of perfection problems. Further, I am in great need of consulting.

(1) The text does not format 100% properly.

(2) Why is my text editable? Why can you delete, type, and backspace on it?

(3) Do I need to load a .css file too- How do I load a .css file in conjunction with this?

Can someone please take a look at my attached code?









Attach Code

function textLoadComplete(event:Event):void
{
myTextField.htmlText = textLoader.data;
}

var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest("externalhtmlfile.html");

textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoadComplete);

























Edited: 08/05/2008 at 08:25:52 PM by jntSpecialty

Text Flow Component Being Released (finally)
Keep an eye out for a new component being released on the Macromedia Exchange and on FlashComponents.net -- the component is called the TextFlow component and can be used to flow text around buttons, movie clips and text fields. In addition, text will flow between textFlow components and will work with both static and dynamic text.

For an example, go to www.architekture.com/example_textflow.html

We're quite excited about this component because we've been able to use it to do some pretty phenomenal layouts (if you go to www.architekture.com and browse around, every single screen that you see is using this component in varying ways, and all of the content on our site is database-driven).

We'd love to find a highly visible place to publish articles on how to maximize use of this component -- let me know if you know of any individuals to contact.

Also, we'd love to help other companies actually deploy this type of content-publishing technologies, so please contact me directly if you have a client that would be interested in powerful dynamic type layouts. (720) 236-3650

Thanks a lot and I hope that everyone enjoys the component!

RollOver/RollOut Finally Solved, But Still One Problem.
Ok, for a long time i've been trying to get an MC to work so that on rollOver the mc plays, and on RollOut it plays in reverse. I *finally* got it to work using blank MCs with gotoAndPlay (NextFrame) and (prevFrame) commands, but there is one slight problem.

Since i have to put a stop command on the first frame of the mc so that it doesnt start playing as soon as the movie starts, the first time you roll over it only moves one frame, but anytime you do it after that the animation works perfectly. I'm pretty sure it's because it has to get over that initial stop command but i can't figure out a way to get around this. if anyone could help me out with this i'd really appreciate it.

I'll try to attach the .fla but i havnt had a lot of luck with that in the past....

Help With Finally Solving Problem Of Sticking Rollovers
Hello,

I am working on my online portfolio and would like to have an animated menu that works similarly to Metadesign's old site. Simply put, there are three items on the stage, and as one rolls over an item the other items move to create space in which details about the item that has been rolled over are revealed. My problem is that if a viewer to the site moves his/her mouse over one of the items a little quickly, the menu sticks on the "rollover" part.

I have looked for solutions to this problem for a couple of years, and have changed designs on previous projects as my knowledge of Flash Actionscript is not that advanced, but I have finally decided that I would like to overcome this issue. I have found a number of different possible solution here and elsewhere, but they seemed pretty advanced and I couldn't figure out how to implement them into my own project.

Therefore, it is my hope that some kind soul here could guide me in the direction I need to go, or be generous enough to even help me out with my .fla, which I have included below.

Thanks,

Bill

Finally Released My Game, But I Need Your Help With Coding Stuff
Ok so i released my game today, you can play it at Geopersia.com
Well if you see the game you can tell its a tile game, but there is one big problem and its the depth one, i am using duplicateMovieClip() i am incrementing the new movie clip by 1 and its depth by _root.getNextHighestDepth(), so i have been trying every form of hitTest() to try to figure out a way so that the tiles cant go under/over each other, i want it to look 2D...

there are almost an infinite possibilities of tiles, all with different names and everything, what should i do?

I dont think there is an answer to this but if you can help i would greatly appreciate it.

p.s. also snapping objects would be great, but i think thats really impossible with how this game is set up.

p.s.s i also have used sharedObjects but i have no idea on how to use it with duplicateMovieClip, but i do have an idea can i save the whole picture using sharedObjects and the person can load that picture

like it saves everything in a shared object i think there is a exportBitmap something like that. Saving is one of the biggest parts of my game

Finally I Solved Tweening Problems...but I Got An Error...
Hi people,
have you ever declared many tweenings by scripting? Have you ever had any problems? I did that and I see that many times, final positions of those tweenings are wrong!
I surfed the net and I found the reason! AS3 garbage collector! I also found the solution:

Package code:

Code:

package myClasses{
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import flash.utils.Dictionary;

public class AntiGC
{
private static var _instance:AntiGC;
private static var _allowInstantiation:Boolean;
private var dict:Dictionary;

public static function getInstance():AntiGC{
if(_instance == null)
{
_allowInstantiation = true;
_instance = new AntiGC();
_allowInstantiation = false;
}
return _instance;
}

public function AntiGC(){
if(!_allowInstantiation) {
throw new Error("Error: Use AntiGC.getInstance() instead of new.");
} else {
dict = new Dictionary();
}
}

function addElement(e:Tween){
dict[e] = e;
e.addEventListener(TweenEvent.MOTION_FINISH, this.tweenFinished);
}

function tweenFinished(e:TweenEvent){
dict[e.currentTarget] = null; //GC Object
delete dict[e.currentTarget]; //GC Key
}
}
}
Stage Code:

Code:
import myClasses.AntiGC;

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

var aGC:AntiGC = AntiGC.getInstance();
aGC.addElement(new Tween(target, "y", None.easeOut, target.y, target.y+50, 10));
I tried the recall code inside an another external package instead than the stage and it works really good...
The problem is when I try it onto the stage... the error occoured is:
"trying to access a not acessible method addElement with static AntiGC"
Which is my problem??? The code is the same of the package one...
Please HELP MEEEE

Finally Learning Flash.. Pft. No Actions For Button?
Yes. I've finally decided to learn Flash.


ok, well I started off with the shine tutorial, so, I did a bit of fooling and now I want a play button.

Problem is... what the HELL happened to Right Click -> Actions ???
It won't let me add actions (which happens to be GoToAndPlay) to zat button!

FINALLY: Transparent Tree Or List - Solved
Hi All
I'm puzzling with this for a while and now I finally reached a solution!
To make the Tree or List background transparent use the following code:

mx.controls.treeclasses.TreeRow.prototype.drawRowFill = mx.controls.listclasses.SelectableRow.prototype.drawRowFill = function (mc:MovieClip, newClr:Number) {
//Author: Marcelo Quinan <marcelo@aretha.com.br> - http://www.aretha.com.br
//You can freely use this code, but please don't remove the credits. Thanks!
//This code set the list and tree components bg's to transparent. Put it before populating the components
switch (mc._name) {
case "bG_mc" :
//Alpha when the row is not selected
var tempAlpha = 0;
break;
case "tran_mc" :
//Alpha when the row is selected
var tempAlpha = 25;
break;
default :
var tempAlpha = 100;
}
mc.clear();
//Here's the trick:
mc.beginFill(newClr, tempAlpha);
mc.drawRect(1, 0, this.__width, this.__height);
mc.endFill();
mc._width = this.__width;
mc._height = this.__height;
//Hide the main bg of component
this._parent._parent.depthChild0._alpha = 0;
};

Hope this helps!
Marcelo Quinan

Drawzit.com Finally Ready For Public Viewing
Hello all!

After a ton of development time my latest flash RIA is ready for public viewing. Its written in AS3 and comprised of 46 classes. Be nice, its still in its alpha version and there are bugs I am working on, but it is fully functional. Let me know what you think.

www.drawzit.com

Also I wanted to thank the flash community as a whole. There is a wealth of knowledge out there to learn from. Thank you all!

~squirt

My First Post Ever On Kirupa (finally)...please Be Nice (AS3 Question)
Hi everyone, I've browsed this site off and on for quite a while and finally making what I believe is my first post (unless i'm forgetting).

I've searched and searched and googled before finally deciding to pose this question, but I just can't figure this out.

What is the best way to get 3 buttons that are nested inside a movieclip to control the main timeline?

I know this MUST have been covered before and i'm just not doing a good job with my search, but there it is. Asked once again for you all lol

Finally Learning Flash.. Pft. No Actions For Button?
Yes. I've finally decided to learn Flash.


ok, well I started off with the shine tutorial, so, I did a bit of fooling and now I want a play button.

Problem is... what the HELL happened to Right Click -> Actions ???
It won't let me add actions (which happens to be GoToAndPlay) to zat button!

Which Part Of This Code Will Finally Stop The Fade
This code will fade in a text message into a text field and fade out any original message before it.

Further along the timeline when my movie is closing, I would like to finally fade out this text field without it fading back in again.How do I fade out the message without it fading back in please?

Which part of this code must I use. (I tried turning the text field into an MC but had a few visual complications so I prefer to stay with the actionscript.)

Thanks for any help.

Cheers.



t_fmt = new TextFormat();
t_fmt.font = 'myFont';
box.setNewTextFormat(t_fmt);
box.embedFonts = true;

TextField.prototype.fadeOutIn = function(alpha_change, per_ms, updateAfterE) {
clearInterval(this.fadeID);
this.dir = -1;
var fade = function (tf) {
tf._alpha += tf.dir*alpha_change;
if (tf._alpha<=0) {
tf._alpha = 0;
tf.dir = 1;
tf.text = tf.newtext;
} else if (tf._alpha>=100) {
tf._alpha = 100;
clearInterval(tf.fadeID);
}
if(updateAfterE){
updateAfterEvent();
}
};
this.fadeID = setInterval(fade,per_ms,this);
};

//buttons Actions:

someButton.onPress = function(){
box.newtext = "This text fades in after the text before it fades out when you press this button";
box.fadeOutIn(5,1,true);
}

Finally Got It Now I'll Share. ... How To Search Your Scene And Fill An Array
I finally figured out how to do this.

I have an artist who wants to place many copies of the same MC instance throughout the scene.

but he doesn't want to name them, and he want's to be able to change them in the future

I finally figured out the code to make it work

the following code creates an array, and fills it with MC's of a certain name, then it renames each corresponding to the array index

here's the code


ActionScript Code:
my_arr = new Array();
i=0

for (var item in _root)
{
    if(typeof(_root[item])=="movieclip")
    {         
        if(_root[item]._name=="ball")
        {   
            _root[item]._name=["ball" + i];
            my_arr.push(_root["ball" + i]);  
            i++;
        }
    }
//  trace(item)   //////// you can see what everything on _root is with this trace
}
trace (my_arr);

now if anyone knows of a way to add wildcards to the if(_root[item]._name=="ball") line, THAT would be something

Finally... How To Use MX 2004 TextArea To Create Dynamic Scrolling Text Fields
After working on this for far longer than I should have, I've finally figure out how to use MX 2004's TextArea component to display dynamically loaded text strings from our CF server.

In the interest of saving everyone else time, expense and grief, here's what I did.

(1) Drag the TextArea component onto your movie.
(2) Use the Properties inspector's properties tab to set the width and height values of the text field.
(3) Give the TextArea an instance name. I used "comment".
(4) Switch the Properties inspector to the parameter mode and edit these fields as appropriate. I changed HTML to true, EDIT to false, WORDWRAP to false, etc. Be sure to leave TEXT alone.
(5) Insert a second layer in the movie and open the ACTION panel and insert the code you're going to use to pull the text string(data) from your server.

Here's my code:
code:
var colist = new LoadVars();
dataurl = "http://www.mycompany.com/flash/quote.cfm?co_name=Cod";
colist.load(dataurl);
attachMovie("loadbar","loadbar",9);
loadbar._x=5;
loadbar._y=175;
colist.onLoad = function() {
removeMovieClip(loadbar);
comment.text = colist.company_list;
}

I load the "loadbar" movie to indicate a search is being made and to give the server time to return the data. Once the data is loaded, I remove the loadbar movie.

What this CF query does is look for companies whose names include the phrase or word "Cod". This of course would usually be a variable input by the user, but for test purposes I hard-coded it.

When I test the movie, I get back a selectable list of company names and their respective stock symbols in a scrollable text window with both vertical and horizontal scrollbars.

I hope this helps reduce the frustration I felt trying to figure out how to make this all work.

Now to move on to customizing the component!

How To Tell When Something Has Finished?
Hi

Got a problem that is driving me mad and is probably due to my limited knowledge of AS - I need a sort of listening device methinks......

I have an array of words, I pick the next word in the array when a button is pressed and split it into letters that then tell a fruit machine type display to scroll to each letter from a fixed alphabet scroll, what I want to do is to display the possible definitions by calling the do_answers(word); function for this word AFTER the last letter has slotted into place and the word is complete. As it is an alphabet scroll (from z-a) then inevitably this letter is the closest to 'a' no matter what position in the word it is.

Each letter scroller is a movieclip named l1,l2 etc up to l17, 17 being the length of the longest word in the array.

My current main timeline code reads (only 2 words for simplicity here and lots of other little bits cut out) with reset() being called on 'next' button pressing:


Code:
codewords=new Array("FIRST WORD","SECOND WORD");
_global.count=0;
function reset(){
for(i=0;i<17;i++){
_root["l"+i].gotoAndStop(1);
}
if(_root.codewords.length>_global.count){
do_word(_root.codewords[_global.count]);
} else {
do_word("GAME OVER");
}
}
function do_word(word){
wordSplit=word.split("");
for(ch in wordSplit){
//now set the letter this letterbox will stop at
_root["l"+ch].letter=wordSplit[ch];
//now start this letterbox scrolling from frame 2
_root["l"+ch].gotoAndPlay(2);
}
_global.count++;
do_answers(word);
}
function do_answers(ansframe){
_root.answers.gotoAndPlay(ansframe);
}
As you can see the do_answers() call is made after the last letter is set off to do it's scrolling BUT the actual scrolling takes longer than the time the function moves onto the call and the answer options are displayed.

How can I do this anyone?

Thanks

Ali

Tell If MC Has Finished
How can you tell if an MC has finished playing before you load another?

When An FLV Has Finished...
Long story short, I HAVE to use the FLVPlayback for my videos to play.. please don't ask why LOL long story..

but when I'm trying to do is find something that will let me know when the FLV has reached its end... is there a way? can't seem to find it.

Almost Finished
i just finished my biology project and when i go to preview it, it seems to be very dull and weak . how can i spice it up with some special effects and what are some other good ways to make it more interesting and entertaining?

Mp3 Finished And ....
yow! create one main flash and inner has one mp3 player
one movie clip.
that has this code
AS CODE -----------

stopAllSounds();
musica = new Sound();
musica.loadSound("http://..../blabla.mp3", true);
musica.setVolume = 100;
stop();

END AS CODE -------


This code ok ...
... but i have 2 musics. how do i for when one music end the outher beging?

(:

Thanks yet!

Almost Finished
i just finished my biology project and when i go to preview it, it seems to be very dull and weak . how can i spice it up with some special effects and what are some other good ways to make it more interesting and entertaining?

Hi I Am Almost Finished My First
Hi

I am almost finished my first flash site but I would like to add a flash guestbook to finish it. I would like the book to be a full part of the site and not have to call another html page to open it. Is this possible ? My site is based on a kirupa.com tutorial and I would like this to be a self contained swf that can be loaded from my navigation buttons.

I do not know how to begin and my actionsctript skills are limited.

TIA

Copyright © 2005-08 www.BigResource.com, All rights reserved