Firefox plugin development and embedding an .swf in xul with html:embed - javascript

I have a big problem with my firefox plugin. I have a button, which opens a new window for me, where I want to include that .swf file.
Here is the XUL code for the embedding:
<html:embed src="Reader.swf"
width="250"
height="250"
type="application/x-shockwave-flash" />
-> html namespace was set above:
xmlns:html="http://www.w3.org/1999/xhtml"
Reader.swf is in the same directory as the xul file
without the html:embed, the window opens without problems, but as soon as I change that, firefox crashes without warning or something, it just disapears from the process bar.
the .swf file works properly when I open it from my operating system (its windows 7 64 bit) and is coded in as3.
can somebody help me?

Instead of placing the swf file directly into the new window, try wrapping it in a minimal html page. Or you could use the html page that flash generates for you when you publish your movie. I haven't played with XUL, but I have noticed that placing swf files directly into browsers is a little inconsistent across browsers. For example, some browsers will scale the movie to 100% of the available window space, others will not.

Related

Adobe Animate .fla Conversion and publish to HTML 5/JS

Adobe Animate .fla Conversion and publish to HTML 5/JS
The previous person we had doing this task is no longer with the company, and the instructions they left are minimal. They are probably enough to jog their memory but are not helpful for someone attempting with no Flash/Animate experience. In our attempts we get a few different results
The file works correctly in IE but not in any other browser.
The file opens in IE but cycles through each frame, never stops, and doesn’t load in any other browser.
The file opens in IE but has no animation, doesn’t respond to clicks, and doesn’t load in other browsers.
The file doesn’t open anywhere
With our lack of experience with Flash/ Animate, we can’t tell what is the problem. We did try using a file that is unmodified and has a current working HTML5/JS publish, however, when we publish that same file we get the same results as above, while the original works fine. We believe that it something in the publish of the JavaScript causing the failure. I attempted to take bad.html and bad.js and overwrite bad.js with the content of good js. This worked, it’s the wrong data, but it worked and is why we believe the publish of the JavaScript is the issue.
The instructions we are following are as follows.
Open .fla in Animate
Click File --> Convert to --> HTML 5 Canvas (save File)
Click File --> Publish Settings
Basic tab
Uncheck Loop Timeline
Check Export images assets (as spritesheet)
Uncheck Export Sounds
Uncheck Export CreateJS
HTML/JS tab (No changes)
Image Settings Tab (No changes)
Click Publish
I have shared the .fla at https://1drv.ms/u/s!ApKpIVR_uf25hd9MF6pzZPKZjukwQw?e=oEzxRV in the hopes that someone can help and spot the error of our ways.
Thank you for any assistance.

iTextSharp PDFAction.PrintDialog not working in MS Edge

I noticed today that the PDF viewer within Microsoft's Edge browser is not allowing iTextSharp's PdfAction(PdfAction.PRINTDIALOG) command to work. I create my PDFs in code and add this action call to the PDF so the print dialog window will appear after opening the PDF. It works fine in Adobe Acrobat, IE & Chrome. Here is an example of the PDF I created which you can open to test the various PDF viewers:
PDF Example
Let me know if anyone else has experienced this issue and if there is any way around it. I'd much prefer not to have to move away from iTextSharp's library just to resolve this.
PdfAction.PRINTDIALOG is a JavaScript action and apparently Edge doesn't support it and/or general JS commands. (I haven't confirmed the lack of JS support yet bu I'm seeing rumblings about it.) If you look at the source you'll see that iText is just injecting the simplest of JS code possible into the document's open action:
this.print(true);
So this isn't a problem with iText in any way, this is just a limitation of Microsoft's Edge PDF renderer. Switching to another PDF library wouldn't solve this problem, either.
(Go Jacks!)

Javascript window.open() toolbar=no not functioning

I am attempting to open an html file in firefox with minimal extras (toolbars, menubars, addressbar, etc). Just the html contents of the webpage, and nothing else. I want to be able to do this within linux from the terminal. I also have to do it in such a way that it works across multiple linux machines running the same version of firefox. So this removes any possibility of using a profile. I was hoping there would be a simple parameter to firefox that would allow me to turn these settings off. I dont believe there is.
The only possibility I have found is through javascript's window.open. It appears the parameter specs to window.open arent even functioning in firefox 1.5.0.9. I have read that some of them were removed in firefox 3.0+, but have not found anything regarding the version I am using, 1.5.0.9.
This is what I am using to open my .html file using windows.open...
test.html:
<html>
<body>
<script>
window.open('./rel_notes.html','_self','toolbar=no,menubar=no')
</script>
</body>
</html>
And then just running 'firefox test.html' from the terminal.
Both the toolbar and menubar still appear when I do this. What am I doing wrong? Is there a easier way to do this?
If your browser settings allow pop-ups without notifications from X source (localhost i presume?) then the following might work:
window.open('./rel_notes.html',null,'menubar=no,toolbar=no');
window.open('','_self',''); //this is needed to prevent IE from asking about closing the window.
setTimeout('self.close();',500);
Taken from a link in the link bungdito gave me:
After a window is opened, JavaScript can't be used to change the features.
So by opening test.html, and then using window.open on _self, I am trying to adjust features to a window that has already been opened, using javascript.
Source: https://developer.mozilla.org/en-US/docs/DOM/window.open

Resizing of AS-based Flash app from FireFox vs. IE

I have put in some controls to allow users to resize my Flash app via Javascript:
document.getElementById("flashApp").height*=1.25;
document.getElementById("flashApp").width*=1.25;
This works great in IE/Safari, but is ignored in Firefox. I know it's talking the the flash app and gets and sets the height/width vars ok, but the same code run in FireFox ignores the scaling. (It's not the DOC spec issue)
Any thoughts?
Bill
Make sure you've got flashApp set in both embed and object tags. One browser might look for the id in the embed tag, while another uses object.

How do I embed a flash SWF file and get around the IE security layer without using swfobject (to keep down file size)

I'm looking for a way to embed an SWF into a page and get around the Internet Explorer security issue (where it requires an extra click to "activate" the flash file).
I've got my code working with swfobject, but I'm using this in an embedded widget context (eg a clickable banner ad) so I am really trying to keep my file size down, and swfobject adds about 10k worth of minified Javascript that just feels like more than I need
I just need basic flash rendering, I'm not really that worried about Flash version detection (I'm using an old enough version of Flash for the SWF) though a fallback solution if flash is not available would be nice.
Finally, this has to be something that can work entirely from a single Javascript file included somewhere in the BODY tag of the containing page. (The reason I say this is because I had some issues even with the swfobject version when I was document.write'ing a SCRIPT tag for the swfobject.js into the BODY of the page instead of the HEAD).
I hope that makes sense, I can clarify if needed.
Thanks in advance!!
"Click to activate" is no longer an issue, see this note.

Categories

Resources