Page 1 of 1
Conditional Arguments with different search queries
Posted: Wed Aug 12, 2009 6:21 pm
by m u r
I have a conditional argument set up in the header of a wordpress blog, so it loads a slightly different file (actually, it's the same file but with a different query string). The browser seems to glaze over the conditions on the first time and loads the default file as though there is no search query. It works fine when I refresh or go to it again. Please help if you can...this is very very frustrating.
Below is my code:
Code: Select all
<?php
if(in_category(4)){ echo '<param name="movie" value="http://mydomain.com/file.swf?portfolio=1" />';}
else if(is_page(2)){ echo '<param name="movie" value="http://mydomain.com/file.swf?about=1" />';}
else { echo '<param name="movie" value="http://mydomain.com/file.swf" />';}
?>
Re: Conditional Arguments with different search queries
Posted: Wed Aug 12, 2009 10:28 pm
by aceconcepts
You're going to have to give a little more insight if someone's going to help out.
Re: Conditional Arguments with different search queries
Posted: Thu Aug 13, 2009 1:53 pm
by m u r
Sorry. I am trying to have a flash header that varies depending on which page you are on. I have it set up in Flash to do something special depending on which search query is at the end of the url. I then used php and wordpress conditional statements to load a different .swf url (different search query) into the header. It works most of the time, but if you go to a page the first time, it seems to skip the conditions and go to the default.
Re: Conditional Arguments with different search queries
Posted: Thu Aug 13, 2009 2:15 pm
by m u r
It might be a flash issue as it seems to be pulling up the right url. If I copy and paste the URL, it comes up with something else.

Re: Conditional Arguments with different search queries
Posted: Thu Aug 13, 2009 2:37 pm
by Eran
some browsers cache flash requests very hard. try to provide a random element to the URL to force the browser to get fresh results, something like '&r=349584' where 'r' is a randomly generated number
Re: Conditional Arguments with different search queries
Posted: Thu Aug 13, 2009 3:44 pm
by m u r
Sorry, but it seems like it is caching it, but I didn't understand your solution or how to achieve it.
Re: Conditional Arguments with different search queries
Posted: Thu Aug 13, 2009 3:54 pm
by Eran
You are passing a URL, for example "
http://mydomain.com/file.swf?about=1"
Add a random part at the end of it, for example
Code: Select all
echo '<param name="movie" value="http://mydomain.com/file.swf?about=1&r=' . mt_rand(1,1000000) . '" />';
Re: Conditional Arguments with different search queries
Posted: Fri Aug 14, 2009 7:55 am
by m u r
After doing every possible thing I could find to prevent caching, I think it was an actionscript error. I did a bunch of "if" statements rather than an if-else if-else statement. I'm learning

Re: Conditional Arguments with different search queries
Posted: Fri Aug 14, 2009 11:09 am
by m u r
ahhh!!!!! still not working.
Re: Conditional Arguments with different search queries
Posted: Fri Aug 14, 2009 11:16 am
by Eran
maybe you should post your actionscript code under the client-side forum
Re: Conditional Arguments with different search queries
Posted: Mon Aug 17, 2009 2:38 pm
by m u r
The php code that uses conditional statements to pull up a different url seems to be working. I finally made different Flash files for each page (4 total). On the first frame, I have something telling it where to go:
gotoAndPlay("about"); (varies slightly depending on which flash file)
The first time you pull up that page, it pulls up the correct URL (ie. about.swf) but it is as though it skips that first frame where it tells it where to go. After I visit a page once, and I go back to it, it's fine.
Please help me! It's driving me insane.