flash actionscript:
I am trying to dynamicaly load a swf file into the one that I am creating, I then want to put a button over the top of it. I have figured out how to load the movie by: loadMovie(unescape(_root.swfURL),"_root"); I want to put a button over the top and have: on(release){ getURL(unescape(_root.linkURL),"_blank") } the loading works fine, but I can't get a button to float over the top of the entire thing: This is so I can run everything through one flash document: example: <object>.... src="mask.swf?swfURL=http://localhost/test.swf&linkURL=http://www.yahoo.com" ....</object> How can I put a button over everything? Since they are different sizes, I want to resize the button to Stage.width. I can not figure it out, I would appreciate it if someone could point me in the right direction.
First of all, you probably want to load the movie into a separate movieclip, not on the root, because, where will your button be? createEmptyMovieClip("holder",1); loadMovie(unescape(_root.swfURL),"holder"); createEmptyMovieClip('myLink',2); with(myLink){ beginFill(0x000000,100); lineTo(Stage.width,0); lineTo(Stage.width,Stage.height); lineTo(0,Stage.height); endFill(); } myLink.onRelease = function(){ getURL(unescape(_root.linkURL),"_blank") }
You are on the verge of wrting the entire document I have been working on for three days. As you can tell I am very new to ActionScript. How can I make that transparent...I want the button to be transparent over the loaded movie, so you can see the movie, but when you click it goes to the _root.linkURL? I tried to take out all the beginFill() stuff, but then the link is not there. I will continue to look into this, thanks for your help so far.
Oh whoops. Change the 5th line to:
That works exactly how I need it to...but.... I have the stage set to 100x300 and it works, I can load other movies in there as long as everything is 100x300: like <object>......width=100 height=300....</object>... But then I want to load a 150x400 movie. again: <object>......width=150 height=400....src="mask.swf?swfURL=...." The second one (150x400) doesn't work. It is scaled down..and doesn't even start in the top left. Can you point me in the right direction to fix these problems? I tried the holder.moveTo(0,0) to put it in the top left, but that didn't work. I tried the holder._width = Stage.width, and the height, but that didn't work either.
Don't see what you're looking for? Try a search.
|