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








Scaling An Mc Relative To Stage Size


No... it's got nothing to do with egotistical newbie dj's...

I have a projector which I would like to go full-screen. In this projector I plan to play a video in the centre of the stage.

Since people using this preso will have differing screen resolutions, the stage will undoubtedly appear at several different sizes.

I don't want the video to scale, so I'll need it to detect the stage size and adjust its size using a specific ratio.

I've tried using Stage.addListener to detect the onResize() event, but Stage.scaleMode must be set to "noScale" for this to work. This screws my plan to have the stage scaleable.

How do I scale my video relative to the stage size?

Any help would be much appreciated!




Ultrashock Forums > Flash > ActionScript
Posted on: 2002-07-24


View Complete Forum Thread with Replies

Sponsored Links:

Help Proportional Scaling MovieClips Relative To Stage
Hello
I need some assistance on how to proportionally scale multiple movieClips relative to the stage size.

I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally)

But

I can not figure out for the life of me how to scale other movieclips in relation
to the stage size.

for example I have a background_mc that proportionally scales with the stage
to fill without distortion.

HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion?

Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently.

I have not been able to find any documentation on this.
lots of tutorials on backgrounds and color fills and the like but nothing
on proportional scaling of independent mc's

this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)


Code:

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);


//function to handle background image resize.
function setBackground() {
var reg2 = stage.stageWidth / 2;
var reg1 = stage.stageHeight / 2;
bg_mc.x = reg2;
bg_mc.y = reg1;
bg_mc.width = stage.stageWidth;
bg_mc.height = stage.stageHeight;
bg_mc.scaleX <= bg_mc.scaleY ? (bg_mc.scaleX = bg_mc.scaleY) : (bg_mc.scaleY = bg_mc.scaleX);

}
setBackground();

function resizeHandler(event:Event):void {
setBackground();
thanks

View Replies !    View Related
Help Proportional Scaling MovieClips Relative To Stage
Hello
I need some assistance on how to proportionally scale multiple movieClips relative to the stage size.

I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally)

But

I can not figure out for the life of me how to scale other movieclips in relation
to the stage size.

for example I have a background_mc that proportionally scales with the stage
to fill without distortion.

HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion?

Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently.

I have not been able to find any documentation on this.
lots of tutorials on backgrounds and color fills and the like but nothing
on proportional scaling of independent mc's

this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)

Code:


import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);


//function to handle background image resize.
function setBackground() {
   var reg2 = stage.stageWidth / 2;
   var reg1 = stage.stageHeight / 2;
   bg_mc.x = reg2;
   bg_mc.y = reg1;
   bg_mc.width = stage.stageWidth;
   bg_mc.height = stage.stageHeight;
   bg_mc.scaleX <= bg_mc.scaleY ? (bg_mc.scaleX = bg_mc.scaleY) : (bg_mc.scaleY = bg_mc.scaleX);
   
}
setBackground();

