Skip to main content
HackitZ
Known Participant
April 19, 2010
Answered

Google search shows undefined????

  • April 19, 2010
  • 1 reply
  • 3948 views

Hi all,

Can someone please tell me what I'm doing wrong, I have a google search box inside my flash file and the return value is always ( undefined ).

Here is my code for the button;
---------------------------------------------------
on (release) {
getURL("http://www.google.com/search?q=" + _root.strSearch, "_blank");
trace(_root.strSearch);
}
on(rollOver){
gotoAndPlay("s1");
}
on(releaseOutside, rollOut){
h=1;
}
------------------------------------------------------



here is the code for the search box;
------------------------------------------------------
var fields_descriptions = Array("", Array("t1", "keyword", "- enter Search word -"));


function reset_txt(name, name2, value) {
path = eval(_target);
path[name2] = value;

this[name].onSetFocus = function() {
path = eval(_target);
if (path[name2] == value) {
path[name2] = "";
}
};

this[name].onKillFocus = function() {
path = eval(_target);
if (path[name2] == "") {
path[name2] = value;
}
};
}

for (i=1; i<=fields_descriptions.length; i++) {
reset_txt("t"+i,fields_descriptions[1],fields_descriptions[2]);
}
-------------------------------------------------------------

Hope someone can help me sort this out.

here is the link to the working site http://www.hackitz.ca

kev

This topic has been closed for replies.
Correct answer kglad

Ok I'm pretty sure I followed your directions correctly, I added trace("*** "+t1);

and the output panel displayed this as soon as a tested the movie;

*** _level0.instance60.instance62.t1

JUST an FYI, someone noticed I posted in the wrong forum, should have been in action script 1&2.

not sure if you we're aware hope this has not caused you to waste your time.

Thanks

kglad


(i noticed you posted in the wrong forum and mentioned it in my first post.)

use:

on (release) {


getURL("http://www.google.com/search?q="+_level0.instance60.instance62.t1.text, "_blank");

}

on(rollOver){

gotoAndPlay("s1");

}

on(releaseOutside, rollOut){

h=1;

}

p.s.  please mark this thread as answered, if you still can.

1 reply

kglad
Community Expert
Community Expert
April 19, 2010

hint:  where's _root.strSearch defined?

(and, your post is in the wrong forum.)

HackitZ
HackitZAuthor
Known Participant
April 19, 2010

Sorry for posting in the wrong area, maybe a moderator can move it?

I did try and change the  _root.strSearch to _root.keyword as keyword is the name of the text box varible but I still get the same search results ( undefined).

I will try agian with using _root.

Thanks for the responce.

HackitZ
HackitZAuthor
Known Participant
April 19, 2010

I seem to always get the same result

on (release) {
    getURL("http://www.google.com/search?q="+_root.keyword, "_blank", "POST");
    trace(_root.keyword);
}
on(rollOver){
    gotoAndPlay("s1");
}
on(releaseOutside, rollOut){
h=1;
}

on (release) {
    getURL("http://www.google.com/search?q="+.keyword, "_blank", "POST");
    trace(keyword);
}
on(rollOver){
    gotoAndPlay("s1");
}
on(releaseOutside, rollOut){
h=1;
}

on (release) {
    getURL("http://www.google.com/search?q="+_root.keyword, "_blank", "GET");
    trace(_root.keyword);
}
on(rollOver){
    gotoAndPlay("s1");
}
on(releaseOutside, rollOut){
h=1;
}

on (release) {
     getURL("http://www.google.com/search?q="+keyword, "_blank", "GET");
     trace(keyword);
}
on(rollOver){
     gotoAndPlay("s1");
}
on(releaseOutside, rollOut){
h=1;
}

This is killing me, I know it's just something simple, or maybe I'm way off.