Welcome Guest, Not a member yet? Register   Sign In
SWF and codeigniter
#1

[eluser]rijobo[/eluser]
Hello,

I've got a Flash banner rotator, which rotates pictures every 7 seconds.
It's got a banner.swf and a content.xml which should be in the root. It also got a folder assets shich contains the pictures. This folder also should be in the root.
With this URL http://localhost/just4fun/ it works fine, but when I use a link, it goes to for example this link http://localhost/just4fun/index.php/home/index I get this error:

Error #2044: Niet-afgehandelde ioError:. text=Error #2032: Streamfout. URL: content.xml
at XMLUtilExample::as/frame1()[XMLUtilExample.as::frame1:6]

I guess that it can't find content.xml. Does anyone know how I can solve this problem?
Is the views directory the root when I use the link? Or maybe the controller directory?
#2

[eluser]mddd[/eluser]
The location of the document containing the SWF is always the root.
But you have to realize, it is not the location on the server that matters, but the location as seen by the browser.
If you are on a page like www.example.com/just4fun/home/index, then the browser will expect the xml file to be at www.example.com/just4fun/home/content.xml!!
Use your browser to check the actual location that Flash is looking for the file (using Firebug, or the 'activity' tab or Web Inspector or something like that).

Also, if the Flash file IS looking in the right place (the root of your site), make sure your .htaccess is not sending that request to CodeIgniter's index.php!
#3

[eluser]rijobo[/eluser]
Thanks for your help!
How can I see with Firebug where the browser is looking at?
And what if the browser is looking at www.example.com/just4fun/home/content.xml, in what folder should I place the files then?
#4

[eluser]mddd[/eluser]
I use Safari here, but I think it works pretty much the same. There should be a list of all the files that have been loaded (or tried to load) for your webpage. In that list you should see the content.xml (with a 404 error if it is not found). In Safari's web inspector if I click the name I see the entire path that was requested.

I guess the best solution would be to code the Flash file in such a way that it always looks in the same place. Then you don't have to deal with this issue.
#5

[eluser]rijobo[/eluser]
I can't find that same function in Firefox, does anyone know if I need an extention for this?
#6

[eluser]mddd[/eluser]
If I do it in Firefox, I have to open Firebug, click the Net tab and then load the page. Then I see all the files that are downloaded, along with their http status.
#7

[eluser]rijobo[/eluser]
Found it, thank you!
It does indeed look in www.example.com/just4fun/home/content.xml. Should I then place the files in the controller directory?
#8

[eluser]mddd[/eluser]
No you should not place any non-Codeigniter content in the Codeigniter directories.
Codeigniter works in its own way! Everything else (css, images, javascript, swf) should be stored elsewhere.
It wouldn't work anyway. If the browser asks for /home/content.xml, CI will look for a controller called 'home' and method called 'content.xml'.. it will not find the file. You need to put the file outside of the CI system folder and make sure you link to the files using absolute paths (that is, starting at the web root folder). Like /just4fun/swf/myfile.swf and program your swf so that it looks in /just4fun/swf/ to find the content.xml file and other assets/images for Flash.




Theme © iAndrew 2016 - Forum software by © MyBB