Flash AS3 not embedding, blank on IE and FF (external XML and images)

30 views
Skip to first unread message

cnicoletti

unread,
Dec 11, 2009, 12:42:22 PM12/11/09
to SWFObject
I am having a major issue with having my flash file not showing up on
a server page.

I was using UFO, but recently switched to SWFObject 2 because of the
same issue.

The file plays fine on the server, just not with the JavaScript. Other
flash files play fine also.

Does this have something to do with my external XML or gallery images
not playing nice with the SWFObject?? (/xml/gallery.xml) The xml is
being loaded from Flash AS3, not a flashvar.

Thanks in advance for all your help!

Here is the code from the .ascx file:

<div style="width:974px; height:300px; margin:auto; text-
align:center;">
<script type="text/javascript" src="/js/swfobject.js"
language="javascript"></script>
<script type="text/javascript">
swfobject.embedSWF("/ContactUS/_Swf/EN/main_Home.swf",
"flashmedia", "974", "300", "9.0.0" , "expressInstall.swf",
{menu:"false"});
</script>
<div id="flashmedia">

Aran Rhee

unread,
Dec 11, 2009, 10:09:42 PM12/11/09
to swfo...@googlegroups.com
Most likely it is a relative pathing issue in loading the XML file. SWFObject (or UFO for that matter) have no problems with flashvars vs. direct request of images etc.

Can you post a link to a test page? It is a lot easier to help if we can see exactly what is going on (http traffic etc)

Also, make sure you read the SWFObject 2.x docs, as it is recommended to place all SWFObject code in the <head> of the page rather than inline like 1.x or other embedding methods.


Cheers,
Aran




--

You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.



cnicoletti

unread,
Dec 11, 2009, 10:19:19 PM12/11/09
to SWFObject
What do you mean by relative path? Unless you can see an issue with my
code I pasted, this is not the answer. My directory path and location
are accurate. Does my AS3 file have to point to the external file
through SWFObject flashvarsor something? Or can I have it load images
and XML through AS3 like I have it set now? Like I said it plays on
the server, just not through the SWFObject script.
> > swfobject+...@googlegroups.com<swfobject%2Bunsubscribe@googlegroups­.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/swfobject?hl=en.- Hide quoted text -
>
> - Show quoted text -

Aran Rhee

unread,
Dec 11, 2009, 10:50:35 PM12/11/09
to swfo...@googlegroups.com
I mean how are you referencing you XML file / images within AS3? Are they absolute paths like http://some.com/xml/some.xml ? or relative paths like /xml/some.xml ? If you are using relative paths, then you should set the BASE param for your flash player so that the XML / images will actually be loaded from the correct location. 

As the code you pasted does not show the pathing for the XML or images, I can't say whether you have any issues or not. That is why I asked you to post a link.

No, you do not need to point to the XML / images through flashvars. If you have the location hard coded in your flash file, then that is fine.

When you say it plays on the server, you mean when you use a standard <object>/<embed> method in your HTML page, or when you access the swf directly without HTML?

At the end of the day SWFObject just creates the proper <object> structure to embed your swf in your HTML page. It does not affect your flash file's capabilities or stop you doing anything you are used to doing in Flash.  It is easy to see if SWFObject has in fact embedded your swf on to the page by right clicking the area where the file should be and if you get a Flash player context menu, then you at leasdt know the embedding has happened as it should.


Aran



To unsubscribe from this group, send email to swfobject+...@googlegroups.com.

cnicoletti

unread,
Dec 12, 2009, 8:00:44 AM12/12/09
to SWFObject
Yes. The flash file does embed it seems like, but the file does not
run. It is a blank space holder.(I can tell with using "menu:false/
true" parameter that it shows up) Almost like the file is hidden
behind something? Like I said, the file plays fine on the server
without the JavaScript code. I run other test swf without external
files within that code and they work great. Could it be a possible
server cache issue? I am using FF, IE6 and 8 to test.

Here are the relative paths from AS3 that play fine when the SWF is
launched on the server without SWFObject:

var myLoader3:Loader=new Loader();
myLoader3.load(new URLRequest("images/ltblbackgroundgrad.png"));
addChild(myLoader3);
setChildIndex(myLoader3, numChildren -4);

var myLoader2:Loader=new Loader();
myLoader2.load(new URLRequest("images/globe2.png"));
addChild(myLoader2);
setChildIndex(myLoader2, numChildren -3);

var myXML_loader:URLLoader = new URLLoader();
myXML_loader.load(new URLRequest("xml/gallery.xml"));
// NO XML CACHE HACK
// myXML_loader.load(new URLRequest("gallery.xml" + "?uniq=" + new Date
().getTime()));
myXML_loader.addEventListener(Event.COMPLETE, processXML);

var myLoader:Loader=new Loader();
myLoader.load(new URLRequest("images/hands.png"));
addChild(myLoader);
setChildIndex(myLoader, numChildren - 1);


Sample of the XML:

