Adding advanced flash code & JavaScript to a PHP variable
Hey people!
I have a PHP variable named flash, and within it I have the <object> element which creates the flash output. So whenever i call the variable i get the flash. Now the problem is that I am getting the "click to activate and use this control" box which I want to get rid of. So to do this I want to add the AC_RunActiveContent.js script to this variable. Is this possible? If so how do I write the code? This is the code I have already:
Maybe I'm missing your point...but why do you have to add the javascript to the variable? I guess if you really had to add the javascript to the variable and you didn't want to escape all of the quotation marks you can use the HEREDOC syntax.
You also, might want to take a look at SWFObject. It avoids the "Click here to activate" as well. I just like pushing it on people opposed to alternatives.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
Maybe I'm missing your point...but why do you have to add the javascript to the variable? I guess if you really had to add the javascript to the variable and you didn't want to escape all of the quotation marks you can use the HEREDOC syntax.
You also, might want to take a look at SWFObject. It avoids the "Click here to activate" as well. I just like pushing it on people opposed to alternatives.
Ah right so SWFObject eliminates the user input. I'll look into that.
I think the javascript is needed because I assume it passes the paramaters to the AC_RunActiveContent.js file? I'm a newbie/intermediate so i'm not totally sure
Well,even if it did pass parameters to the .js script file you have, it would be the exact same thing.
As you may or may not be aware of, PHP is a server-side language and javascript is client-side. So what this basically means that all of the PHP stuff will be processed on the server and then delivered to the client. Unless, you have some variables being passed from PHP into the javascript, there is no reason to have it in your PHP. In fact, its slower b/c your server has to spend the extra time processing the extra text. Whether PHP writes out this code dynamically or you hard code it into your script, the browser won't be able to tell the difference.
Now that I've said that, here is the link for SWFObject. He has really good documentation and its really easy to use. (You can just add the javascript to your pages, you do not have to put them in your PHP code.)
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
Last edited by StupidRalph; 07-14-2007 at 02:17 AM..
Reason: Update Link
Well,even if it did pass parameters to the .js script file you have, it would be the exact same thing.
As you may or may not be aware of, PHP is a server-side language and javascript is client-side. So what this basically means that all of the PHP stuff will be processed on the server and then delivered to the client. Unless, you have some variables being passed from PHP into the javascript, there is no reason to have it in your PHP. In fact, its slower b/c your server has to spend the extra time processing the extra text. Whether PHP writes out this code dynamically or you hard code it into your script, the browser won't be able to tell the difference.
Now that I've said that, here is the link for SWFObject. He has really good documentation and its really easy to use. (You can just add the javascript to your pages, you do not have to put them in your PHP code.)
So would the SWFObject work with the PHP script i'm trying to use?
Did you check the links I gave you? Try reading the 2nd paragraph of my previous post again. It makes no difference whether its the javascript is dynamically written or if its static. The browser will not know the difference.
With your example, as I've stated in my first post, you can use the HEREDOC syntax to place all of that information in the variable.
Hey, yeah I looked at the SWFObject it looks like a better way if doing things!
I've just realised that I dont need to use the PHP at all. Sorry for the confusion I got mixed up along the way somewhere!
What I have is a swf file that calls text in from an XML file just to display a simple news scroller. The problem is that using the AC_RunActiveContent doesn't take notice of the XML file at the moment. I read up on the SWFObject documentation but I have yet to try it. Thats what I am about to do now! Should it work even though the SWF relies on an external XML file?
Hey, yeah I looked at the SWFObject it looks like a better way if doing things!
I know, it really is.
Quote:
Originally Posted by jpmad4it
I've just realised that I dont need to use the PHP at all. Sorry for the confusion I got mixed up along the way somewhere!
Thats kinda what I've been trying to tell you the last two post.
Quote:
Originally Posted by jpmad4it
What I have is a swf file that calls text in from an XML file just to display a simple news scroller. The problem is that using the AC_RunActiveContent doesn't take notice of the XML file at the moment. I read up on the SWFObject documentation but I have yet to try it. Thats what I am about to do now! Should it work even though the SWF relies on an external XML file?
Yes. SWFObject is used to add the .swf to your web page. I'm not sure how your actionscript is set up to call the XML file so I don't know if you have to pass in the path to the XML file within your actionscript, but if you must, you can do that also with SWFObject. If you still need help post your actionscript in that forum and reply here with a link to the thread.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
Thats kinda what I've been trying to tell you the last two post.
Yes. SWFObject is used to add the .swf to your web page. I'm not sure how your actionscript is set up to call the XML file so I don't know if you have to pass in the path to the XML file within your actionscript, but if you must, you can do that also with SWFObject. If you still need help post your actionscript in that forum and reply here with a link to the thread.