function resizeHandler(event:Event):void {
   setBackground();


thanks

View Replies !    View Related
Placing A Mc Relative To Stage Size?
I would like this MC from my library to attach to the right bottom corner of my stage. The MC is registered in the top left corner. I was thinking I could attach it using the following, but somehow that does not work. What am I doing wrong?

this.attachMovie("copynote", "copynote", this.getNextHighestDepth(), {_x:Stage.width - copynote._width, _y:Stage.height - copynote._height});

Thanks a lot for any help!

View Replies !    View Related
Relative Movieclip Positioning To Stage Size
Heya,

I am looking for some code to enable a movieclip to reposition itself according to the stage size
so far I got the footer to resize itself according to stage size.

However I will have some text as well which is supposed to stay position x=10 and y= (depending on height of the stage)











Attach Code

Stage.align = "TL";
Stage.scaleMode = "noScale";

var stageListener:Object = new Object();

stageListener.onResize = function() {

var stageWidth:Number = Math.round(Stage.width);
var stageHeight:Number = Math.round(Stage.height);
trace("Stage size is now " + Stage.width + " by " + Stage.height);

footerBG_mc._width = stageWidth;

footerBG_mc._x = 0;
footerBG_mc._y = stageHeight-150;

footerLinks_mc._x = (stageWidth/2) - (footerLinks_mc._width/2) ;
footerLinks_mc._y = stageHeight-18;

text_mc._x = (stageWidth/2) - (wallPaper_mc._width/2);

[ Static x position and variable y position, according to stage size

};

Stage.addListener(stageListener);

stageListener.onResize();

View Replies !    View Related
Scaling MC's Within Stage Size
hey guys,
Im having a problem here. I have an MC which loads images from an xml file.
Most of them pictures are quite big (800×600) and i know some people still run that resolution. So the problem is if the browser window is smaller then those dimensions people cant see the full pic. So now my question was, does someone know how to scale them down, without stretching the pic. Thus not:

myMc._width = Stage.width;
myMc._height = Stage.height;

but something like http://www.manipulator.com/
where the _xscale = _yscale;

Does anyone have a clue how to write this?

View Replies !    View Related
Scaling Stage With Size Listener
im using the following code to keep my menus in view when the browser is resized. [code]

stage.showmenu = false;

Stage.scaleMode ="noScale";
Stage.align = "TL";

bottomrightmenu._x = Stage.width
bottomrightmenu._y = Stage.height - bottomrightmenu._height
bottomleftmenu._y = Stage.height - bottomleftmenu._height
toprightmenu._x = Stage.width - toprightmenu._width
center._x = (Stage.width + 800)/2
center._y = Stage.height/2
sizeListener = new Object();
sizeListener.onResize = function() {

bottomrightmenu._x = Stage.width
bottomrightmenu._y = Stage.height -bottomrightmenu._height
bottomleftmenu._y = Stage.height - bottomleftmenu._height
toprightmenu._x = Stage.width - toprightmenu._width
center._x = (Stage.width + 800)/2
center._y = Stage.height/2

};
Stage.addListener(sizeListener);

stop();

on my main stage, on a layer beneath the menus, i have an empty movie clip that i'm loading background swf's in and out of.

my question is.......how do i get the background swfs to scale down in size when the browser size is decreased and scale up in size when the browser is enlarged, while still maintaining the "noScale" mode of the stage?

an example of what im trying to do can be seen here:

http://www.whatireallydoatwork.com/

thanks
brandon

View Replies !    View Related
Change Stage Size In Web Browser Without Scaling
I need to change the stage's size without auto scaling (i.e. cropping is ok) so that the user can scroll up/down the stage either with the browser's scrollbars or custom scroll bars I create. The height of the swf's contents change and so I need to change the stage's size or somehow crop it so that it would match the browser's size.

View Replies !    View Related
Relative Scaling
When you scale a movieclip
how do you make movieclips either side of it scale relative to it?
I am hoping to so something similar to :

http://www.martin-h.com/

like the four boxes he has in "Step 3" athough my project requires up to 16 boxes

Any sample code about?

I've attached wht I have so far ( it's an MX file )

I have the following code:

speed = 5;
big.onEnterFrame = function() {
// size alterations:
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
// position alterations
this._x += (xpos-this._x)/speed;
this._y += (ypos-this._y)/speed;
// make smaller box follow bigger box and remain 10 pixels to the right
small._y = (this._y+this._height)-small._height;
small._x = (this._x+this._width)+10;
};

with a symbol intance big and small and a button changing the x and y values.
the code on the button is:

on (release) {
w = Math.random()*200;
h = Math.random()*200;
xpos = Math.random()*Stage.width/2;
ypos = Math.random()*Stage.height/2;
}

Do I just do the code for all 16 squares listing the sizes ( instead of the random code) or is there a quicker way



Really appreciate any help. Thanks

View Replies !    View Related
Relative Scaling
Hi all,
I need a hand implementing an idea in flash for a presentation.
I have a text sentence on the stage, where each word is a seperate movie clip. What i'm after is a way to have each word grow/scale up, and the rest of the words to shuffle along relative to the each others position. I guess it's rather like a horizontal tsunami type effect - or maybe even os x dock-like, but with words instead of icons, but different in that the 'inactive' text items don't scale, just move. I'd also need to move the 'active' text to a certain position when clicked, load some content (or goto another frame) then move back again when clicked again... make sense?

I'm not brilliantly savvy with actionscript at the moment, but helpful pointers or flas would be welcome that i can have a dig at this.

cheers
TDi

View Replies !    View Related
No Resize/scaling A Movie Clip On The Scaling Stage...
I know this has probably been answered here already, but I've search through all the threads with "scaling" and "resizing" and can't find the solution.

Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.

I think I need to add a listener of some sort to the stage, but I'm not sure how to do this. If you can point me to a thread where this has already been answered, great! Otherwise I would be grateful for any help you could provide here.

View Replies !    View Related
Relative Vs Absolute Scaling Effects?
What is the difference between relative and absolute scaling effects? What I think it is, is when you manually scale an object versus scaling it in the transform panel...

View Replies !    View Related
Relative Scaling Flash Navigation
Hi, I'm having the toughest time trying to get this to work.

Basically, I have 3 images (photo1, phot2, photo3)

When a visitor rolls over the photo1 button, I would like photo2 and photo3 to animate and shrink into place.

When rolliing over photo2, photo1 and photo 3 should shrink into place.

And again, rolling over photo3, photo1 and photo2 would shrink into place.

When not on any of the buttons, they should all be the same size.

Seems simple, though I can't get the photos to shrink with a tweening effect, they just shrink, like a simple javascript function.

ANY HELP OR ADVICE WOULD BE MUCH APPRECIATED!!


Code for MC photo1(keyframe 1) is below:

stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame(); }
}
this.onRollOver = function(){
rewind = false;
play();
_root.movie2._xscale = "50";
_root.movie2._yscale = "50";
_root.movie3._xscale = "50";
_root.movie3._yscale = "50";
}
this.onRollOut = function(){
rewind = true;
_root.movie2._xscale = "100";
_root.movie2._yscale = "100";
_root.movie3._xscale = "100";
_root.movie3._yscale = "100";
}
this.onRelease = function(){
getURL("http://www.awebsite.com","_blank");
}

