waffe
November 7, 2002, 8:22pm
1
Check it,
This code in button works just fine;
getURL(“http://www.theweb.com.asp?index="+listbox.getSelectedItem().data["ID ”], “_blank”);
It calls a new page and passes alonge data that is in the ID tag.
But now I need to add a java pop up command to my existing url
“javascript:openNewWindow('http://www.theweb.com.asp?index= ”+listbox.getSelectedItem().data [“ID”] ',‘thewin’,‘height=525,width=350,toolbar=no,scrollbars=no’)
I have been trying for hours to get the code to work, syntax errors all the time.
Any suggestion.
system
November 7, 2002, 11:12pm
2
A typical problem with this… its the way you put your quotes.
Try this…
on (release) {
getURL("javascript:openNewWindow('http://www.theweb.com.asp?index='+listbox.getSelectedItem().data ['ID'], 'thewin','height=525,width=350,toolbar=no,scrollbars=no')");
}
Untested of course, since I don’t have your listbox or anything.
system
November 8, 2002, 5:36am
3
I have been trying this;
getURL(“javascript:openNewWindow(‘http://www.voicezam.com/search/preview_talent_reads_flash .asp?index=’+listbox.getSelectedItem().data[‘ID’], ‘thewin’,‘height=525,width=350,toolbar=no,scrollbars=no’)”);
I get an error message when I run live that says
‘listbox’ is undefined
What to do?
system
November 8, 2002, 5:39am
4
Try putting listbox.getSelectedItem().data[‘ID’] in a variable or something… like this.
listBoxInfo = listbox.getSelectedItem().data[‘ID’]
then in place of the same code in your getURL just change it to listBoxInfo.
Does that help?
system
November 8, 2002, 6:08am
5
Done
This is what got
asp?index=‘listBoxInfo’,‘thewin’…
Error says Exspected ‘]’
system
November 8, 2002, 6:12am
6
Try changing the single quotes around ID ([‘ID’]) to the standard double quotes ([“ID”])
system
November 8, 2002, 6:26am
7
Same error
This is what I had in my variable
listBoxInfo = listbox.getSelectedItem().data[“ID”]
I then tried;
listBoxInfo = listbox.getSelectedItem().data([“ID”])
Then
listBoxInfo = listbox.getSelectedItem().data([‘ID’])
Then
listBoxInfo = listbox.getSelectedItem().data[‘ID’]
All yeild the same error.
system
November 8, 2002, 6:35am
8
Hrmm, I got no syntax error when I tried.
I have this on a frame…
listBoxInfo = listbox.getSelectedItem().data["ID"];
And I have this on my button…
on (release) {
getURL("java script:openNewWindow('http://www.theweb.com.asp?index='+listBoxInfo+,'thewin','height=525,width=350,toolbar=no,scrollbars=no')");
}
Try that… :-\
You may have to backspace some of the lines in the Actions panel, when you copy and paste I noticed that part of it goes down a line when it shouldn’t.
Also, the board automatically puts a space in between Java and script that you have to remove so it becomes Javascript.
Would you mind posting a file if this doesn’t work?
It doesn’t have to be your file (if it is part of something confidential or something), but a test file with all the parts that aren’t working.
system
November 8, 2002, 6:48am
9
The Errors I am talking about are comming from the ie page flash is embeded in, not the syntax errors from flash.
With that, here are two more errors to ponder
On button…
www.theweb.com.asp? index=’+listBoxInfo+,‘thewin’,'height ect…
Error says, Syntax Error
www.theweb.com.asp? index=’+listBoxInfo,‘thewin’,'height ect…
Error says, listBoxInfo is not defined.
system
November 8, 2002, 6:51am
10
Try chaging 1) to this…
www.theweb.com.asp? index=’+listBoxInfo+<B><U>’,</U></B>thewin’,'height ect…
(the changed part is bolded and underlined)
Do you have an example .fla you could post, this would be much easier for me if I had the listbox/code/html file in front of me :-\
system
November 8, 2002, 7:11am
11
How about I will build an url so you can see the errors and maybe get a better feel.
system
November 8, 2002, 7:44am
13
This is with ?index=’+listBoxInfo+’,‘thewin’,'height
After you hit the ID button look at the lower left coerner of the page and double click the error.
These are the same errors I get when I go live.
system
November 8, 2002, 7:51am
14
It says it is expecting a ) not a ]
Hrmm… why could this be?
I am going to recheck the URL string in Flash… :-\
system
November 8, 2002, 7:56am
15
Another shot in the dark…
on (release) {
getURL("javascript:openNewWindow('http://www.theweb.com.asp?index='+listBoxInfo+''', 'thewin', 'height=525,width=350,toolbar=no,scrollbars=no')");
}
system
November 8, 2002, 8:01am
16
And another shot in the dark…
listBoxInfo = listbox.getSelectedItem().data["ID"]+"'+";
on (release) {
getURL("javascript:openNewWindow('http://www.theweb.com.asp?index='+listBoxInfo, 'thewin', 'height=525,width=350,toolbar=no,scrollbars=no')");
}
I am running out of bullets and it is really dark in here…LOL
PS: Check previous page for first shot in the dark (if you have your pages set to the default amount of posts per page, then this post should be the first on page 2)
system
November 8, 2002, 8:25am
17
Thanks for your time.
do you think this posible?
I see the consept but the code fails everytime.
I need to sleep.
Talk to ya later.
Is there a way to pop open the window without java, or a way to pop open a window that does not mess with;
getURL(‘http://www.file.asp?index=’+listbox.getSelectedItem().data['ID ’], “_blank”);
plod, thud, poop:sleep:
system
November 8, 2002, 8:29am
18
Sorry for not being able to help
There is a way to open windows without javascript in the HTML page…
http://www.kirupa.com/developer/mx/centered_popup.asp
Follow that tutorial
So I helped with at least one thing here :-\
system
November 9, 2002, 2:57am
19
Just to let you know I was able to pass the string query and pop up a new window. The tutorial here at Kirupa solved the problem of trying to put the java code, url and query string in the same line of code.
Thanks again lostinbeta
:rambo:
system
November 9, 2002, 3:04am
20
Well I have an excuse for not thinking straight…lol… it was like 3:30am here