Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash 5 actionscript - opening a window

Status
Not open for further replies.

jennsite

Technical User
Jul 5, 2004
4
US
Hi. I worked this script out a month ago and have since had my hard drive crash. Since I only uploaded the .swf and the .html, I can no longer see the code I used or remember it. The functioning page is here:


the bottom button on the left that says, 'Login Instructions for Passport' - when you click it you get a small window with instructions.

The html page has this at the top:

<script language=javascript>
function myWindow(textForWindow){ //do not place window params on this line
var htmlString = "<html>" + textForWindow + "</html>";
myWindow = open('','myWin','height=270,width=300');//<--- alter the window params here
myWindow.document.write(htmlString);
}
</script>

I know the above works. My problem is that there was also a bit of code on the button in the fla file and i can't remember what it was.

It seems like I used GetUrl and put the text of the small window in the URL field somehow.. it's just not working.

Can anyone help me?

here's what I've got now.. same code in the html page; this is the code on the button in the fla file:

on (release) {
getURL ("java script:myWindow('<html>TO ACCESS \"GREAT\" FILES IN PASSPORT <br>1. Access PassPort II site and scroll down to bottom of page. In the SECRET WORD box type \"GREAT\" and click \"Login\". <br>2. Messages and lessons are listed in order that they were posted. Click on lesson title to preview. <br>3. No changes can be made through secret word site, it is for viewing purposes only. <br>Log Out when finished.</html>')");
}

This permutation succeeded in stopping the errors from popping upon publication. However, I upload it and nada - nothing happens when you clcik it. What have I done wrong?
 
Remove the space between java and script.

Code:
on (release) {
getURL ("[highlight]javascript[/highlight]:myWindow('<html>TO ACCESS \"GREAT\" FILES IN PASSPORT <br>1. Access PassPort II site and scroll down to bottom of page. In the SECRET WORD box type \"GREAT\" and click \"Login\". <br>2. Messages and lessons are listed in order that they were posted. Click on lesson title to preview. <br>3. No changes can be made through secret word site, it is for viewing purposes only. <br>Log Out when finished.</html>')");
}

Hope it helps!

Wow JT that almost looked like you knew what you were doing!
 
thanks for responding.

when i read your post I couldn't believe ii'd left a space there.. sure enough, when i went and checked, there was no space.. don't know how i posted it like that. But, anyway, no space, still doesn't work. doesn't pull any errors, though, but doesn't work. no window opens. Any other ideas?
 
Remove the <html> tags from the getURL call. You don't need them they are in the javascript.

Code:
on (release) {
getURL ("javascript:myWindow('TO ACCESS \"GREAT\" FILES IN PASSPORT <br>1. Access PassPort II site and scroll down to bottom of page. In the SECRET WORD box type \"GREAT\" and click \"Login\". <br>2. Messages and lessons are listed in order that they were posted. Click on lesson title to preview. <br>3. No changes can be made through secret word site, it is for viewing purposes only. <br>Log Out when finished.')");
}

That should do it.

Wow JT that almost looked like you knew what you were doing!
 
you're a very special person for helping. :) Thank you. It works again. I'm so relieved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top