View Replies !    View Related
Scaling Relative To Mouse Position
My actionscripting must be improving because I know the basics of this, just need a little help.

I have a dragable movie clip that on release I want to scale, depending on the mouse position, the further the mouse up the screen (y) then the smaller the clip scales on release.

Any help would be, as usual, appreciated.

Thanks folks

View Replies !    View Related
Scaling Relative To Mouse Position
My actionscripting must be improving because I know the basics of this, just need a little help.

I have a dragable movie clip that on release I want to scale, depending on the mouse position, the further the mouse up the screen (y) then the smaller the clip scales on release.

Any help would be, as usual, appreciated.

Thanks folks

View Replies !    View Related
Scaling Menu Items Relative To Proximity
Can anyone here give me an overview of an algorithm I could use to mimic the type of scaling effect you see used on mac os x docks? This would be for something like an onRollOver event that would scale up a clip and onRollOut scale down a clip but you need to take in account the proximity and scale of the surrounding clips.

View Replies !    View Related
[9-slice Scaling] Not Scaling At Correct Size ?
Hi people,

I found something strange with the 9-slice scaling option.
My MC with that option is simply smaller than the one without it !
You can see an example here (fla in attachement).
with the simple code on the green button :

Code:
on (release) {
_root.i += 10;
this.scroller._height = _root.i; // the left one with 9ss
this.bar._height = _root.i; // the right one without 9ss
}
Does someone have any explanation ?

thanks

View Replies !    View Related
Scaling/preloader..scaling To A Certain Size..
Hi gang...ok...I have a percentage preloader using getBytes.....and I have a preloader bar that increases dependant on the percentage of bytesloaded...what I want is to have the preloader bar scale so that when the percentage reaches 100% the loader bar will be a certain width.

Here is my code so far....please help me edit my exixsting code..and NOT start just re-write the whole thing..I am trying to learn..and incorporate.


Code:
//In Frame 1 I have this:
total = this.getBytesTotal();

//In frame 2 I have this:
_root.growbar._xscale = percent;
loaded = this.getBytesLoaded();
percent = Math.round((loaded/total)*100);
displayPercent = "LOADING: "+percent+"%";
if (percent == 100) {
gotoAndPlay (4);
}

//In frame 3 I have this:
gotoAndPlay (2);

//In frame 4 I have this:
gotoAndPlay ("start");
I made an MC with the name of "growbar" on the stage....

I cant figure ot what I am overlooking...

-whispers-



p.s. Nevermind..I feel like a fool....I found it..LOL

View Replies !    View Related
Position MC Relative To Stage Using AS
Hey guys,

Another simple one... I'm trying to change position of a MC, using actionscript. Simple enough... catch is... I want the position relative to the Stage, not the parent.


ActionScript Code:
contact_mc._x = 10;

That will put the mc, in x position 10 but relative to the parent.

I need it to be at 10, on the Stage itself, is there a simple method? Something like...

ActionScript Code:
contact_mc._x = _root.10;

Hope this makes sense to someone, as I'm in desparate need

View Replies !    View Related
Mouse Relative To Stage
I need to be able to detect when the mouse leaves the stage in a swf that is embedded into a html page.

