开发者

SWFObject is undefined

I'm get开发者_C百科ting the following error in my Flash Builder project. This is my file structure

  • Flex Project
  • src
  • lib
  • bin
  • html-template

    Webpage error details
    
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Wed, 19 Jan 2011 13:29:11 UTC
    
    
    Message: Invalid character
    Line: 1
    Char: 1
    Code: 0
    URI: file:///D:/branches/v0.0/flash/bin/swfobject.js
    
    
    Message: 'swfobject' is undefined
    Line: 50
    Char: 13
    Code: 0
    URI: file:///D:/branches/v0.0/flash/bin/something.html
    

Now, if I move swfObject.js into the bin folder. On debug it starts working fine. But when I do a debug again. Builder automatically deletes the Swfobject.js and the error is back again.

Any solution?


shouldn't you move swfobject.js to the html-template directory? I think on each compile the bin folder is deleted and recreated with the content of the html template, plus the new swf file.


@goliatone is right, put all HTML / JS files you want to use in the html-template folder. When you run / debug your application, all the files will be placed into the bin-debug (or the folder you have selected), together with the .SWF-file.

Sometimes, 'Project' -> 'clean' can avoid some problems like these...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