Go Back   Flashtory Support Forum > Flash Files Support > Flash Menus > Horizontal Scroller Motion Blur

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-08-2009, 02:23 AM
Junior Member
 
Join Date: Feb 2009
Posts: 3
Default Have mask adjust width on resize

Hello,

Love the scrollbar! I want to use it in a full screen movie and I was hoping on a suggestion on how I could have my scrollbar resize the width based on the current stage width. I can't figure out where to put the event listener in your code. Currently have the following code in my root to adjust my backround image on a resize. Any way I could incorporate this in your .as files somewhere?

Code:
sizeListener = new Object();

sizeListener.onResize = function() {

mcbg.forceSmoothing = true;	

if ((Stage.height / Stage.width) < picHeight) {

mcbg._width = Stage.width;
mcbg._height = picHeight * mcbg._width;
} else {
mcbg._height = Stage.height;
mcbg._width = picWidth * mcbg._height;
};
mcbg._x = Stage.width / 2;
mcbg._y = Stage.height / 2;
}

Stage.addListener(sizeListener);
Thank you for your help very much!
Reply With Quote
  #2 (permalink)  
Old 02-10-2009, 08:58 AM
Flashtory Staff
 
Join Date: Feb 2009
Posts: 239
Default

The scroller will not behave ok when resizing the mask dinamically. This happens because the thumbnails have different width's. That's why there is a variable in the .xml file called increaseTolByTimes="your_number".

If you will resize the mask dinamically when resizing the Stage you will have blank spaces at the right or at the left, I do not recommend it.
Reply With Quote
  #3 (permalink)  
Old 02-10-2009, 06:24 PM
Flashtory Staff
 
Join Date: Feb 2009
Posts: 239
Default

Hello I forgot that I came up with a fix for this a while ago.

It's pretty simple, in main.as you have a variable called "actualMaskWidth". That variable must be resized by width.

You can access it directly because it's a static variable

public static var actualLstWidth:Number;

in your project or in a frame you should wrote down:
import flashtory.hs.main; // like so the variable will be accesible to you

main.actualLstWidth = your_number; // set the width -> Stage.width for fullscreen scroller.

All the best !
Reply With Quote
  #4 (permalink)  
Old 02-10-2009, 07:37 PM
Junior Member
 
Join Date: Feb 2009
Posts: 3
Default Scrollbar Width on Resize

Hi Razvan,

First off I would like to sincerely thank you for getting back to me. I sincerely appreciate your time.

I tried what you suggested and it made a large blank space appear on the right side. I don't think it is possible without destroying and rebuilding the whole bar on a resize.

Currently I have modified

<code>
settings.maskWidth = Stage.width;
</code>

in main.as which is causing it to resize to the stage on the initial build, but of course it does not work if a resize happens after that. Take a look here if you like mc_DMW

If I could embed the scrollbar in a movie clip then I could just resize the MC very easily, don't mind if I lose some quality on the resize. If I put MAIN mc in another mc it won't run, will only run under root.

Thank you again for your time and expertise!
Reply With Quote
  #5 (permalink)  
Old 02-11-2009, 03:29 AM
Flashtory Staff
 
Join Date: Feb 2009
Posts: 239
Default

Try this instead:

in main.as

go to line 101 and add this ->


Stage.addListener(this);

go to line 107 and add this ->

public function onResize(){
actualMaskWidth =mask._width = Stage.width - 20;
}

Now it will work just fine !

All the best !
Reply With Quote
  #6 (permalink)  
Old 02-11-2009, 09:56 PM
Junior Member
 
Join Date: Feb 2009
Posts: 3
Default Thank you!

WOW! perfect, thank you so much! Look forward to working with you guys more in the future!
Reply With Quote
  #7 (permalink)  
Old 02-12-2009, 12:35 AM
Flashtory Staff
 
Join Date: Feb 2009
Posts: 239
Default

You're welcome
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
based on a modified theme of CompleteGFX