I have tried tracking the coordinates of _xmouse and _ymouse, and using a hitTest to see if the mouse is hitting a stage-sized MC... both with onEnterFrame events.

The dilemma seems to be that the "mouse" as far as flash is concerned never leaves the stage at all. If I trace the coordinates of the mouse, no matter how slowly I move off, the coordinate will stick at 0 (even worse, if you move quickly, it will stick at anywhere between 0 and 200!).

I don't really have a margin in which to fudge this... I need to know when the mouse in on the stage, and off! Any thoughts?

View Replies !    View Related
Help _X, _Y Of Clip Relative To Stage
Hey all,

I hope you can give me a hand i'm really strugeling with this.

I'm creating a screen saver and need two logos to be positioned relative to the stage's height and width so that when the screen saver plays fullscreen at any resolution the logos will allways be at the top right and bottom right of the screen.

I found a thread that explained something like what i'm looking for. The problem is if i want them on the right they don't seem to appear when the stage is resized. if the logo were in the top left corner it works great.

any help will do, thanx.

View Replies !    View Related
Relative Size
I hope someone can help me with this.

The situation:
A VB application has two swf's on it, one swf is on top 25% of app and the second is on the lower 75% of the app
The current state:
On resizing of the application the swf's resize in both height and width no matter how the app is resized
What is needed to meet the needs:
On resizing the application either taller or wider, the swf's need to resize accordingly to the appropriate size
(i.e. if the app gets wider the swf's get wider)
The problem I am stuck on:
How do I do this?

View Replies !    View Related
Positioning MC Relative To The Stage Border
I have several mc's that I want to position about 20 pixels from the right side of the users browser regardless of how big the resize it. Does anybody have any ideas of how to do this. I have been trying to use something like this:

onClipEvent(enterFrame){
this._x = Stage.width - 100;
}

but that still doesn't position it 100 pixels left of the stages width.

any ideas would be greatly appreciated

Mike

View Replies !    View Related
How Do U Get A MovieClips Position Relative To The Stage?
I have a movie clip made up of several other movieclips. I'm trying to get the position of the individual movieclips relative to the stage, but i only get it's position relative to it's parent. Exp:

trace(car._x) \ 100
trace(car._wheele._x) \ -33


pls help.

View Replies !    View Related
X Position Of MC Within Another MC Relative To The Main Stage?
ok, here's my problem

I'm tryiing to determine the X or Y value of a movie clip that's with another movie clip relative to the main stage. I don't want the value related to the parent clip.

can someone please tell me the syntax? thanks

View Replies !    View Related
Position Stuff Relative To The Stage
Feel free to use these to help in positioning stuff relative to the Stage. Acts on the registration point of the object.

e.g. if you have a movieclip 200 pixels wide with a lefttop registration point, you have to subtract 200 from rightEdge so it aligns nicely.


Code:
// Size of your flash canvas
var canvasWidth = 550;
var canvasHeight = 400;

var leftEdge = (canvasWidth/2)-(Stage.width/2);
var rightEdge = (canvasWidth/2)+(Stage.width/2);
var topEdge = (canvasHeight-Stage.height)/2;
var bottomEdge = Stage.height - ((Stage.height-canvasHeight)/2);
var centerScreen = (canvasWidth/2) - (menuWidth/2);
Hope this is useful especially for those who have been trying to achieve menus that stays on one side whenever the browser is resized.

View Replies !    View Related
Move MovieClip Relative To The Stage
Hi guys,

I'm try to get a MovieClip that after a hitTest, the hit position will move to 50 pixels above the bottom of the stage. Is this possible? I've had a look at the globalToLocal method, but can't get my head round it!!

Thanks

Danny

View Replies !    View Related
Mouse Position Relative To Stage
I'm having trouble with the mouseX and mouseY values after resizing the stage.

Everything works well with the default size of the window. However, after I resize the window and take my cursor to the left edge of the stage, "mouseX" values are negative. I want the left edge to start from 0 after resize aswell... How is this possible?

View Replies !    View Related
Easy Way To Get XY Coordinates Relative To Stage?
Is there an easy way to get the XY coordinates of a sprite in relation to the root stage not the direct parent?

Thanks!

View Replies !    View Related
Position Stuff Relative To The Stage
Feel free to use these to help in positioning stuff relative to the Stage. Acts on the registration point of the object.

e.g. if you have a movieclip 200 pixels wide with a lefttop registration point, you have to subtract 200 from rightEdge so it aligns nicely.


Code:
// Size of your flash canvas
var canvasWidth = 550;
var canvasHeight = 400;

var leftEdge = (canvasWidth/2)-(Stage.width/2);
var rightEdge = (canvasWidth/2)+(Stage.width/2);
var topEdge = (canvasHeight-Stage.height)/2;
var bottomEdge = Stage.height - ((Stage.height-canvasHeight)/2);
var centerScreen = (canvasWidth/2) - (menuWidth/2);
Hope this is useful especially for those who have been trying to achieve menus that stays on one side whenever the browser is resized.

View Replies !    View Related
Mc Size Relative To It's Own Position?
Hello all,
I have posted the same post in the newbie forum,
but received no reply, so I am posting it here to.
I hope I will not get into trouble because of this : )

