Java pop up + string query

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.

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.

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?:frowning:

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?

Done

This is what got

asp?index=‘listBoxInfo’,‘thewin’…

Error says Exspected ‘]’

Try changing the single quotes around ID ([‘ID’]) to the standard double quotes ([“ID”])

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.

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.

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

  1. 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.

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 :-\

How about I will build an url so you can see the errors and maybe get a better feel.:slight_smile:

That <B>might</B> help :slight_smile:

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.

It says it is expecting a ) not a ]

Hrmm… why could this be?

I am going to recheck the URL string in Flash… :-\

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')");
}

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 :stuck_out_tongue:

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)

Thanks for your time.

do you think this posible?

I see the consept but the code fails everytime.:frowning:

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:

Sorry for not being able to help :frowning:

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 :slight_smile:

So I helped with at least one thing here :-\

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:

Well I have an excuse for not thinking straight…lol… it was like 3:30am here :stuck_out_tongue: