stageListener
- Started
- Last post
- 12 Responses
- Kiko
the following code is to move a scrollbar to the right hard side of my screen:
stageListener = new Object();
stageListener.onResize = function ()
{
heightDifference = (Stage.height - 600)/2;
widthDifference = (Stage.width - 800)/2;
dragMC._x = Stage.width - widthDifference - dragMC._width;
scrolledMCrecipient._y = -heightDifference;}
Stage.addListener(stageListener...it works fine with IE but doesnt with Firefox, neither does the scroll whell work with firefox.
Any ideas please?
- krust0
could be way off the mark but it could be to do with your html DOCTYPE scripting???
- Kiko0
I already removed this,
And it at least shows full screen in firefox, so you a re probably right.
Ill let you know thanx!
- Kiko0
I actually found out that it does work in firefxo however it needs to be resized before the script comes into effect.
Any ideas anyone?
Please?
- Jnr_Madison0
You need to check the size of the stage when it loads. The script is only checking on resize.
- UndoUndo0
initialise your stage listener when it loads i.e call the function after it has been defined.
- Kiko0
any ideas what the code for that would be please?
- UndoUndo0
stageListener.onResi ze = function ()
{
heightDifference = (Stage.height - 600)/2;
widthDifference = (Stage.width - 800)/2;
dragMC._x = Stage.width - widthDifference - dragMC._width;
scrolledMCrecipient ._y = -heightDifference;}
Stage.addListener(st ageListener);stageListenerInit = function ()
{
heightDifference = (Stage.height - 600)/2;
widthDifference = (Stage.width - 800)/2;
dragMC._x = Stage.width - widthDifference - dragMC._width;
scrolledMCrecipient ._y = -heightDifference;}
stageListenerInit ();there you go.
- Kiko0
thanx Undo!
but it doesnt seem to work. I have pasted in into the same place where the previous script was placed.
- UndoUndo0
have you got a link to the page?
- Kiko0
oh its ok its working fine it was just missing the:
stageListener = new Object(); before the code but its works perfecly
so its seemsthanx so much!!!
- UndoUndo0
oops yeah. sorry about that!! good luck
- Kiko0
thanx.
got a few more things to fix it should be good.