Welcome Guest, Not a member yet? Register   Sign In
Flash not being loaded + XML issue
#1

[eluser]Pedro Garcia[/eluser]
Hey all!

I'm getting bonkers over this issue, please help me Smile

I put this piece of code in on of my CI views:

Code:
<skript type="text/javascript" src="http://blog.deconcept.com/swfobject/swfobject_source.js"></skript>

<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<skript type="text/javascript">
   var so = new SWFObject("http://localhost/myproject/assets/selector.swf", "mymovie", "493", "331", "8", "#336699");
   so.addParam("wmode", "transparent");
   so.write("flashcontent");
</skript>

For those who doesn't know what"swfobject" means, it's a javascript library that does all the hard work concerning the flash object/embed compatibility stuff.

Anyway, the flash is not being loaded. There are 2 strange things here:

- If I paste http://localhost/myproject/assets/seletor.swf directly in the address bar, it works perfectly.
- If I use some other SWF in the javascript call, let's say "http://ciaartecultura.com/materias.swf", it works!

Now, there is something I didn't tell you yet: inside this flash animation (selector.swf) there is a call for a XML file, just passing the name of it (list.xml), without any path, so it should seek for the XML in the same path as the SWF, right? For some strange reason, it does not happen.

I should say that I've tried putting this XML file (and the SWF) in the assets, CI views and root paths. All of them have failed.

Well, I wonder if somebody has a clue about what's going on. Any help would be much appreciated!

See you.
#2

[eluser]InsiteFX[/eluser]
Try this.

This should be in your html head tags! replace the $ with s in script tags.
Code:
<$cript type="text/javascript" src="&lt;?php echo base_url();?&gt;swfobject/swfobject_source.js"></$cript>

Code:
var so = new SWFObject("&lt;?php echo base_url();?&gt;assets/selector.swf", "mymovie", "493", "331", "8", "#336699");

You may need to play with the paths, not sure how you are really setup but base_url() should give you your application path etc.

InsiteFX
#3

[eluser]Pedro Garcia[/eluser]
Thanks for the answer, InsiteFX! Actually, I just wrote the full SWF address (http://localhost/myproject/assets/selector.swf) for you to get a better idea. The code is already using base_url() Smile
#4

[eluser]InsiteFX[/eluser]
I see your problem now! You are using script which is wrong you need to use Embed the flash...

Read this!

InsiteFX
#5

[eluser]Pedro Garcia[/eluser]
Guys, the problem was fixed with a simple solution: using the full path instead of a relative one, inside the actions of the FLA file. Like "http://myproject.com/xml/list.xml" instead of "xml/list.xml".

Thanks for the help anyway! Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB