Welcome Guest, Not a member yet? Register   Sign In
URLs inside Flash AS2 method called from CI
#1

[eluser]irimi[/eluser]
Hello,

I want to load a Flash app into a CI view. Tis is an AS2 app, which uses the AS2 "XML.load()" method. In my app, the method calls a non-CI PHP script with a relative URL, like this (my AS2 class extends the XML class) :

Code:
this.load ("./flash/php/xmlmaker.php?"+this.getString);

The Flash app can't find my PHP script, because it uses a wrong URL. When I ask it to redirect to my script (with the Flash getURL() method), I obtain :

Code:
http://www.mysite.com/CIroot/index.php/flash/php/xmlmaker.php?(...)

instead of :

Code:
http://www.mysite.com/CIroot/flash/php/xmlmaker.php?(...)

So, regarding the URL of the file containing flash app, Flash assumes that "index.php" is a folder !

Is there a solution to correct this ? I can't change the Flash sourcecode, it must keep a relative path to work (the app is used in many different pages and sites)

I think someone got this problem, since it's quite common to include some flash in views...
#2

[eluser]Jamie Rumbelow[/eluser]
The problem is that "index.php" is in the URL when it shouldn't be? Is this URL generated by CodeIgniter? If so, open up your application/config/config.php file and change the $config['base_url'] property to an empty string. That will stop it appearing. CodeIgniter puts that in the URL to allow for pretty segment-based URLs.

Jamie
#3

[eluser]irimi[/eluser]
Thanks for the reply Jamie.

Well, I personnally don't have problems with the presence of "index.php" in the URL. My website is powered by CI, I use the CI default URLs, they are convenient and readable, as you said, with the pretty segment-based syntax. So I want to keep my website this way... Changing the $config[‘base_url’] property to an empty string would change a lot of things in my website I fear !

The problem is that Flash seems to handle very badly the CI URLs, mostly I think because of these slashes in the URI. The swf itself loads perfectly, but the AS2 methods within it can't "read" properly the CI URLs, assuming that the segmented URI is just a tree of directories...

So I think I'll have to call the main swf with a GET parameter that will contain a classic (non-CI) URL, and give it to my classes, so they'll be able to load external files properly...

I thought about another (cleaner ?) solution : adding a .htaccess that will filter every Flash request, as my flash application calls some well identified files that are not called in my website. So, when flash comes to the server requesting a file with its wrong URL, Apache will give it the right file...

Which is the best ?




Theme © iAndrew 2016 - Forum software by © MyBB