I want to crate a simple thing, I hope.
I searched on the net and I was not able to find a solution.

I have a movieclip of a character that is built out of many other mc
inside of him, like parent and children's and so on.

You can drag the whole man with the torso part, which is a button some
where inside the man mc.

But I need it to resize the man as you drag him up and down
on the y axis, as if he is getting far and close.

I use flash 8 and actionscrpit2 with the script assist turned on.

Please help me I am lost,
Thanks.

View Replies !    View Related
Relative Movie Size?
I went to the following site, http://www.missyhiggins.com and I i noticed that the movie took up the whole page but resized if you made the window the smaller. Can anyone tell me how this is done?

Brendan Smith.

View Replies !    View Related
Relative Movie Size?
I went to the following site, http://www.missyhiggins.com and I i noticed that the movie took up the whole page but resized if you made the window the smaller. Can anyone tell me how this is done?

Brendan Smith.

View Replies !    View Related
Getting The X Of A Nested Movie Clip Relative To The Stage
i have a movie clip (mc_photos), and inside I have a group container (groupHolder), and within that I have the actual images in their own mc (imageHolder_n).

Is there an easy way to get the _x of the image relative to the actual stage, and not the movie clip it resides in?

I was thinking something like this would work:


Code:
_root.mc_photos._x + _root.mc_photos.groupHolder._x + _root.mc_photos.groupHolder["imageHolder_1"]._x
but it isn't bringing back the correct location of the image on the stage.

any ideas? thanks a lot in advace!

-tyler

View Replies !    View Related
Nested MovieClip Location Relative To Stage
Hi All,

I have the need to calculate the x,y location of nested movieClips relative to the stage. For example, lets say ...

clipA is at 100, 100
clipB is nexted within clipB a and its x,y within clipA is 200,200

So visually clipB appears to be at 200,200 but when I trace ..

trace("clip a.b " + a.b._x +" "+ a.b._y);

I get ... clip a.b x,y >> 156 156

I need to find out clipB's x,y relative to the stage at 0,0.

Any ideas?

I could do the math on the width and height of each movieClip but what if I have multiple nestings? Me thinks there must be an easier way.

TIA,
RandyS

View Replies !    View Related
Getting Loaded Clip Coordinates Relative To Stage
Hi!

I have a full screen site with a preloader that loads the main file. In the main file I load a gallery in which i would like to make a shape to cover the whole screen so it's impossible to click on anything behind it. The whole site is centered on the screen on the Event.RESIZE.

Problem is I can't use the localToGlobal since I'm targeting the stage to get the coordinates of the gallery. Is there maybe an alternative way to get the "global" coordinates of a movieclip?

I hope I made myself understandable

View Replies !    View Related
Keeping An Attached MC Position Relative To Stage
Keeping an attached MC position relative to Stage even if _parent clip is scrolled?
I'm revising my original question with some of my AS. I'm using Laco tween prototype if anyone gets confused with some of this ...I've commented the AS below with what MCs I want positioned relative to the stage.

