The problem is this, I will be making a swf whose length will change, depending on what the user writes, and it will certainly be longer than the screen. I don't want to make a really long swf, that people can scroll down even though there is nothing there, on the off chance that someone might enter enough text for it to need to be that long, and what if they write even more!
Also, most of the things that were addressing this, were trying to resize the stage, so it could fit in the browser window, and again, not my problem. Anyway, the code that they gave out was really complex, and I don't like to use code unless I understand what it actually means...
So, first things first, the 'DIV' tag.
Apparently, you can put this tag around things, give it an id attribute, and then refer to it with JavaScript. But, you can do this with ordinary tags anyway, so why bother (unless you have more than one swf on the page).
It works like this:
<embed id="embedtag" src=...
and then in your javascript function:
var swfTag = document.getElementById('embedtag');
Then you can alter its attributes:
swfTag.setAttribute('height','600');
The stage of the swf will automatically update, it doesn't refresh the movie or anything.
Then I had a bit of a problem with how the swf would be displayed on the new stage. It wouldn't be aligned to the side. Now I checked, and the movie clip that was on 0, still thought it was on 0, so it wasn't moving. I fixed this by adding an attribute to the embed tag -salign="lt"-aligning it's side to the left. I wasn't using the code output by the CS3 flash publisher, because it spits out so much javascript, I can't make sense of it, or how to alter it.
I put a button in my flash movie that increased the size of one of the movie clips on screen, and then used ExternalInterface to nake sure that the stage size on the html side of things was big enough, and with the salign="lt" bit, it worked.
I haven't tried it with the ie tag yet, what are the chances that I will come across some unexpected problems...quite high, I'd say.
No comments:
Post a Comment
Please enter your message here...