Center Pop Up Problem
I understand how to open a pop up window from flash and position it using x and y values, but how can you make it centered all of the time?
Thank you for any help.
FlashKit > Flash Help > Flash MX
Posted on: 06-03-2002, 05:45 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
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
Smartclip Center Pop-up?
hello,
i have downloaded the smartclip extension that i had seen earlier in a post here on flashkit and i have yet to be able to make it work. can someone tell me if i also need to have some javascript code in the .html page that my .swf file resides in that contains the "center pop-up window" smartclip?
it seems from the instructions provided with this smartclip that i do not need any more code other than what is contained in the clip itself, but i am wondering why it is still not working....any help with this would be great. thanks.
?center Pt. Zoom?
alright here is the situation:
i have a flow chart (not my doing, it is for my job) boxes and lines kind of thing. i have it set up so that the flow chart is a movie.
the code attached to the move is:
onClipEvent (keyDown) {
if (Key.isDown(Key.UP)) {
this._y -= 30;
}
if (Key.isDown(Key.DOWN)) {
this._y += 30;
}
if (Key.isDown(Key.LEFT)) {
this._x -= 30;
}
if (Key.isDown(Key.RIGHT)) {
this._x += 30;
}
updateAfterEvent();
}
i have a seperate zoom bar with a '+' and '-' also a 'R' for restart position of the flow chart. the code on the '+' is:
on (rollOver) {
gotoAndStop (2);
setProperty ("_level0/Map", _xscale, 105);
setProperty ("_level0/Map", _yscale, 105);
}
the next frame in this button looks like this:
on (rollOver) {
gotoAndStop (3);
setProperty ("_level0/Map", _xscale, 110);
setProperty ("_level0/Map", _yscale, 110);
}
and so on.....
the code for '-' is going down in scale.
the 'R' code is:
on (release) {
gotoAndStop (1);
setProperty ("_level0/Map", _xscale, 100);
setProperty ("_level0/Map", _yscale, 100);
setProperty ("_level0/Map", _x, 343);
setProperty ("_level0/Map", _y, 474);
}
_______________________
now this is the problem; i want to be able to make the center pt. of EACH block of the flow chart (on mouseDown) the zooming pt. instead of zooming to the center pt. of the ENTIRE flow chart.
Loading In The Center
Hey Flashers.
i have an .exe demo that i created in flash. My boss has a program that has many demos (the rest not flash).
so you have a screen that has all the demo links, when the user clicks on the flash exe then it doesn't popup in the middle of the screen. Is there some sort of command that will make it centered when loaded (no actions can be added to the actuall buttons since they are not done in flash - so i guess i'll need a first frame action but which one?)
thanks.
Absolute Center
Can someone tell me where I can downlaod the html template for Absolute Center (Flash 5)? I recently did a clean start on my computer and misplaced the download.
Scale Down From Center
I've been trying to get buttons to decrease in size and opacity (from their center) by a factor of 1, using on(release), until the button is 100% transparent and too small to view.
I've tried various methods, but either the button won't scale, or each time it does, it nudges to the top-left of the movie.
Any help would be much appreciated.
::bluemoth::
_scale From 'center' ?
Can anyone help me get this button code, to scale from it's button's center?
__________________________________________________ _________
on (release) {
setProperty ("pressme", _xscale, _xscale = _xscale -1);
setProperty ("pressme", _yscale, _yscale = _yscale -1);
setProperty ("pressme", _alpha, _alpha = _alpha -1);
}
__________________________________________________ _________
I'd much appreciate it,
::bluemoth::
P.S: I've posted this Q a few days ago, but no luck. Hope a new 'subect' title might help.
Center Stage How?
Hi Guys,
if you go to my web site http://www.daddyt.freeserve.co.uk
you'll know what I mean. in channel 6 I have a scrolling menu.
The only thing is that what you will notice that even with mouse out side of the center screen it still goes right.
yet when you go to the right side and come out of the screen the scroling stops going to the right. please how can I scroll from within the sreen.
Thanks
Mic
this is the code that I used
onClipEvent (load) {
nScreenWidth = 672;
nMaxRate = 15;
// nPixels determines the speed of the slider movement
function moveLeft (nPixels) {
this._x -= nPixels;
if (this._x<0-nScreenWidth) {
this._x = 0;
}
}
function moveRight (nPixels) {
this._x += nPixels;
if (this._x>0) {
this._x = 0-nScreenWidth;
}
}
}
onClipEvent (enterFrame) {
// move slider with speed dependent on mouse position
if (_root._xmouse<nScreenWidth/2&& _root._xmouse>0) {
moveRight(nMaxRate-_root._xmouse*nMaxRate/(nScreenWidth/2));
} else {
if (_root._xmouse>nScreenWidth/2 && _root._xmouse<nScreenWidth) {
moveLeft(_root._xmouse*nMaxRate/(nScreenWidth/2)-nMaxRate);
}
}
}
[Edited by Mikemax123 on 10-29-2001 at 11:57 PM]
Loadmovie Center?
How can I get a loadmovie .swf center to be the actual center of the loaded movie and not the top left corner. I could compensate the mcCLIP its loaded into but I really dont want to have to fudge this for future loads as well.
Thanks
carter
How To Center Backgrounds?
Can someone please tell me how to center a background image for an html page. Please be very specific
thank you very much
Need Center Code
How do you center the swf? I forgot the code, i think it's something like fscommand...something like that. Help me out if anyone know the code to center the swf/fla, thanks.
Determining Center
how can i load a SWF into the absolute center of the container MC?
thanx
Center Point Of An Mc
Hi there
I just recently changed to MX, and I'm very (and I mean VERY) pleased with it. Just one thing.
for this script I used, I have to change the centerpoint of the instance of a movieclip. That function used to be in the Transform area if I'm not mistaking.
Can anyone tell me where I can find it now?
greetings, Robin
Edit Center?
How do you modify the center point on a movie clip in MX? It used to be under modify>transform>edit center in Flash 5.
Any ideas?
|