///beginAS
for(i=1;i<12;i++){
var iconX=Stage.height/2
var iconY=Stage.width/2
var itemNumber=1
thisItem="item"+i;
this["box"+i].onPress= function(){
trace(boxCount)
blueprints.centerHolder.alphaTo(100,.3);
//The attached MC below are what I want to stay centered to the stage, but only before they are clicked. It's parent MC can be moved Left/Right/Up/Down using scripted buttons, so I don't want the attached MCs moved with it
blueprints.attachMovie(this.thisItem,"box"+itemNumber,boxCount,{_x:iconX,_y:iconY});

onEnterFrame = function(){

if(moveThisDown){blueprints._y-=5;blueprints.centerHolder._y+=5}
if(moveThisUp){blueprints._y+=5;blueprints.centerHolder._y-=5}
if(moveThisLeft){blueprints._x-=5;blueprints.centerHolder._x+=5}
if(moveThisRight){blueprints._x+=5;blueprints.centerHolder._x-=5}
if(rotateThisRight){selectedMCFull._rotation+=5;}
if(rotateThisLeft){selectedMCFull._rotation-=5;}
if(zoomThisIn){blueprints._width+=blueprints._width/100;blueprints._height+=blueprints._height/100;}
if(zoomThisOut){blueprints._width-=blueprints._width/100;blueprints._height-=blueprints._height/100;}
if (defaultThisZoom){blueprints.scaleTo(100,.8,"easeOut")
}
}

blueprints["box"+itemNumber].thisIsSelected="false";
blueprints["box"+itemNumber].alphaTo(100,0);
blueprints["box"+itemNumber].scaleTo(150,0);
blueprints["box"+itemNumber].scaleTo(100,.6,"easeOutBack");
blueprints["box"+itemNumber].nums.thisNumber.text=itemNumber;
blueprints["box"+itemNumber].onEnterFrame = function(){
blueprints["box"+itemNumber]._x=Stage.height/2
blueprints["box"+itemNumber]._x=Stage.width/2
}
blueprints["box"+itemNumber].onPress = function(){
this.swapDepths(boxCount);
selectedMC = this.main;
selectedMCFull = this;
this.startDrag(true);
this.main.alphaTo(100,.5);
this.num.alphaTo(100,.5);
this.nums.scaleTo(100,.2,"easeOutBack");
this.main.scaleTo(100,.2,"easeOutBack");
}
blueprints["box"+itemNumber].onRelease = function(){
this.thisIsSelected="true";
blueprints.centerHolder.alphaTo(0,.8);
this.stopDrag();
this.main.alphaTo(85,.5);
this.nums.alphaTo(100,.5);
this.nums.scaleTo(100,.2,"easeOutBack");
this.main.scaleTo(80,.4,"easeOutBack");
boxCount++;

}

}
this["box"+i].onRelease= function(){
itemNumber++
}

}

// end AS

Hopefully the code is readable ...thanks guys. If anyone needs the FLA to review, please email me at bryan AT bleedingtree.com or MSN Messenger with the same address.

View Replies !    View Related
Size One MC Relative To Another - Resize Parent MC...
I know how to set the w/h of a childMC with it's parentMC, but how do I keep the "ratio" when resizing parentMC. I'm wanting the child to be 5 pixels smaller than the parent. I'm eventually wanting the child to scale down to the 5 pixels, but right now I'm needing this little irritation helped

I thought when I put:
n=5;
<childMC>._xscale -= n;
<childMC>._yscale -= n;

or

n=5;
<childMC>._xwidth -= n;
<childMC>._ywidth -= n;

it would work, and it does, as long as the parentMC is not resized.

View Replies !    View Related
[F8] Objects In SWF Relative To Website Size
Hi,

If you look at this website: http://www.ogodtheaftermath.com/deluxe/ you will notice that all the different components react differently to readjusting the size of the page. The E-card bit in the top right always stays the same distance from the corner, as does the "solidstate" logo. However, the centralised bit stays just that: centralised. So how do they do that? How do they get the swf to react with the browser?

Thanks,

Matt.

View Replies !    View Related
Positioning _mc Relative To Browser Size
Hi hope you can help me?

I have a sliding dock utilizing a caurina tweener class however am having problems aligning it on the x y scale. I want it to be able to maintain it's respective position relative to the changing size of the screen. It seems like the x y variable here

var baseX:Number = 200;
var baseY:Number = 200;

keeps it static & I tried to place this code below to keep it's position relative to browser size but it only centers it. I tried playing around with the x y values but it only works bettween 1 & 2. Is there a way to align it to the bottom right of the screen that will adjust accordingly to browser size?


Code:

Stage.scaleMode = "noScale";
Stage.align = "TL";

myListenerload = new Object ();
myListenerload.onResize = function () {

slidingdock_mc._x = Stage.width / 1;
slidingdock_mc._y = Stage.height / 1.5;

};
Stage.addListener (myListenerload);
myListenerload.onResize ();

As you can see I'm a newbie at all this so If I'm doing something worng here can someone point me in the right direction?


Thanks.

View Replies !    View Related
Size One MC Relative To Another - Resize Parent MC
Last edited by bchalker : 2003-07-25 at 07:42.
























