Reply LinkBack Thread Tools Search this Thread
Old 10-09-2003, 10:54   #1 (permalink)
flatcat
beauty through chaos
 
flatcat's Avatar
 
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.
  Reply With Quote
Old 10-09-2003, 11:13   #2 (permalink)
Mr Fred
Magazines™
 
Mr Fred's Avatar
 
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 with flash - can be a nightmare on mac to get windoes going via flash and this method
  Reply With Quote
Old 10-09-2003, 11:14   #3 (permalink)
Mr Fred
Magazines™
 
Mr Fred's Avatar
 
Join Date: Mar 2003
Location: Glasgow..
Posts: 11,263
ps but some line breaks in you post above
  Reply With Quote
Old 10-09-2003, 13:17   #4 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,672
Not sure at first glance, i'll see if I can look through it properly tomorrow morning.
  Reply With Quote
Old 10-09-2003, 17:42   #5 (permalink)
flatcat
beauty through chaos
 
flatcat's Avatar
 
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.
  Reply With Quote
Old 10-09-2003, 22:49   #6 (permalink)
flatcat
beauty through chaos
 
flatcat's Avatar
 
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
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8