AS3 Loading Fonts from External SWF - Some work, some do not - actionscript-3

I have saved a dozen Fonts into separate swf files (embedded in the library of their respective .fla files). I am loading up to four of them and whilst most of them work, the script silently fails for Arial and Times New Roman. These fonts have been embedded and compiled the same as the others, and when I trace the available fonts I get an object saying that the required font has been loaded ([Object { fontName="Arial", fontStyle="regular", fontType="embedded"}]), however the text is not being rendered. If I change which font to use then the text is rendered using the correct font and performs as expected. It is only with these two fonts that I have a problem with.
Is there a common problem with embedding these two fonts or is it possible I have changed a setting somewhere?

The problem was being caused by me using these fonts in the fla file, the Arial as text on a play/replay button, and Times New Roman as preloader text ('loaded xx%').
My application refused to re-register the fonts as they were already embedded / in use.
My solution?
I 'broke apart' the text on the buttons and made them into a symbol, then removed the preloader text (client didn't want text anyway, just a spinner) and lo and behold my application applies the required fonts. It would have been nice if there was a trace or exception thrown or SOMETHING to let me know that these fonts had already been pre-registered. Oh well. Live and learn.

Related

Make chrome to read properly my own file extension

I am using on my computer a file extension I invented .gameos, in the files with this extension I put html code (html+js+css).
Whenever I try to open this files with Chrome it shows me the plain text of the html document with all of its tags, all the functions of javascript and all style properties of css.
I was wondering if there is a way to solve this problem on my single computer (sort of telling chrome how to read this files) and if there was a way to solve the problem with every computer, so each one will always show the html game and not the plain text.
Thanks in advance

Transforming Wysiwig HTML to PDF output

Using "wkhtmltopdf" as a PDF generator, and CKeditor as a Wysiwig editor, the font-size looks different between what I see in my browser, and what is shown in the PDF.
I tried many things: changing the font-size to cm/px/pt, changing the font-size percentage on the body ... but I can't find a way to have the same look in my HTML editor and in my PDF.
Is there some kind of link between PDF font-size and html one's ? Is the output in a PDF smaller than the one in a browser ?
Does someone already managed to obtain the same look in a WebBrowser than in a PDF using those kind of PDF generation tool ?
I found a satisfying solution.
I tried to import font using #font-face, but this doesn't work for me, because multiple #font-face for each "style" (italic, bold, bold+italic) was not recognized by wkhtmltopdf.
I had to use a "free" font ("DejaVu Sans" in my case) that was available on my Windows system and on the Linux Server and is directly available by the system when it generates the PDF.
Those two fonts now renders similarly between my Wisywig and the PDF generated. I also had to use a lot of CSS rules to make it clean, removing PNG images ... but that's another story.

Need Help to Disable Download from a URL

Is there a way to disable a user from downloading a file from a URL?
For example I have a link:
wow.mywebsitedomain.com/templates/filename.svg
I want to disable the user from downloading the filename.svg
These svg files are not just an image, they are editable designs that I have spent countless hours on each. No, I do not care if someone does a screenprint or gets a png etc, as those are not scalable, editable, vector files.
When the user clicks on a png thumbnail my actual link opens my online design editor to allow the user to customize these files, then save to my server, then purchase printed media, and they are not allowed to download any files.
I tried putting the actual files into a password protected folder on my server, but they do not open properly, and I do not want the user to have password access to this folder.
Essentially I need the link to be accessible, just not show the actual link for someone to copy and open/save/download etc.
Hopefully there is a simple solution for a non-programmer with basic html skills?
Thanks
Your can do things like "disabling right-click" and stuff - it may prevent some users from downloading your file, BUT basically you cannot prevent a file which is downloaded and interpreted by the browser from being downloaded to a user's hard drive.
This is not only true for SVGs, but also for music, videos, etc.
Instead, you can convert your SVG file to a PNG on server-side, and show only the PNG to the user. Note that you have the possibility to create PNGs of different sizes on the fly - dependent on the request, user's screen resolution, etc. You can also implement caching of the generated PNGs if needed.
On how to create a PNG from SVG in PHP read here:
Convert SVG image to PNG with PHP
You can choose other raster image format, of course.
If they can view it, they can download it. End of story. If you only want them to see a PNG, make a PNG from it and put that up
My understanding is; if you can see it, you can download it,

JPG file not loading in webpage

I have a basic webpage that references four image files using the following code:
<img src="/images/SanFran.jpg" name="urbanForm" alt="urbanFormA" width="150" height="100"/>
(I change SanFran.jpg, to London.jpg, NewYork.jpg and Barcelona.jpg - just replacing the filename)
However, although the 4 jpegs are very similar (200 x 150 pixels) and made using a similar technique (cropping an image in Picassa), only one of the files will load (London.jpg). The other three give me a broken link message. I have checked that I am do not have misspellings numerous times, and cannot find the problem.
Is there anything that I have not considered?
(I'm using Aptana Studio on OSX and viewing it using Safari as a previewer; the same problem exists if I look at it using Firefox or Chrome)
Are all the images in the same directory?
Make all the file names lowercase, so you know that isn't the issue.
double check extensions, "jpg or jpeg or JPG or JPEG"
take it back to basics <img src="images/filename.jpg" />
Try naming one of the others
SanFran.jpg. See what happens.
Might give you a clue.
Open them all in windows explorer,
confirm the images themselves load
normally and aren't corrupt.
Check all are in /images/
right click on the broken link and
choose view image or copy image
location. See if where it's trying
to access is definitely the right
place.
Do the same with the working one.
Compare and see if any differences.
change everything to lowercase, just
in case (excuse pun)
hit ctrl+shift+reload a few times,
and F5 a few times.
clear cache manually if you know how
or have the tools.
Copy it to a different loacation and
try loading them there. Ideally a
different computer.
Upload it somewhere and see if it
works in your browser when online
Hopefully one of those may help...
If you know the files are there, make sure the case of the filename matches (s is different than S on Linux), and then make sure .jpg is the proper extension and not .jpeg.
It could be because your Jpegs are saved as CMYK as oppose to RGB. See this link for more detail. However this would only affect some browsers
http://www.plaveb.com/blog/cmyk-images-not-displayed-in-internet-explorer
Open the images in Photoshop and resave in RGB color format (just incase it's CMYK). Known issue in some legacy browsers, not sure when or if it went away.

HTML input type = file in Adobe AIR does not present file browser

So the good old HTML file uploader tag only presents a browse button (without associated text input) when rendered in a HTML based Adobe AIR application. Upon clicking the browse button, nothing seems to happen. I would expect a popup window so I can select a file. I've seen examples of people using Javascript to call the AIR runtime to get a file and upload it, but I was wondering if anyone knew a complete HTML/Javascript way of doing this with AIR.
thanks
Actually, this does work. I somehow managed to stop this from working, probably through a combination of cloning that part of the DOM elsewhere.