I know how to set the w/h of a childMC with it's parentMC, but how do I keep the "ratio" when resizing parentMC. I'm wanting the child to be 5 pixels smaller than the parent. I'm eventually wanting the child to scale down to the 5 pixels, but right now I'm needing this little irritation helped

This is what I have on frame 1 of the box (blockA and blockB):
-------------
var n;
n=5;
//align squares
xpos=blockA._x=blockB._x;
ypos=blockA._y=blockB._y;
//set w/h variable
width=blockA._width;
height=blockA._height;
//set blockB w/h relative to blockA - n
blockB._width=width-n;
blockB._height=height-n;
stop();
--------------

It's fine until I begin scaling. Is the code correct?

View Replies !    View Related
Calculate The X/y Of A Rotated Child Object Relative To Stage
Sorry for the long title, but i couldn't make it any shorter.
In fact i need to calculate the x/y position of a child object of a rotated child object of a rotated displayObject.

Things like this don't work.

ActionScript Code:
object1.object2.object3.x
//0

So i figured out i need to use the localToGlobal function, but i can't get it to work, because i can't get the point object in the last object, no matter how hard i try.

So? Any suggestions on how to do this?

Edit: I already found it out. It's:

ActionScript Code:
var pt1:Point = new Point(0,0)
object1.object2.object3.localToGlobal(pt1)

View Replies !    View Related
Position Images Relative To Screen Size
i have a flash movie with scalemode set to false and in the .html file the width and height of the object tag are 100%

i have a large image in my flash movie (about 800x900) so on some screens it will be cropped. how can i make it so that the bottom of the image is always flush with the bottom of the screen. so, on a lower screen res only the top and sides are cropped, not the bottom.

i tried:

ActionScript Code:
Stage.onResize = function() {
    backGroundImage._y = Stage.height-backGroundImage._height;
};

but this doesn't work because although the screen height changes, the origin (x=0, y=0) does not move to the top left of the screen, it is cropped out of view too.

cheers, james

View Replies !    View Related
[F8] Symbol Size Bigger Than Max Stage Size - How To Edit/view?
Newbie Alert!

I am trying to edit a FLA file for a sliding timeline and the main background image with the details (years, images text) is 23960 px wide and I cannot scroll the main stage area all the way to the right to edit the contents. How can I do this please?

Thanks.

Broadsword1967

View Replies !    View Related
Change Stage Size (not Scale) Based On Browser Size?
Not sure this can be done. I've looked through LOTS of resizing tutorials, but they don't do exactly what I want, and I'm not sure it's possible.

Basically, I have a slideshow that loads from xml and fades in a variety of sizes of images in random positions. I'm trying to set it up so that the swf (which is in a div tag in an interface) will resize depending on the browser size and will use the NEW stage size to determine the x/y position of the images (without resizing them) and will skip any images that are too big for the stage size...

Any ideas if this is possible? Dynamically sizing and determining the "working area" of a swf based on the browser/div size?? Any tutorials out there?? I can figure out the code, I just need to know where to start...

THANKS!!!!

View Replies !    View Related
Resize A Text Area Relative To Movie Size
I have a flash projector exe with dynamic text. Is it possible to make the height of the text area relative to the size of the projector window, so i can resize the projector and show more text and expand the scroll bar?

View Replies !    View Related
[F8]How To Position An Object Relative To The Size Of The Browser Window?
Hey guys,

I'm trying to make it so that my copyright information is positioned about 10 pixels above the bottom of the browser window no matter what resolution the user has. How would i go about doing this?

Any help would be greatly appreciated. Thx

View Replies !    View Related
[CS3] When Clicked, Image Zooms 400% And Pans Relative To Stage Width And Height
Hi!
I´ve made a movie clip which I called "mood" and when clicked it zooms 400%. What I want to do is to have it move relative to the _xmouse and _ymouse positions. Also because it is much bigger than the stage I would like it so that when I reach the corners of the Stage I would also reach the corners of the image.

All I have is a clip instance named mood and the actionscript on frame 1.

Here is the code:


Code:
// set X and Y initial scale for Target MC
mood._xscale = 100;
endScalex = 300;
initScalex = 100;

mood._yscale = 100;
endScaley = 300;
initScaley = 100;

// set Y position for Target MC
initx = 340;
inity = 195;

// Mood Button
mood.onRelease = function() {
scaleMood = true;
};

