| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
beauty through chaos
Join Date: Jul 2003
Location: Vancouver, British Columbia
Posts: 768
|
getURL without using a mouseclick?
basically, the following is the actionscript I'm using to call the getURL command...the commands are being extracted as attributes from an xml file. For some reason, even though I think that I'm doing this correctly, I can't seem to get it to work, any idea on how to fix this, or how to call the getURL function from outside of a button? I think there's something going on with the getURL function, because I believe I'm calling the xml attributes properly, or maybe it's how it's calling them in reference to the javascript? PLEH, anyways....the javascript function is the code below the following actionscript. function launchFile(value) { //compares the user's paramater to each of the idArray values for (i=0; ((value != _root.invisDir.idArray[i]) && (i<_root.invisDir.idArray.length)); i++) { null; } if (value != _root.invisDir.idArray[i]) { _root.userInput.text = "Invalid Entry"; } else { _root.getURL("javascript:NewWindow('_root.invisDir .menuItem[i].attributes.url', '_root.invisDir.menuItem[i].attributes.title', '_root.invisDir.menuItem[i].attributes.width', '_root.invisDir.menuItem[i].attributes.height','no')"); } } //javascript function NewWindow(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +' ,scrollbars='+scroll+',resizable' win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } any help you might provide would be greatly appreciated [edit] Even tho it appears that there's a space in "javascript" in the code there actually is none.... audentes fortuna iuvat
Flatcat Last edited by flatcat : 10-09-2003 at 22:22. |
|
|
|
|
|
#2 (permalink) |
|
Magazines™
Join Date: Mar 2003
Location: Glasgow..
Posts: 11,263
|
way beyond what i actionscript (only a designer ) but i think you should rethink the way you are calling it or way it needs all this if you could explain whay it needs doing in this manner then maybe some of the lateral thinkers here could help (even if they dont know flash scripting) also think about that java shit |
|
|
|
#5 (permalink) |
|
beauty through chaos
Join Date: Jul 2003
Location: Vancouver, British Columbia
Posts: 768
|
heh, k, I'll break it all down for ya here... function launchFile(value) { //compares the user's paramater to each of the idArray values for (i=0; ((value != _root.invisDir.idArray[i]) && (i<_root.invisDir.idArray.length)); i++) { null; } ^----the above compares the user entered parameter to the xml array to make sure that it matches the id AND does not go above the array length (amount of values). if (value != _root.invisDir.idArray[i]) { _root.userInput.text = "Invalid Entry"; } ^---checks to see if the for statement was ended because the for loop became longer than the array length or not, if so, output "Invalid Entry" to the command prompt (doing a completely command prompt based navigation in flash, dynamically generated off of xml files, original concept = original problems ;P) else { _root.getURL("java script:NewWindow('_root.invisDir.menuItem[i].attributes.url', '_root.invisDir.menuItem[i].attributes.title', '_root.invisDir.menuItem[i].attributes.width', '_root.invisDir.menuItem[i].attributes.height','no')"); } } ^----this is supposed to popup the window depending on which array value it was matched with (_root.invisDir.menuItem[i].attributes.url and the rest are just calling the xml attributes). [edit] Sick thing too is that I am more of a designer, just caught onto flash a bit and then got this crazy fresh idea in my head and which is why I'm forcing myself to do it now =\ audentes fortuna iuvat
Flatcat Last edited by flatcat : 10-09-2003 at 22:22. |
|
|
|
#6 (permalink) |
|
beauty through chaos
Join Date: Jul 2003
Location: Vancouver, British Columbia
Posts: 768
|
Welp, I got it popping up the windows now just using entered values...just gonna hafta figure out how to get it to read the xml attributes now heh audentes fortuna iuvat
Flatcat |
|
![]() |