-
resize browser from flash??
Hì u all,
I really would like to change/resize the browser dimentions from flash when a object for example is bouncing on it, the problem is that I have no idea how this could work, and what to search...
please help!!!
salta
-
Senior Member
I think this will work, although I've never used it:
Code:
getURL("javascript:window.resizeTo(800,600)");
This should resize the window to 800 x 600.
-
hì ninjakannon, thanks for repling so fast, do u know also how I could detect the position of where the object is bouncing (because is a random movement).. and say than to the browser to reach that point?
-
but this script opens a new window with that size.. I need to resize the current window...
-
Senior Member
Ok, sorry that didn't work. I looked up javascript on google and found a function that resized the window, but obviously not the current one.
Basicaly you can do getURL("javascript:javaFunction()"); in flash, this will call the javascript function in place of 'javaFunction'. I would expect that this is the method that you will have to use; although I do not know what javascript function you will have to use.
And your object, if it is in flash then get its X and Y position using:
Code:
_root.bouncingObject._x
_root.bouncingObject._y
Where 'bouncingObject' is, you will need to put the instance name of the bouncing movieClip. The X and Y values are where the movieclip is on the stage.
Hope this helps
-
thanks, I'll search for the javascript now..
-
what about the flash.external.ExternalInterface class?
or a javascript funcion that comunicates with the actionscripts??
help please!!!!!
I found nothing..
-
Senior Member
Sorry, but I'm stuck on this one I've never done it before and I havn't found anything useful.
-
here what I have in the flash file:
import flash.external.ExternalInterface;
ExternalInterface.call( "resize", width, height );
prova.onPress = function() {
ismoving();
prova.startDrag();
}
function ismoving (){
width = prova._x;
Stage.width = prova._x;
height = prova._y;
Stage.height = prova._y;
}
var stageL:Object=newObject();
Stage.addListener(stageL);
here the javascript:
<script>
function resize(width, height)
{
window.resizeTo(width,height);
}
-->
</script>
but it doesn't work!!!!!
Anybody there that has an idea of what is wrong or what is missing??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|