all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

How do I make multiple getURL js function calls?


How do I make multiple getURL js function calls? ajdove
11/29/2004 10:06:55 PM
flash actionscript:
:confused; Please help!!! I need to either find a way to add multiple js
function calls to a single button instance OR find a work-around. This is
really important. Although a simple problem (I think) I need to finish my
project at work and this issue is holding up the shift to production. Can
anyone help me find a way to call 2 or more javascript functions from a single
button in Flash MX 2004 Professional? Thank you in advance for the help. If
you need to contact me outside this forum, please forward all emails to:
alex.dove@pivotalsolution.com
Re: How do I make multiple getURL js function calls? J_o_h_n_n_y
11/29/2004 10:14:08 PM
Re: How do I make multiple getURL js function calls? ajdove
11/29/2004 10:25:42 PM
I am currently using: on(press){ getURL('javascript:setFlashSize('flashid',
800, 200)'; 'javascript:setProductContent_us_immuno('us_immuno')'); } as my
javascript call. These are the two functions I need executed on one single
button. I have multiple buttons in this project that will use similar coding,
but call differently formatted javascript functions. Is there a way to solve
this issue? I presume JS API is calling a javascript function from Flash? If
that is the easier of the two and workable then great. As for the fscommands,
I thought that fscommands only worked with .exe files? Either way I could use
a good education in Flash interaction. Thanks.
Re: How do I make multiple getURL js function calls? NSurveyor
11/29/2004 10:37:35 PM
on(press){
getURL("javascript:setFlashSize('flashid', 800,200)");
getURL("javascript:setProductContent_us_immuno('us_immuno')");
Re: How do I make multiple getURL js function calls? ajdove
11/29/2004 10:46:23 PM
Re: How do I make multiple getURL js function calls? Jeckyl
11/30/2004 9:30:33 AM
[quoted text, click to view]

on (press) {
getURL("javascript:setFlashSize('flashid', 800, 200);
setProductContent_us_immuno('us_immuno')");
}

fscommand and javascript are both passed to the browser to execute.
JavaScript URL goes as a URL (just as if you'd typed it into the address
bar). fscommand goes under the surface directly into the browser .. and no
all browsers support it. On many pc's that have sound schemes with beeps
and clicks etc when things happen (like programs opening etc), JavaScript:
will cause the click to happen (because you're opening a URL) .. whereas
fscommand won't do that and is a little quicker (I think) as it avoids the
address bar etc.
--
All the best,
Jeckyl

Re: How do I make multiple getURL js function calls? Jeckyl
11/30/2004 9:43:05 AM
two getURL is not as good as a single one.. it means the browser has to
process two separate urls .. which takes extra time. Do it in a single
getURL instead.

--
All the best,
Jeckyl
[quoted text, click to view]

Re: How do I make multiple getURL js function calls? Jeckyl
11/30/2004 9:50:11 AM
[quoted text, click to view]

Do what I said and use a single getURL call with two methods in it.
--
All the best,
Jeckyl

Re: How do I make multiple getURL js function calls? ajdove
11/30/2004 3:14:48 PM
That is all well and good if I knew the syntax of writing 2 javascript function
calls for this command call. Can you show me how to write the appropriate
single getURL call with 2 javascript function calls inside it? Here are the 2
javascript calls I need to use for this example.
'javascript:setFlashSize('flashid', 800, 200)' AND
'javascript:setProductContent_us_immuno('us_immuno')' Thank you for all the
help everyone has provided. I look forward to your responses.
Re: How do I make multiple getURL js function calls? ajdove
11/30/2004 7:47:21 PM
I've got the answer!!! When making multiple calls to javascript from Flash you
need to embed each js call in one single getURL(); Although this was mentioned
by those who contributed to this solution, I needed the proper syntax and
through testing, troubleshooting, and trial-by-error, I have come up with the
correct answer. Look below: on(press){
getURL('javascript:setFlashSize('flashid', 800,
200);javascript:setProductContent_us_bloodscreen('us_bloodscreen')'); } place
this code on a button event to call each js function independently from one
single button. I hope this helps all others looking for a similar solution.
Thank you to all those who have helped in coming up with this solution.
Re: How do I make multiple getURL js function calls? Jeckyl
12/1/2004 7:54:30 AM
I already did

--
All the best,
Jeckyl
[quoted text, click to view]

Re: How do I make multiple getURL js function calls? Jeckyl
12/1/2004 7:55:12 AM
You don't need the second javascript

see my answer from yesterday that showed exactly how to do it.
--
All the best,
Jeckyl

AddThis Social Bookmark Button