// Mood MC Behaviour
mood.onEnterFrame = function() {

// start Scaling Up
if (scaleMood == true) {
currentScalex = mood._xscale;
diffScalex = endScalex-currentScalex;
moveScalex = diffScalex/2;
mood._xscale = mood._xscale+moveScalex;

currentScaley = mood._yscale;
diffScaley = endScaley-currentScaley;
moveScaley = diffScaley/2;
mood._yscale = mood._yscale+moveScaley;

// Move Image with Mouse *** Here is the issue ***

mood._x = this._x + this._xmouse;
mood._y = this._y + this._ymouse;
// End issue : )

//change button behavior
mood.onRelease = function() {
scaleMood = false;
};
}
// start Scaling Down
if (scaleMood == false) {

//scale down X
currentScalex = mood._xscale;
diffScalex = currentScalex-initScalex;
moveScalex = diffScalex/2;
mood._xscale = mood._xscale-moveScalex;

//scale down Y
currentScaley = mood._yscale;
diffScaley = currentScaley-initScaley;
moveScaley = diffScaley/2;
mood._yscale = mood._yscale-moveScaley;

//position X
currentx = mood._x;
diffx = currentx-initx;
movex = diffx/2;
mood._x = mood._x-movex;

//position Y
currenty = mood._y;
diffy = currenty-inity;
movey = diffy/2;
mood._y = mood._y-movey;

//Change Button Action
mood.onRelease = function() {
scaleMood = true;
};
}
};

Thanks for helping me sort this out!

View Replies !    View Related
Movie Clip Floats Relative To Browser Window Size
Hello,

I do not have much flash actionscript knowledge. I'm trying to take a movie clip and have it float on the left side of the screen about 20 pixels. I already have my page set up to 100% and my window mode transparent so that I can put things on the outside of my stage and it still shows up in the html page. I want an 'elastic' type page so no matter your browser window size the object floats and follows the users browser window size. I have researched stage.onresize, but it needs to follow the browser size, not the stage size. I'm not sure if I'm making sense or how to go about this. Here is a link to the webpage I'm working on, so you can take a look and better visualize what I'm trying to do.

http://bigpicturepro.com/Test/

If you take a look the red box to the right is what I want to 'float' It is right now not on the stage of my fla. Any suggestions would be greatly appreciated. Thanks. Ashley

View Replies !    View Related
Stage Scaling?
(my code is at bottom)
A button aligned with the bottom of the stage is desired to remain aligned with the bottom of the stage as the user resizes the window.
As the height of stage is increased -- the _y of the button and the stage._height maintain their differential -- but the visible window shows the button moving faster down -- until its completely beyond the bottom of the window.

Conversely, as the window height is decreased -- the differential remains accurate -- but the button ends up in the middle of the window. Resize to the original stage height -- and the alignment goes back to as it started.

I've gotta be missing something. some sort of constraint or percentage/offset? Anybody know what it is? -- or if there's any easier way to maintain a button/object's alignment as the window/stage resizes?

newbie flasher -- and I can't even get unzipped...

Stage.scaleMode = "noScale"
var myListener:Object = new Object();
myListener.onResize = function () {

trace("Stage size is now " + Stage.width + " by " + Stage.height);
trace(btnNext._y)
btnNext._y = Stage.height - btnNext._height
btnPrevious._y = Stage.height - btnPrevious._height
trace(btnNext._y)

}
Stage.addListener(myListener);








Attach Code

Stage.scaleMode = "noScale"
var myListener:Object = new Object();
myListener.onResize = function () {

trace("Stage size is now " + Stage.width + " by " + Stage.height);
trace(btnNext._y)
btnNext._y = Stage.height - btnNext._height
btnPrevious._y = Stage.height - btnPrevious._height
trace(btnNext._y)

}
Stage.addListener(myListener);

View Replies !    View Related
Mc Keeping Relative Positioning Depending On Browser Window Size/resize
hi, i'm redesigning my personal website and i'm trying to figure out how to keep certain objects (btns, mc, gfx) in a certain spot on the browser window and how to "animate" them moving to those positions when the window is resized. the best example i can find is this website (www.superfad.com). when the window is resized, objects move accordingly with sort of an smooth animation. also, how can i get one that doesn't animate (also on the same website with the smoke). i've looked a lot of different websites and forums and can't really find (maybe since i don't know how to ask the question in a search box). if someone can help me on this, it'll be greatly appreciated. thanks.

View Replies !    View Related
Scaling The Stage But Not The Content
how do you make a flash file that is 100% of your browser size
and resizes with the browser but without the objects in the
movie resizing also?

thanks

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved