resize constrain


Heres my code

//from circlecube blog
function resizeMe(mj:MovieClip, maxW:Number, maxH:Number=0, constrainProportions:Boolean=true):void
{
maxH = maxH == 0 maxW : maxH;
mj.width = maxW;
mj.height = maxH;
if (constrainProportions) {
mj.scaleX < mj.scaleY mj.scaleY = mj.scaleX : mj.scaleX = mj.scaleY;
}
}


function loaderComplete(myEvent:Event)
{
var loader = new Loader();
themovie.addChild(loader);
loader.load(new URLRequest("2kro.jpg"));
}


this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
resizeMe(themovie, 100, 300);

------------

Simple enough. But no picture loads unless I comment out the resizeme. An example of what I'm tring to achieve is putting a picture (i.e. 2kro.jpg) inside the center of a tv and a cellular phone pic (they both have different size and are on the same stage). I plan on doing this dynamically and got all the querystring-javascript-flashvar and html working and out of the way.

But I'm stuck with the simple resizing I can't find a reason why this resizeme function isn't working.
Posted On: Thursday 25th of October 2012 09:45:43 PM Total Views:  91
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




resize controls!

Hi Folks! i am developing a player in flash which you can see here. http://www.skashif.com/allaboutinnov...er_resize.html i only want the controls to remain of same size as they in normal screen mode when user enter fullScreen Mode. i am trying a twisted way which i thing may work, that is taking ratio of stageWidth and ScreenResolution and multiplying it with controls height ad width.. i hope that works! so i want ask you people to give me some leads.
VIEWS ON THIS POST

69

Posted on:

Friday 12th October 2012
View Replies!

resize screen problems on large monitors

Has anyone had this issue before, say I have a movieclip called options, and want it to always stay down in bottom right corner, simple, in the resize event just update the sreen size available and reset the x and y of options accordinging, with whatever offsets needed. BUT... this is getting thrown off on very large monitors, anything over 27in, sometimes the same code works, sometimes it doesn't, any help anyone come across this before
VIEWS ON THIS POST

108

Posted on:

Friday 12th October 2012
View Replies!

Can we code UILoader in such a way that the user can drag to resize it in AS 3.0?

Hi I have loaded different SWFs using UI Loader component and I have used AS 3.0 for that. those SWFs are playing video in form of Flvs in that. While executing those UI Loaders show video efficiently. Is there any way that I can code so that user can also resize that UI loader and still maintain the aspect ratio of the video. i am using RESIZE property but it is not allowing the user to resize the component , it just once resize the component on the run time I would highly appreciate any help.
VIEWS ON THIS POST

94

Posted on:

Friday 12th October 2012
View Replies!

Stage dimensions get messed on resize

