PDA

View Full Version : Flash to MT(php) with a targeted frame


nemec
06-29-2005, 04:30 PM
Allo, allo Flash-mastas'

I was hoping you guys might be able to shed a little light on my dilemma.
I’m having some difficulties in MX sending variables and commands across frames to php pages. My first issue is with a search engine within flash.
Here’s the working form in html, you’ll notice the value being passed to php/mysql is called “<$MTSearchString$>”:

<form method="post" action="http://www.tobygrubb.com/mt/mt-search.cgi">
<p><input type="text" size="30" name="search" value="<$MTSearchString$>" /> <input type="submit" value="SEARCH THIS" /></p>
</form>

Here’s what I’ve been trying within Flash. This action is on a button next to the input text field. The text field’s variable name is “value”. The field is within a MC, instance name “form” on the root timeline. Here’s the action on the button:

on (release, keyPress "<enter>") {
// var value = "search_txt.text";
// var value = "<$MTSearchString$>";
var form.value = <$MTSearchString$>;
getURL ("mt/mt-search.cgi", "contentFrame", "POST");
// form.loadVars("mt/mt-search.cgi", "", "POST");
}

As you can see, I’ve tried using loadVariables, which seems like a good solution, but this is used for sending variables within a flash movie. I need to send these variables from my .swf in the ‘headerFrame’ to the mt-search.cgi in the ‘contentFrame’. Basically, it’s loading the mt/mt-search.cgi page without the “MTSearchString”.

---

Additionally, I have a series of buttons that changes the .css formatting (functioning as a text zoom). They are in the same .swf file sending the information to the ‘contentFrame’. Here is the working script in html:

<a href="#" onclick="setActiveStyleSheet('Small');return false;" title="Small"><i>Small</i></a>

Which is referencing these lines of code in the header tag:

<link rel="alternate stylesheet" type="text/css" href="http://www.tobygrubb.com/fplus.css" title="Small" />
<link rel="alternate stylesheet" type="text/css" href="http://www.tobygrubb.com/fplus2.css" title="Medium" />
<link rel="alternate stylesheet" type="text/css" href="http://www.tobygrubb.com/fplus3.css" title="Large" />
<script type="text/javascript" src="http://www.tobygrubb.com/css_change.js"></script>

I placed the following code on the text zoom buttons:

//small button
on(release) {
getURL("javascript:setActiveStyleSheet('Small');", "contentFrame", "POST");
}

It’s not working either. I feel like Google is going to call me and ask to stop using their search engine on this subject - I have found lots of threads and tutorials on similar subjects, but nothing addressing my specific issue. Any help would be extremely beneficial – I’d like to launch my site soon.

Sorry if these issues are n00b, but I’ve been trying really hard for a few weeks now.

Here's the beta (http://www.tobygrubb.com/index.html).

nemec
07-01-2005, 02:02 PM
Bueller? Bueller? Anyone?

--

I solved the javascript issue. I'm just having some browser issues with Safari. On the other tip, I'm trying a trace function with a link to
"/mt/mt-search.cgi?search=form.value";

The idea works, but it's searching for the words "form.value" instead of the variable. Like a midget in a dunk tank, I need help.