[thelist] Re: Flash Action Script question
Diane Soini
dianesoini at earthlink.net
Wed Apr 21 21:09:29 CDT 2004
On Wednesday, April 21, 2004, at 02:39 PM,
thelist-request at lists.evolt.org wrote:
>
> From: Chris Johnston
> Diane Soini wrote:
>
>> Is there any way at all to pass only those variables in the query
>> string that I want to pass?
>>
>
> Yes, there is.
> What you need to use is the LoadVars class.
> var my_lv = new LoadVars();
> my_lv.foo = "bar";
> my_lv.send("index.html","GET");
>
> This will only send the variables that you load into it. This is done
> in line 2 of the above example.
>
> chris
>
>
Ah, I knew there was some sort of object oriented thing I just wasn't
getting. I will give that a try.
>
>
> From: joe
> Hi Diane
>
> I think what you're doing should work:
>
> getUrl("http://my.example.com/index.html?foo=bar");
>
> should work fine, even without using the target - you should only
> really need that if you are using frames or multiple windows - and
> certainly without using the method.
>
> If you _do_use the GET method then, yes, the url will have all your
> avaliable variables appended to it, which as you say, is a little
> crazy. Are you building the url on the fly or hardcoding it into the
> getUrl() ?
>
>
>
> joe
>
Yeah, I'm hardcoding (or I was). Unfortunately, I'm not using Flash,
I'm using Viewlet Builder (which outputs .swf) and I wanted to have the
last frame of my viewlet go to the next viewlet, and figured I could do
that by passing a query string to some html in-between page saying
which viewlet is asking for the next. Needless to say, it didn't work.
So, in the process of attempting to do this, I was trying to figure out
some sort of workaround with Flash as a wrapper, but ran up against the
same problem and couldn't figure out why. LoadVars wouldn't even work.
I knew there was some stupid mistake I must be making. And there's the
answer: not asking the LoadVars object to send _root objects, but to
send its own. We'll see if that really works. Sometimes I don't
understand the quirks of Flash 2004. It doesn't always behave the way
the help files says it should.
Anyway, I ended up solving my original problem using frames to maintain
state. At least now I may have something else to try for a future
project.
***
More information about the thelist
mailing list