I got this script, which creates a centered rectangle in my movieclip to be used afterwards as the container of a photo gallery interface. Code: var squaretwo:Sprite = new Sprite(); squaretwo.graphics.beginFill (0x333333,0.6); squaretwo.graphics.drawRect(50,50, stage.stageWidth-100,stage.stageHeight-100); squaretwo.graphics.endFill(); square.addChild(squaretwo); This works perfect when I launch the thing from the movie in its original state. But If I happen to resize it (particularly if the resized display area has different proportions), the whole thing goes awry. It goes off the center and, depending on the case (I don't seem to find a consistent rule here that determines the behavior), draws a rectangle thay may be bigger or smaller than the intended size. Any ideas on how to correct this Note: If the square is displayed and I resize the screen there is no problem, but if I close it, resize the screen, and then open a new one, it gets messed up.
VIEWS ON THIS POST

59

Posted on:

Friday 12th October 2012
View Replies!

HELP: sprite.addChild(NumericStepper) resizes sprite to 100x100

If anyone can help me with this, I would be extremely grateful. It's driving me insane. If I run this code: var mySprite:Sprite = new Sprite(); trace("mySprite 1:", mySprite.width, mySprite.height); numericStepper = new NumericStepper(); trace("numericStepper 2:", numericStepper.width, numericStepper.height); mySprite.addChild(numericStepper); trace("mySprite 3:", mySprite.width, mySprite.height); I expect this output: mySprite 1: 0 0 numericStepper 2: 80 22 mySprite 3: 80 22 But I get this output: mySprite 1: 0 0 numericStepper 2: 80 22 mySprite 3: 100 100 If instead I do this: mySprite = new Sprite(); trace("mySprite 1:", mySprite.width, mySprite.height); numericStepper = new NumericStepper(); trace("numericStepper 2:", numericStepper.width, numericStepper.height); mySprite.addChild(numericStepper); trace("mySprite 3:", mySprite.width, mySprite.height); mySprite.width = 80; mySprite.height = 22; Then the numericStepper is drawn as if it is squished to 20% its normal height. If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all. Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component As I was typing this, I came across this post: http://www.kirupa.com/forum/archive/.../t-263027.html Can anyone help me modify that solution for a numeric stepper
VIEWS ON THIS POST

94

Posted on:

Friday 12th October 2012
View Replies!

preloader + stage resize + hid area

i insert a preloader in a timeline of the fla , and move the movieclip for the stage resize and hid area menu in the second frame but i have the error #rror #1009: Impossibile accedere a una propriet o a un metodo di un riferimento oggetto null. at Mainstage/init() at Mainstage() this my my class someone can help me thanks package { import flash.display.MovieClip; import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.events.Event; public class Mainstage extends MovieClip { private var arriveY:int; public function Mainstage() { addEventListener(Event.ADDED_TO_STAGE,init); checkResize(); } private function init(evt:Event):void { removeEventListener(Event.ADDED_TO_STAGE,init); stage.frameRate=31; bg_mc.x=0; bg_mc.y=0; bg_mc.width=stage.stageWidth; bg_mc.height=stage.stageHeight; clip_mc.x=stage.stageWidth/2; clip_mc.y=stage.stageHeight/2; rights_txt.x=stage.stageWidth-rights_txt.textWidth; rights_txt.y=stage.stageHeight-rights_txt.textHeight; menu_mc.hitArea=hit_area_mc; hit_area_mc.mouseEnabled=false; menu_mc.addEventListener(MouseEvent.MOUSE_OVER,set Over); menu_mc.addEventListener(MouseEvent.MOUSE_OUT,setO ut); } private function closeMenu(e:Event):void { var dy:Number=arriveY-e.currentTarget.y; var ay:Number=dy*.2; e.currentTarget.y+=ay; if(Math.abs(dy)
VIEWS ON THIS POST

69

Posted on:

Friday 12th October 2012
View Replies!

Full screen xml gallery with proportional resize functions

I have created an dynamic XML gallery. Does anyone know the coding to insert into my script in order to make my XML gallery a no scale full screen gallery with proportional resize functions\t // import tweener import caurina.transitions.Tweener; // delay between slides const TIMER_DELAY:int = 5000; // fade time between slides const FADE_TIME:int = 1; // reference to the current slider container var currentContainer:Sprite; // index of the current slide var intCurrentSlide:int = -1; // total slides var intSlideCount:int; // timer for switching slides var slideTimer:Timer; // slides holder var sprContainer1:Sprite; var sprContainer2:Sprite; // slides loader var slideLoader:Loader; // url to slideshow xml var strXMLPath:String = "slideshow-data.xml"; // slideshow xml loader var xmlLoader:URLLoader; // slideshow xml var xmlSlideshow:XML; function init():void { // create new urlloader for xml file xmlLoader = new URLLoader(); // add listener for complete event xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete); // load xml file xmlLoader.load(new URLRequest(strXMLPath)); // create new timer with delay from constant slideTimer = new Timer(TIMER_DELAY); // add event listener for timer event slideTimer.addEventListener(TimerEvent.TIMER, switchSlide); // create 2 container sprite which will hold the slides and // add them to the masked movieclip sprContainer1 = new Sprite(); sprContainer2 = new Sprite(); mcSlideHolder.addChild(sprContainer1); mcSlideHolder.addChild(sprContainer2); // keep a reference of the container which is currently // in the front currentContainer = sprContainer2; } function onXMLLoadComplete(e:Event):void { // create new xml with the received data xmlSlideshow = new XML(e.target.data); // get total slide count intSlideCount = xmlSlideshow..image.length(); // switch the first slide without a delay switchSlide(null); } function fadeSlideIn(e:Event):void { // add loaded slide from slide loader to the // current container currentContainer.addChild(slideLoader.content); // clear preloader text mcInfo.lbl_loading.text = ""; // fade the current container in and start the slide timer // when the tween is finished Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:function() { slideTimer.start(); }}); } function switchSlide(e:Event):void { // check, if the timer is running (needed for the // very first switch of the slide) if(slideTimer.running) slideTimer.stop(); // check if we have any slides left and increment // current slide index if(intCurrentSlide + 1 < intSlideCount) intCurrentSlide++; // if not, start slideshow from beginning else intCurrentSlide = 0; // check which container is currently in the front and // assign currentContainer to the one that's in the back with // the old slide if(currentContainer == sprContainer2) currentContainer = sprContainer1; else currentContainer = sprContainer2; // hide the old slide currentContainer.alpha = 0; // bring the old slide to the front mcSlideHolder.swapChildren(sprContainer2, sprContainer1); // create a new loader for the slide slideLoader = new Loader(); // add event listener when slide is loaded slideLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, fadeSlideIn); // add event listener for the progress slideLoader.contentLoaderInfo.addEventListener(Pro gressEvent.PROGRESS, showProgress); // load the next slide slideLoader.load(new URLRequest(xmlSlideshow..image[intCurrentSlide].@src)); // show description of the next slide mcInfo.lbl_description.text = xmlSlideshow..image[intCurrentSlide].@desc; // show current slide and total slides mcInfo.lbl_count.text = (intCurrentSlide + 1) + " / " + intSlideCount + " Slides"; } function showProgress(erogressEvent):void { // show percentage of the bytes loaded from the current slide mcInfo.lbl_loading.text = "Loading..." + Math.ceil(e.bytesLoaded * 100 / e.bytesTotal) + "%"; } // init slideshow init();
VIEWS ON THIS POST

105

Posted on:

Friday 12th October 2012
View Replies!

How would I get an MC to resize proportionally with embedded swf

his isn't as simple as it seems. Basically, I'm loading an external swf that calls an XML file and plays a slideshow animation that enlarges or contracts the pics being loaded (similar to a Ken Burns effect). The external swf is loaded into a movieclip holder named "mc" on the main fla file. The movieclip holder's dimensions initially, are the same as the fla file. However, I want the loaded swf to scale proportionally according to the stage after it gets resized. So, if I click and drag the stage so that it is wider, the movieclip holder's width also widens, but it's height scales proportionally. If the externally loaded swf had content that fit the stage exactly, without any hidden objects offstage, the movieclip playing on the main fla scales proportionally without any problem. So far, so good. Problem, since the externally loaded swf is animated with pics that get bigger or smaller, or even pan from left to right, the size of the movieclip on the main fla file resizes NOT according to the movieclip holder's width and height, but to it's content's width and height that are constantly changing. I think you can guess my question now. How can I get the movieclip holder to resize proportionally according to it's own width and height, and not it's content's width and height Here's the code I have so far. Note that I created a movieclip called "mc" on the main fla file. Code: import fl.transitions.Tween; import fl.transitions.easing.*; import flash.display.MovieClip; import flash.events.MouseEvent; import flash.text.*; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; var swf:URLRequest = new URLRequest("profile_slide.swf"); var myloader:Loader = new Loader(); myloader.load(swf); mc.addChild(myloader); stage.addEventListener(Event.RESIZE, resizeListener); function resizeListener(e:Event):void { if (stage.stageWidth > stage.stageHeight) { mc.width = stage.stageWidth; mc.scaleY = mc.scaleX; } else { mc.height = stage.stageHeight; mc.scaleX = mc.scaleY; } trace(mc.width); trace(mc.height); }
VIEWS ON THIS POST

96

Posted on:

Friday 12th October 2012
View Replies!

on resize bad tween help

hi i'v a problem, i write this code for a website but when i resize the page as2 return on the intro page it's the site's main page! i'll like the page don't move when i resize the browser, how can i do this is the code... please help!! [COLOR="black"][COLOR="black"]_global.setStage = function() { slis = new Object(); slis.onResize = function() { //imposto le coordinate del clip intro tramite tween introdef.tween("_x",Stage.width / 2,2,"expo"); introdef.tween("_y",Stage.height / 2,2,"expo"); collezione.tween("_x",Stage.width*2,2,"expo"); collezione.tween("_y",Stage.height / 2,2,"expo"); storedef.tween("_x",Stage.width*2,2,"expo"); storedef.tween("_y",Stage.height / 2,2,"expo"); contattidef.tween("_x",Stage.width*2,2,"expo"); contattidef.tween("_y",Stage.height / 2,2,"expo"); Object(_root).foto.collezione.onRelease = function() { collezione.tween("_x",Stage.width/2,2,"expo"); collezione.tween("_y",Stage.height / 2,2,"expo"); introdef.tween("_x",Stage.width / 2 - Stage.width,2,"expo"); introdef.tween("_y",Stage.height / 2,2,"expo"); storedef.tween("_x",Stage.width*2,2,"expo"); storedef.tween("_y",Stage.height / 2,2,"expo"); contattidef.tween("_x",Stage.width*2,2,"expo"); contattidef.tween("_y",Stage.height / 2,2,"expo"); }; Object(_root).foto.store.onRelease = function() { collezione.tween("_x",Stage.width/2-Stage.width,2,"expo"); collezione.tween("_y",Stage.height / 2,2,"expo"); introdef.tween("_x",Stage.width / 2 - Stage.width,2,"expo"); introdef.tween("_y",Stage.height / 2,2,"expo"); storedef.tween("_x",Stage.width/2,2,"expo"); storedef.tween("_y",Stage.height / 2,2,"expo"); contattidef.tween("_x",Stage.width*4,2,"expo"); contattidef.tween("_y",Stage.height / 2,2,"expo"); }; Object(_root).foto.contatti.onRelease = function() { collezione.tween("_x",Stage.width/2-Stage.width,2,"expo"); collezione.tween("_y",Stage.height / 2,2,"expo"); introdef.tween("_x",Stage.width / 2 - Stage.width,2,"expo"); introdef.tween("_y",Stage.height / 2,2,"expo"); storedef.tween("_x",Stage.width/2-Stage.width,2,"expo"); storedef.tween("_y",Stage.height / 2,2,"expo"); contattidef.tween("_x",Stage.width/2,2,"expo"); contattidef.tween("_y",Stage.height / 2,2,"expo"); }; }; Stage.addListener(slis); slis.onResize(); };
VIEWS ON THIS POST

198

Posted on:

Wednesday 17th October 2012
View Replies!

resize image without artifact

, I'm not a coder, but I recently had someone build me a Flash site ( I think using AS2). Part of the site includes scaling up a background image to the browser size, but I'm seeing terrible artifacts when this is done. Take a look at the home page of this link to see what I mean: cincworks.com I was wondering if someone could tell me if it is at all possible to scale up an image like this in Flash WITHOUT the resulting artifacts
VIEWS ON THIS POST

60

Posted on:

Wednesday 17th October 2012
View Replies!

Flash banner to resize full screen

I wanted to create something similar like : http://store.titleboxing.com/title-m...iners-kit.html see the scrolling banner with logo on top Is it possible to have the banner to resize to full screen I also need to be able to update the images inside the banner when needed. I am happy to pay as well. Just pm me for details Thank you
VIEWS ON THIS POST

63

Posted on:

Thursday 18th October 2012
View Replies!

Image resizes perfectly with larger monitor?

On this site http://www.hookedonwalls.com/ the images are full screen at 1024x768 and even when you have a larger monitor, they still pretty much maintain their quality. How do you code this in Flash CS3 thx
VIEWS ON THIS POST

66

Posted on:

Friday 19th October 2012
View Replies!

HTML covering flash content on resize

I'm having a problem with a finished flash piece where, in the most simple scenario, if the user screen size is very small, the background html comes up over the bottom of the flash movie and covers a portion of it. The effect can also be seen if you resize the browser window down fairly small. I want the user the be able to see all the content fine, even if they have to scroll a lot to achieve it. I have my flash set up with: Code: stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE, handleResizing); where handleResizing just deals with various internal position on resize. The html setup just uses basic css for layout. I have tried upping the flashcontent's z-index but to no avail. Any ideas appreciated,
VIEWS ON THIS POST

60

Posted on:

Friday 19th October 2012
View Replies!

resize background fullscreen in projector

Hi I'm creating a flash projector file and need to scale background full-screen. The background is a gradient shape. I made it full screen and resized background so width and height is stage width and height but it still won't work. Any ideas
VIEWS ON THIS POST

80

Posted on:

Friday 19th October 2012
View Replies!

stage resize

I'm very new to action script and I have a problem with stage resize. I have a small rectangle on the right bottom of my stage. When I resize the stage, I want my rectangle keep its size (no scale) and position ( always on the right bottom of the stage). Here is my code: mymc._width = 50 mymc._height = 20 Stage.scaleMode = "noScale"; function setPosition() { mymc._y = Stage.height - mymc._height -10; mymc._x = Stage.width - mymc._width - 10; } stageListener = new Object (); stageListener.onResize = function() { setPosition(); }; I know that there is something wrong because it doesn't work. Hope you can fix it.
VIEWS ON THIS POST

52

Posted on:

Saturday 20th October 2012
View Replies!

resize help

hey, i've run into a problem. when a moive clip is clicked in my program it's instance is saved in a var _root.dis_one . My code makes the movie clip move when the shift key isn't down according to the arrow keys, and it is supposed to resize the clip if the shift key is down _root.dis_one is storing the proper var, but i am having a trouble with the resizing part. It will rezise a pre-maid movie clip, but it won't resize my dynamic movie clips. is there a certain way to rezise a dynamic MC thanks! -James note: where it says Scale i ment to have typed scale srry. ActionScript Code: if(Key.isDown(Key.SHIFT)){ if(Key.isDown(Key.UP)){ _root.dis_one._yScale--; } if(Key.isDown(Key.DOWN)){ _root.dis_one._yScale++; } if(Key.isDown(Key.LEFT)){ _root.dis_one._xScale--; } if(Key.isDown(Key.RIGHT)){ _root.dis_one._xScale++; } }else{ if(Key.isDown(Key.UP)){ _root.dis_one._y--; } if(Key.isDown(Key.DOWN)){ _root.dis_one._y++; } if(Key.isDown(Key.LEFT)){ _root.dis_one._x--; } if(Key.isDown(Key.RIGHT)){ _root.dis_one._x++; } }
VIEWS ON THIS POST

63

Posted on:

Saturday 20th October 2012
View Replies!

mc isn't located orrectly until browser is resized

Hi , New to posting on Kirupa. I do read through older posts and threads for help but I haven't found a great answer to my little problem, so I thought I'd post. I have a full-browser flash site, with a movie clip horizontal nav bar at the bottom of the page. I've got everything working well (the background rescaling to fill the browser when the browser window size changes, the horizontal nav bar at the bottom....) for the most part. One thing is really getting to me however. Check out the example I made here: http://www.rachelahampton.com/mon.html Upon loading, the nav bar sits in the middle of the page. The moment you re-size the browser, it pops into the deed location near the bottom and stays there, even if you continue to re-size. However I want it to appear where it should at the bottom of the window on page load, without having to re-size the browser window. In the following code, main is the placeholder for the image slideshow that runs in the full browser, menu_mc is the menu. import com.greensock.TweenLite; import fl.motion.easing.*; import flash.events.MouseEvent; //set stage for FBF //set stage for FBF stage.align = "TL"; stage.scaleMode = "noScale"; //define dynamic aspect ratios var mainHeight = main.height / main.width; var mainWidth = main.width / main.height; //add event listener to the stage stage.addEventListener(Event.RESIZE, sizeListener); //conditional statement to account for various initial browswer sizes and proportions function scaleProportional():void { if ((stage.stageHeight / stage.stageWidth) < mainHeight) { main.width = stage.stageWidth; main.height = mainHeight * main.width; } else { main.height = stage.stageHeight; main.width = mainWidth * main.height; }; } //center picture on stage function centerPic():void { main.x = stage.stageWidth / 2; main.y = stage.stageHeight / 2; } // make listener change picture size and center picture on browser resize function sizeListener(e:Event):void { scaleProportional(); centerPic(); } //run initial locations and size scaleProportional(); centerPic(); stage.addEventListener(Event.RESIZE, resizeListener); function resizeListener (e:Event):void { menu_mc.x = 960; menu_mc.y = stage.stageHeight-75; } TweenLite.to(main, 1, {alpha:1}); TweenLite.to(menu_mc, 1, {alpha:1});
VIEWS ON THIS POST

192

Posted on:

Thursday 25th October 2012
View Replies!

I have a problem with position object when use event.resize

Hi Guys, I'm a newbie in flash as3. And also now I have some problem when expanded with browser scale then my text menu will overlap away. How can i reset the position here is screen, import fl.transitions.easing.*; import fl.transitions.*; import flash.text.TextField; stage.scaleMode = "noScale"; stage.align = "TL"; stage.addEventListener(Event.RESIZE,sizeHandlers); stage.dispatchEvent(new Event(Event.RESIZE)); var logo:MovieClip = new mcLogo(); logo.x = logo.y =10; this.addChild(logo); var home:MovieClip; var work:MovieClip; var what:MovieClip; var who:MovieClip; var careers:MovieClip; var contact:MovieClip; function sizeHandlers(e:Event){ home= new mainMenu(); home.x = stage.stageWidth - 40; home.y = 40; this.addChild(home); work= new mainMenu(); this.addChild(work); work.txt1.text="THE WORK"; work.txtButton.txt2.text ="THE WORK"; work.x =home.x; work.y =home.y+25; what= new mainMenu(); this.addChild(what); what.txt1.text="WHAT WE DO"; what.txtButton.txt2.text ="WHAT WE DO"; what.x =work.x; what.y =work.y+25; who = new mainMenu(); this.addChild(who); who.txt1.text="WHO WE ARE"; who.txtButton.txt2.text ="WHO WE ARE"; who.x =what.x; who.y =what.y+25; careers = new mainMenu(); this.addChild(careers); careers.txt1.text="CAREERS"; careers.txtButton.txt2.text ="CAREERS"; careers.x =who.x; careers.y =who.y+25; contact = new mainMenu(); this.addChild(contact); contact.txt1.text="CONTACT"; contact.txtButton.txt2.text ="CONTACT"; contact.x =careers.x; contact.y =careers.y+25; home.buttonMode = true; home.useHandCursor = true; home.mouseChildren = false; what.buttonMode = true; what.useHandCursor = true; what.mouseChildren = false; work.buttonMode = true; work.useHandCursor = true; work.mouseChildren =false; who.buttonMode = true; who.useHandCursor = true; who.mouseChildren = false; careers.buttonMode = true; careers.useHandCursor =true; careers.mouseChildren =false; contact.buttonMode =true; contact.useHandCursor =true; contact.mouseChildren =false; home.addEventListener("mouseOver", mouseRollOver); what.addEventListener("mouseOver", mouseRollOver); work.addEventListener("mouseOver", mouseRollOver); who.addEventListener("mouseOver", mouseRollOver); careers.addEventListener("mouseOver", mouseRollOver); contact.addEventListener("mouseOver", mouseRollOver); home.addEventListener("mouseOut", mouseRollOut); what.addEventListener("mouseOut", mouseRollOut); work.addEventListener("mouseOut", mouseRollOut); who.addEventListener("mouseOut", mouseRollOut); careers.addEventListener("mouseOut", mouseRollOut); contact.addEventListener("mouseOut", mouseRollOut); home.addEventListener("click", mouseClick); what.addEventListener("click", mouseClick); work.addEventListener("click", mouseClick); who.addEventListener("click", mouseClick); careers.addEventListener("click", mouseClick); contact.addEventListener("click", mouseClick); resizePosition(); //stage.addEventListener(Event.RESIZE,resizePosition ); } function mouseRollOver(e:MouseEvent){ var easingFunc = Back.easeOut; var ysa = 39.8; var yfa =10.8; var duration =0.5; var myTween:Tween = new Tween(e.target.txtButton, "y", easingFunc, ysa, yfa, duration, true); var easingFunc2 = Regular.easeOut; var ysa2 = -18.8; var yfa2 = -45.8; var duration2 =0.5; var myTween2:Tween = new Tween(e.target.txt1, "y", easingFunc2, ysa2, yfa2, duration2, true); } function mouseRollOut(e:MouseEvent) { var easingFunc3 = Regular.easeOut; var ysa3 = 10.8; var yfa3 =39.8; var duration3 = 0.5; new Tween(e.target.txtButton, "y", easingFunc3, ysa3, yfa3, duration3, true); var easingFunc4 = Regular.easeOut; var ysa4 = -45.8; var yfa4 = -18.8; var duration4 = 0.5; new Tween(e.target.txt1, "y", easingFunc4, ysa4, yfa4, duration4, true); } function mouseClick(e:MouseEvent){ clearColor(); var colorOrange:uint = 0xFF6600; var colorGray:uint = 0xCCCCCC; switch (e.target){ case home: e.currentTarget.txt1.textColor=colorOrange; break; case work: e.currentTarget.txt1.textColor=colorOrange; break; case who: e.currentTarget.txt1.textColor=colorOrange; break; case what: e.currentTarget.txt1.textColor=colorOrange; break; case careers: e.currentTarget.txt1.textColor=colorOrange; break; case contact: e.currentTarget.txt1.textColor=colorOrange; break; default : e.currentTarget.txt1.textColor=colorGray; } } function clearColor():void{ home.txt1.textColor=0xCCCCCC; work.txt1.textColor=0xCCCCCC; what.txt1.textColor=0xCCCCCC; who.txt1.textColor=0xCCCCCC; careers.txt1.textColor=0xCCCCCC; contact.txt1.textColor=0xCCCCCC; } function resizePosition():void{ home.x = stage.stageWidth - home.y; work.x =home.x; what.x =work.x; who.x =what.x; careers.x =who.x; contact.x =who.x; }
VIEWS ON THIS POST

98

Posted on:

Thursday 25th October 2012
View Replies!

How do I resize a movieClip?

I understand that this is something really, really basic, but for all my Googling I can't seem to find a clear answer. I have a movieClip with around 1500px of vertical content inside (a grid of images). But when I trace its height, it says it's only 400px high. I need it to actually report a height of 1500px, or it doesn't scroll properly. But this doesn't work: Code: content.height = 1500; It stretches out the content. And this doesn't work: Code: content.height = 1500; content.scaleX = content.scaleY; It just makes the content HUUUUUUUGE. And, I mean, I understand that in Flash setting a width and height messes with the scale, so this should be entirely expected. But there has to be a way to set the height of a movieClip. One suggestion I found was to add another movieClip or sprite inside of the movieClip you're trying to set the height of. I added another movieClip with a height of 1500px, but it didn't have any affect: Code: var sizer:Sprite = new Sprite(); sizer.height = 1500; content.addChild(sizer); I still get around 400px. So, what's the correct way of doing this There's no way it could be this hard to do something as simple as set a height. What am I missing
VIEWS ON THIS POST

79

Posted on:

Thursday 25th October 2012
View Replies!

Stage minimum resize

I've got a resize listener where I change my movieclips' dimensions and positions Code: stage.addEventListener (Event.RESIZE, resizeListener); But how I set the minimum allowed resize of the stage I don't want the stage to be smaller than 1024x600 for example.
VIEWS ON THIS POST

70

Posted on:

Thursday 25th October 2012
View Replies!