Center Picture Bug
Hi ya.Everything seems to be working well in this gallery HERE. | XML FILE (links removed). The gallery is publish for Flash Player 6 and Actionscript 2.0.However, I use the same picture twice: it is the second picture in the gallery and the second to last in the gallery (a yellow and purple flower). The problem is the second to last picture does not center. However, the second picture does! I'm using the exact same scripts so I have no idea where my bug is and I'm running out of time before I move. Can I get someone to take a look? ActionScript Code: function loadMain(num:Number) { main_mc.picture_mc.loadMovie(images[num].attributes.main); dummy_mc.onEnterFrame = function() { var l:Number = main_mc.picture_mc.getBytesLoaded(); var t:Number = main_mc.picture_mc.getBytesTotal(); var p:Number = (l/t) * 100; if (p>0 && p < 99) { preloader_mc._visible = true; preloader_mc.bar_mc._xscale = Math.round(p); } if (p == 100 && main_mc.picture_mc._width>1 && main_mc.picture_mc._height>1) { delete dummy_mc.onEnterFrame; preloader_mc._x = -1000; // if picture is less than the limit (which is the mask) if (main_mc.picture_mc._width<=main_mc.mask_mc._width) { main_mc.border_mc._width = main_mc.picture_mc._width+10; main_mc._x = (holder_mc._x - 1)/2 - (main_mc.border_mc._width/2); // if picture is smaller than the limit } else { main_mc.border_mc._width = main_mc.mask_mc._width+10; main_mc._x = 1; } if (main_mc.picture_mc._height<=main_mc.mask_mc._height) { main_mc.border_mc._height = main_mc.picture_mc._height+10; } else { main_mc.border_mc._height = main_mc.mask_mc._height+10; } main_mc._visible = true; main_mc.picture_mc._alpha = 0; dummy_mc.onEnterFrame = function() { main_mc.picture_mc._alpha += 10; if (main_mc.picture_mc._alpha>99) { delete this.onEnterFrame; // enable the thumbnails again. for (i in holder_mc) holder_mc[i].enabled = true; // set auto play feature if (is_autoPlay) auto_play(); } }; } };}
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-11-2006, 05:23 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Keeping The Center Of The Stage In The Center Of A Web Browser
Hey,
I have a really wide flash page, but the main portion of it is in the center
of the .swf. My question is how do I make the center of my .swf in the center
of a web browser so that when the user resizes the browser, the center of the stage stays in the center of the browser? Right now it has the left side of the .swf aligned with the
left edge of the browser so the center of my .swf is usually being cut off by
the right edge of the browser and users have to scroll to the right to see the
main portion of the site...I'm sorry if that's somewhat confusing, but any help
at all would be appreciated. Thanks!
Dave
How Do I Center An External File In The Center On The Stage
I followed the tutorial for preloading external swf files, now that I have done so and it works, I notice that the swf file does not center after I preview it after it loads the external file.
I have centered the holder on the stage but after I preview the file or test movie, the loaded file is not centered and I have to play around with it for it to be centered. Is there a way to set the x and Y in the actions so this won't happen or do I have to know the size of the file that I am preloading off my server?
How Do I Scale From Center Of Stage, Not Center Of MC?
I'm building a Flash map that I'd like to be able to scale in and out of. I've added a + and - button and linked them to a 5% + or - of the main MC's x and y scale. But, on press I'd like it to scale from the center of the stage, not the center of the movie clip, so that when I zoom further into LA the whole image doesn't go shooting off to the left, since LA is on the far left of my enlarging MC. How do I do this? Am I on the right track here?:
//onPress increase x and y scale 5%. no prob.
//move the map by combining an understanding of the center point of the MC, the centerpoint of the Stage (half the width, maybe), and then maybe multiplying it by some factor of my current %scale, since a 5% increase is a varying number, depending on my current scale.
Seems like this would work, but I'm not sure what that math would be.
...or is there a better way like a built in method that deals with MC centerpoints?
Thanks,
Greg
User Uploads Picture > Can Move And Edit Picture With Tools In Flash File
Hello,
I am looking for some help with this. It seems like something that can easily be done.
http://www.sonypictures.com/movies/t...customization/
I am looking for the user to be able to upload their picture, and then the picture loads into the flash file. once in the flash file, they can move their picture up, down, left or right, rotates in a circle, and also click a button that makes their picture smaller or larger.
I am working on a project for my family, so they can put their picture with an actor and I wanted to know if anyone could point me in the right direction for this?
Thanks so much in advance.
Enlarging A Thumbnail Picture On A Separate Window The Same Size Of Picture
Hi,
I feel like a dumb, but I still need to ask this question:
When you are using thumbnail size pictures acting like buttons, how can you create a link to a new window page the size of the new enlarged picture only?...I don't want a new window showing the picture with a white background covering 100% my Flash site..
You see, I told you it was a dumb question...
Any help?
Upload Picture From Database, Transform Picture In FLash
Hi, all.
I just want to do a test: I made an swf file that is to be embedded in an html web page. Inside swf I want a picture to be upload from database ( for customized purpose ), say ASP, or XML. And new picture will replace that old one inside swf. Further more, e.g. I upload just a picture that is a piece of tile. When it appears in swf, it should be tiled 5 by 5 and transformed for perspective. Is that possible with AS? if yes, could anyone offer help? And how to write interface code -- ASP or xml communicates with FLASH, to upload picture from database? Thanks.
-percy
Changing A Pixel Picture To A Flash Picture
I need help on how to make a Pixeled image into a flash image so i can change it with flash tools. I don't even know if this is possible but someone told me it was. please Help ASAP !!! making a movie for my school !!
I Want A Picture To Appear In My Flash Movie.. But.. I Want The Picture Loaded From..
I want a picture to appear in my flash movie.. but.. I want the picture loaded from the internet.. so..
In other words..
I have a button. When i press the button, I want this image:
http://www.era-morrison.com/westford/media/topper.gif
to show up.. Im also going to apply a variable, so I cant just copy and paste the image into the flash file.. Is this possible? thanks!
Is Loading A Picture? Better Than Having The Picture In The Main .swf File?
Is Loading a Picture? better than having the picture in the main .swf file?
Isn't this going to cause a loading picture "pause/lag" everytime the page is re-loaded?
when the picture is loads once and the user re-loads the page... will it cause it to load the picture again from scratch???
thank you.
Is Loading A Picture? Better Than Having The Picture In The Main .swf File?
Is Loading a Picture? better than having the picture in the main .swf file?
Isn't this going to cause a loading picture "pause/lag" everytime the page is re-loaded?
when the picture is loads once and the user re-loads the page... will it cause it to load the picture again from scratch???
thank you.
Click On A Picture To Download The Picture.
Hello,
How do you set up something so that when they click on a "thumbnail", they download the file. I assume I would set it up as a button... But where do/how do I set up the download aspect after they click on it... anyhelp would be appreciated. Thank you.
Fade: Picture Into Picture(white)
Hi, i want to fade a picture of someone into that picture, but coloured white.
I've tried a shape-tween but it seems that shape-tween don't work well when its about multi-coloured objects.
Does someone know a solution?
Greetz
Using Arrays To Fade Out Picture And In A Different Picture
As Title Says Really.
I have a rectangle with 6 pictures in,
and i have about 10 other pictures to show.
i want to for example:
fade out picture 1, fade in another 7
fade out picture 4, fade in picture 12
fade out picture 2, fade in picture 14
im sure you get the idea, i have tried to look for adding and removing items from an array but couldnt find much concrete info and not sure if that is the right direction i should be looking.
if anybody has any suggestions on where to start looking it would be much appreciated
thanks
Dan Hodkinson
Adding Bg Music/Bg Picture + Picture
I have looked at a few tutorials and none i found really seem to help
This is what im looking to do(im completly new to flash)
I have created a stupid bg image in mspaint that i want as the background
Have a mp3 playing the whole time the flash is run.
and a picture of my mate i cut out in photoshop to appear after say something like 20 seconds this dissapear
sounds so simple but i cant find no online help.
Load Picture No Picture Gallery
i dont want a picture gallery!!!! i just want the commands or what i have to do so when they get to the frame! just download the picture...without clickin a button!!!! can somebody send me a example? mi mail is leerabanal@hotmail.com
PLEASE HELP ME
Picture-in-picture-in-picture- ... -effect
I've seen examples of this elsewhere but just bumped into this one in the kirupa forum in the "cool sites" section:
http://www.sofake.com/
How on earth is this programmed in flash?
I had an idea for our new bendsite and this could be perfect (although our site would have less text and a would be little more image-heavy)
And would it be possible to include multiple links per "zooming-level"?
Thanks in advance!
Sieg
(i'd love to say I'm working on it but I'm 100% stuck because I really don't have a clue on how to begin...)
Picture Within A Picture, Zoomed In
I'm trying to create an effect where a picture is made up of lots of smaller pictures when it is zoomed in. I've uploaded an example which shows a big red cross, but as it zooms in, it looks as if the red cross is made up of lots of small red faces.
Is there a better and more effective way of doing this than what I've done so far? The swf file size is a lot bigger than I want it to be and it slows down quite a bit on some computers. Are there any tutorials out there showing an example of this, or do does anyone have any ideas on how I can improve it?
Thanks for any help
redfaces.fla example 30KB
Second Picture Overwrite First Picture Help
Once i click on the movieclip the picture appear on the stage but if i click on the movieclip, the second object will overwrite the first picture. How can i do to not overwrite the picture? and how can i allow muliple click and mutiple picture appear?
Attach Code
var mySelection = "";//Gobal declaration
wire.onPress = function (){
this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idwire", "wire", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function
}
resistor.onPress = function (){
this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idresistor", "resistor", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function
}
ps.onPress = function (){
this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idps", "ps", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function
}
ammeter.onPress = function (){
this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idammeter", "ammeter", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function
}
voltmeter.onPress = function (){
this.createEmptyMovieClip("mc1", 90); //Create a newMovieClip with variable name "mc1""
mc1 = attachMovie("idvoltmeter", "voltmeter", 91); //store the Movie into mc1
mc1._x = 130.5 ;
mc1._y = 33.8;// setting the corrdinates for x and y axis
dragging(mc1); //calling the dragging function
}
//Function for dragging
function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}
//Btn function for flipping
flip.onRelease = function() {
mySelection._rotation += 10;
};
Center Swf?
I know this is a stupid question, but I'm getting crazy searching without getting the answer. When I publish my swf, how can I achieve that the movie is centered vertically and horizontally (right now it's in the upper left of the screen and looks horrible)? And is there a way to center it, so it would be always displayed according to the screen resolution of the user?
THanks for your help and sorry for asking!
How To Center A Swf.?
Hi Guys,
Running a FS movie with buttons, the buttons loads a 240/180 swf. to level 1. By default it loads to the 0,0, coordinates, I need to load the swf.to 249,92 coordinates.
any help is appreciated.
thanks,
Center
I've made a flash movie (main.swf) that is 1600x1280 and inside that movie I load another move (logo.swf). But I want that movie (logo.swf) to load in the center of (main.swf). Say that the visitor has 1024x768 screen resolution. It must load in the center of 1024x768. And if the visitor has 800x600. Then it must load in the center of 800x600. Does anyone know how to do that?
Center
is there an action to get the center of a movieclip...or the origin of the x and y axis?
-2
How Do I Center This?
I have a question. You know how different people have different settings on their computer when it comes to screen area? Well when people with a larger screen area (or different resolution?) view sites, they see a large blank space on the right hand side, or a repetitive picture.
How do you make a site that will allow you to view it centered on the screen no matter what settings you have on your computer?
Is this possible?
Thanks for the help!
Katie
How Do I Center This?
I have a question. You know how different people have different settings on their computer when it comes to screen area? Well when people with a larger screen area (or different resolution?) view sites, they see a large blank space on the right hand side, or a repetitive picture.
How do you make a site that will allow you to view it centered on the screen no matter what settings you have on your computer?
Is this possible?
Thanks for the help!
Katie
<center MC>
I am loading movies into an empty MC. I was wondering how to go about dynamically centering this emptyMC on the stage once it is loaded. Does any know of an efficent way to do this? Thanks in advance.
Where Is Center Of Mc
Hi, I have some code that i want to use to have the mouse be able to push a circle around. I have an MC called "particle" that consists of a few layers, one of which has a mc "circle" in it. In that circle mc, i use _x and _y to get the current position of the circle.
I'm not sure how this works but when i test the code, but the center point of "circle" (the point which the mouse has to push at to move the circle) is at the top left corner of the screen. How do i get that point to be at the center of the circle i drew?
_x Center And _y
How can I make a movie clip center into the middle of my movie?
Instead of the cordinates being in 0 and !=0 at the top left?
I would like this (script) to aplly, when my move center is 0, in the middle of the screen.
And does this calculate the things I wish as right asd I planned=? The Sin O and hyp-lenght?
onClipEvent(enterFrame) {
opps=(_root._xmouse * _root._xmouse);
sins=(_root._ymouse * _root._ymouse);
Uhyp=opps+sins;
Chyp=Math.sqrt(Uhyp);
_root.output=Chyp;
sinO=opps / Chyp;
_root.outputSin=sinO;
}
Why Is My Swf Not Center In MC
loadMovie("pic0.swf","pics1");
this works fine, but when the swf is loaded in to the blank mc its not centered.
The MC is just a border with no fill. What am I doing wrong???
I Can't Seem To Center This, Please Help
Hi,
I can't get the white box to fit in the center of the interface.
http://img.photobucket.com/albums/v1...minico/box.jpg
The code is this:
Code:
_root.createEmptyMovieClip("empty", 1);
photoGallery(_root.empty/*path*/, "thumbnails/DCP_"/*target*/, 1/*seed*/, 15/*maxSeed*/, ".jpg"/*format*/, 10/*fIn*/, 254/*thumbX*/, Stage.height-150/*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*/, 350/*boxWidth*/, 450/*boxHeight*/, 0/*imageX*/, 50/*imageY*/, true/*boxCentred*/, true/*imageCentred*/, "images/DCP_"/*trgtImage*/);
Center
Hi, i want to create a flash movie size 2000x1000 with in the center of it the content. this should be 700x500. how can i center this content on my screen/browser I know i can create a background movie, and load movies on top of it that are centered, but is it also possible to create just one movie and just center the content.
like here: http://www.parque.nl/
Center Tag
Hi I just did the whole "internet explorer" thing... and normally I center the flash swf. with html tables. However the new code in my html document over rides any tables...
I think that there has to be a way to center a flash movie in the html page with
with some sort of tag???? Can anyone help me?
Thanks so much, M
Center It
Ok, I still don't understand the best way to center your swf vertically AND horizontally in the html window.
I know you can choose "100%", and "no scale" in the publish settings and that DOES center it. BUT it also shows all the stuff around the sides of my document that should be concealed.
Another way is to put it in a table, but I don't know how to do a table (NO html knowledge here)
Help?
Center Me Where I Want
I need help assigning the center viewing point (spot) of my over sized flash window. I have a huge map - but when the show opens: I always want the viewer to always start at the bottom center... this is easy!
just cant figure out the script --- any helpers out there? Thx
Always Center Swf
Does anybody knows how to keep center a big SWF (ej:1024x768) so in smaller screens (800x600) or just when I change the size of the explorer window the SWF´s center keeps in the center.
Just like in www.britneyspears.com
I´ve tried puting the SWF in a 100%x100% center table in the html. But doing that the center of the SWF don´t stay in the center of the windows when I resize it.
thanks!
Ivan
Can't Center
I'll start off and say I am a total NOOB too flash, but I'm learning. I have just switched over to Flash CS3 and CAN'T for the life of me get the website centered within the browser. What am I doing wrong?
Here is the index.html file...
<html xmlns="
How Center Swf?
How do I make my flash swf object center on my html page? Here's the link:
http://distance.uaf.edu/mockup/FERPA-mockup-1.html
thanks!
Center Swf In IE
simple question i hope, can some one tell me how to center an swf in ie, also is there a way with out using frames to scale the swf so that it's always centered.
thanx 4 info.
swift
How Do I Center It?
I have embedded my main swf file in dreamweaver. On the properties window, I selected align to absolute center. The file though plays in the upper right hand corner. How do I get the embedded swf to center in the index html file?
Center Pop-up HELP
cant get to work on windows xp works fine on mac, I also tried putting javascript in my dreamweaver page & nothing happens.(i'm using flash mx2004pro for mac)
http://www.kirupa.com/developer/mx/centered_popup.htm
http://www.kirupa.com/developer/flash5/newwindow.htm
Help With Center
I'm trying to make a movie-clip symbol rotate with Action Script.
It uses the top-left corner as center of rotation (cross hairs) - how do i change this? I want it to rotate around its center.
When i make the same object rotate using a motion-tween, it rotates around its center, the round thingy. And i can drag its center to whereever i want it.
I'm confused, can somebody help me?
thanks
CENTER OF THE NET
Good day everybody i want to find out how i can center my flash site when been viewed in a browser i have tried to edit the html code that comes with the published swf i have tried to use the <DIV STYLE="position: absolute; left: 220px; top: 300px"> ok that woks but when i view the site on a bigger screen it is absolutly out of place please go here to see what i mean www.geocities.com/krizinxgren/
please how can i center the site so it loads and stays in the center on any screen size is that to do wit AS am pretty sure i can sort this out by editing the html code that contains the flash site this is my html code that contains the swf flash site please someone tell me were am going wrong......................................
<body bgcolor="#000000">
<DIV STYLE="position: absolute; left: 220px; top: 300px"> ((HEY dis is the code i meant))
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/s...ersion=7,0,0,0" width="770" height="257" id="KRIANGULI" align="center">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="KRIANGULI.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#2F4F4F" />
<embed src="KRIANGULI.swf" quality="high" bgcolor="#2F4F4F" width="770" height="257" name="KRIANGULI" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</DIV>
</body>
</html>
if not how can i get my flash site to load in its own window with the resizing and movie controls disabled mind you some flash sites when you right click you can rewind-play-zoom-forward etc me i want to know how to disable those function cause sometimes it will spoil the look and feel of the flash site.
bless yall
KRNG
How Can I Center This?
(pls. download the file first)
i wanted to put the matrix effect exactly in the center box, i have tried to modify the command but i can't seem to figure it out so pls. somebody help me.
Center Pop Up
the tutorial on center popup window is cool
but I have lots of popup window in my site and I don't want to type long list of code on each and every button.
So I want to know - is there any way that I can create a function and use it again and again.
here is what i tried
ActionScript Code:
Movieclip.prototype.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) { getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");}function pop() { address = "http://www.yahoo.com"; target_winName = "hallweir"; width = 400; height = 300; toolbar = 0; location = 0; directories = 0; status = 0; menubar = 0; scrollbars = 0; resizable = 0; //sends data back to the function openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);}thumb.thumbnail.but1.onRelease = function() { pop();}
this is o.k. but what about the address - address for each and every button is different.
Any Suggestion.
Thanks
Center SWF
Hi all!
I wonder how you can center an externally loaded swf regardless of its height or width?
Currently I have a main swf which I load other swfs into, and I need those swfs to be centered on the main swf.
Any help in this matter would be greatly appreciated
regards
/rundevo
How Do I Center It?
I have embedded my main swf file in dreamweaver. On the properties window, I selected align to absolute center. The file though plays in the upper right hand corner. How do I get the embedded swf to center in the index html file?
Center Pop-up HELP
cant get to work on windows xp works fine on mac, I also tried putting javascript in my dreamweaver page & nothing happens.(i'm using flash mx2004pro for mac)
http://www.kirupa.com/developer/mx/centered_popup.htm
http://www.kirupa.com/developer/flash5/newwindow.htm
Help Me To Center JPG
Here is the code I am got it from here
http://www.flash-creations.com/notes...ic_loadjpg.php
eveything works good for me but I can't center the main image
Please help
ActionScript Code:
var picnames:Array = [
"01","02","03","04","05","06","07","08","09","10","11"];
// Varaibles
var PICPATH:String = "art/"; // folder with jpgs
var NPICS:Number = picnames.length; // number of pictures to load
var PICX:Number = 400; // x loc of big picture
var PICY:Number = 250; // y loc
var THUMBHOLDERX:Number = 30; // x location of thumbnail holder movieclip
var THUMBHOLDERY:Number = 415; // y location
var THUMBW:Number = 20; // width of each thumbnail
var THUMBH:Number = 20; // height
var MARGIN:Number = 8; // margin between thumbnails
var TOTALBYTES:Number = 106000; // approx sum of bytes in all jpgs
var sqText = "0-A-"
var totalloaded:Number = 0; // running tally of bytes loaded from all pics
// index into pictures array, used for loading
var ipic:Number;
// set up loader, an instance of MovieClipLoader
var loader:MovieClipLoader = new MovieClipLoader();
// use the main timeline to listen to and respond to loader's broadcast events
loader.addListener(this);
/********* DEFINE FUNCTIONS, INCLUDING INIT FOR MOVIE SETUP **********/
function openPic() {
pic_mc.loadMovie(PICPATH + picnames[this.i] + ".jpg");
// trace(pic_mc._width)
}
// assign event handlers (called when all jpgs are loaded)
function setupHandlers() {
pct_txt.removeTextField(); // don't need loading indicator any more
for (var i:Number = 0; i < NPICS; i++) {
thumbs_mc["mc"+i].mcs.onRollOver = openPic;
}
}
// listener function for broadcast 'done' message (for each pic)
// onLoadInit gets executed when the movieclip has been loaded into _mc AND
// its width and height data are available.
// (_mc = the movieclip being loaded into)
// this routine sets the size and position of each thumbnail clip as its jpg
// is loaded and starts the next one loading. When all have been loaded,
// a random picture is loaded into pic_mc and setupHandlers is called to
// assign handlers to each thumbnail movieclip
function onLoadInit(_mc:MovieClip) {
// this gets done when the jpg is completely loaded:
_mc._xscale = THUMBW;
_mc._yscale = THUMBH;
trace(_mc._width)
_mc._x =(60-_mc._width)/2
_mc._y =(60-_mc._height)/2
// give the movieclip a property to remind it who it is
// (used by openPic to know which big picture to open)
_mc.i = ipic;
// add picture size to totalloaded variable
totalloaded += loader.getProgress(_mc).bytesTotal;
// now load the next one (if there are more) or set up handlers if done
ipic++;
if (ipic == NPICS) {
// start with a random photo displayed
pic_mc.loadMovie(PICPATH + picnames[Math.floor(Math.random()*5)] + ".jpg");
setupHandlers();
} else {
loader.loadClip(PICPATH + picnames[ipic] + ".jpg", thumbs_mc["mc"+ipic].mcs);
}
};
// listener function to handle broadcast progress messages
// make pct_txt show cumulative loading progress
function onLoadProgress(_mc:MovieClip, loaded:Number) {
var loadedsofar:Number = totalloaded + loaded;
pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
};
// things to do to set up the stage and start the movie:
// create holders for the pictures and thumbnails
// create and format progress-indicating textfield
// create individual holder movieclips for each thumbnail within the thumbnail holder
// start the pictures loading with loadClip
function init() {
// create holder for pictures
createEmptyMovieClip("pic_mc", 1);
pic_mc._x = PICX
pic_mc._y = PICY
// create (and draw) holder for thumbnails
createEmptyMovieClip("thumbs_mc", 2);
thumbs_mc.beginFill(0);
thumbs_mc.moveTo(0, 0);
thumbs_mc.lineTo((MARGIN + 60) * NPICS-10, 0);
thumbs_mc.lineTo((MARGIN + 60) * NPICS-10, 60);
thumbs_mc.lineTo(0, 60);
thumbs_mc.endFill();
thumbs_mc._x = THUMBHOLDERX;
thumbs_mc._y = THUMBHOLDERY;
// make empty movieclips in thumbs_mc for each pic to go into
for (var i:Number = 0; i < NPICS; i++) {
var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
mc.lineStyle(0,0xAFB9CF,30);
mc.moveTo(0,0);
mc.beginFill(0xD4DEE9,30);
mc.lineTo(60,0);
mc.lineTo(60,60);
mc.lineTo(0,60);
mc.lineTo(0,0);
mc.endFill();
//mc.fr._alpha = 30
mc.createEmptyMovieClip("mcs",1);
mc._x = i*(60 + 8);
mc._y = 0;
}
// set the pointer to the first jpg in the array picnames
ipic = 0;
// start loading jpgs
loader.loadClip(PICPATH + picnames[ipic] + ".jpg", thumbs_mc["mc"+ipic].mcs);
}
init();
Thanks
Center A Popup?
i have an enter button made in flash on 1 page, what i want to do is, when clicked, open up a popup window.. but i want it to be centered on the screen. i already have the button open up a popup, i just need to know how to center it
heres the site: http://members.aol.com/hoopers44
|