<?xml version="1.0" encoding="utf-8"?>
<menu WIDTH="322" HEIGHT="322" ALPHABUTTON="0" POSITION = "center"
buttonMargin = "0" redOffset = "0" greenOffset = "0" blueOffset = "0"
FilterColor= "0xFF6600">
<item
tween = "alpha" tweentime = "1.2" speed = "8000"
tweentimetext = "1.2" text = "Are you looking to have a new
website designed and developed? Need to have an out-of-date website
updated? We deliver professional service at an economical price..
Discover the range of products and services offered in our
portfolios." texturl = "- System Complete" textstat = "Here is my
Trademark" textstat2 = "TM" textfont = "Arial" textsize = "14"
textalign = "left" textvis = "true" textcolor = "0x003366" URL=""
path="images/globe2.png"/>

Thanks for helping with this. Been working on this for the past week.
*sigh*

On Dec 11, 10:50 pm, Aran Rhee <aran.r...@gmail.com> wrote:
> I mean how are you referencing you XML file / images within AS3? Are they
> absolute paths likehttp://some.com/xml/some.xml? or relative paths like
> > > >http://groups.google.com/group/swfobject?hl=en.-Hide quoted text -

Aran Rhee

unread,
Dec 13, 2009, 6:35:13 AM12/13/09
to swfo...@googlegroups.com
So can I check a few things:

Is one of your images located here?

/ContactUS/_Swf/EN/images/globe2.png

and the XML here ?

/ContactUS/_Swf/EN/xml/gallery.xml


If so you can add the BASE param like below which should get you to your content:

<script type="text/javascript"> var flashvars = {}; var params = {}; params.menu = "false"; params.base = "/ContactUS/_Swf/EN/"; var attributes = {}; swfobject.embedSWF("/ContactUS/_Swf/EN/main_Home.swf", "flashmedia", "974", "300", "9.0.0", "expressInstall.swf", flashvars, params, attributes); </script>




The other quick way to check we are on the right path is to temporarily set your image and XML paths as absolute.

Posting a link to your html page would allow me to view the http traffic to see where the Flash player is trying to request its assets. It could save a lot of time to solve this....


Aran

To unsubscribe from this group, send email to swfobject+...@googlegroups.com.

cnicoletti

unread,
Dec 13, 2009, 10:17:26 AM12/13/09
to SWFObject
I will give that a try and report back tomorrow.

Unfortunately, I can not share the link with you. It is on an internal
server behind a proxy. The pages I am editing are .ascx files if that
helps at all.
Thanks again.
> > > absolute paths likehttp://some.com/xml/some.xml?or relative paths like
> > > > > >http://groups.google.com/group/swfobject?hl=en.-Hidequoted text -

cnicoletti

unread,
Dec 14, 2009, 9:21:56 AM12/14/09
to SWFObject
Nope. the base para didn't work.

I have some more to add...

It seems when I view the flash file on the page and right click in it,
I can only get the flash menu over the parts in the flash file that
have dynamic text boxes. This is in IE6. FF shows the entire flash
box.
> > > > absolute paths likehttp://some.com/xml/some.xml?orrelative paths like
> > > > > > >http://groups.google.com/group/swfobject?hl=en.-Hidequotedtext -

Aran Rhee

unread,
Dec 14, 2009, 5:48:04 PM12/14/09
to swfo...@googlegroups.com
Ok.

Well, I was taking an educated guess as to the relative path values as I don;t actually know where your assets are.

Have you tried doing the absolute paths thing?

Alos, as a santity check , you could add a textfield/textarea in your swf and trace out some values of where Flash is attempting to load the assets from. you should also be able to listen to i/o error events from your loaders to see whether you are actually loading the files you think you are or not. 

You can also set up a remote debugging session and set breakpoints in your swf to check on values etc. You will need the debugger Flash player for this. By having the debugging player you will also be able to see any runtime errors which occur (a must for any Flash dev)


By far the easiest thing to do is set your paths to absolute to get things working, and then start experimenting with various relative path combinations until it starts to work. You should be ablwe to test your realtive paths without having to push things to the server (eg set up a static html page and folder strcuture that mimics the live server and get everything working locally)



Aran



I don't think the dynamic text boxes are indicative of anything good or bad (unless you have wmode=transparent) 

To unsubscribe from this group, send email to swfobject+...@googlegroups.com.

cnicoletti

unread,
Dec 16, 2009, 7:07:09 AM12/16/09
to SWFObject
Ok. It was an absolute path issue. Backend developer told me that
relative would work regardless. Go figure...

Works great now. Thanks for pointing that out!
> ...
>
> read more »- Hide quoted text -

Aran Rhee

unread,
Dec 16, 2009, 7:29:21 AM12/16/09
to swfo...@googlegroups.com
relative paths will work, but you have to figure out the RIGHT relative paths. I would suggest you get yourself a http traffic debugger like Charles or Service Capture so you can see where Flash is trying to load things. All web devs should have a http traffic debugger in their toolkit (it means you don't mess around on invisible bug and loose hair and billable time)

Aran

Reply all
Reply to author
Forward
0 new messages