I have been building my games using FlashDevelop with Flex SDK compiler all the time, but now I need ASC 2.0 with adobe air. So I have migrated to it. But one problem came out, which I just can't find a solution for. I need to embed TTF fonts, which I used to always add additional compiler option -managers=flash.fonts.AFEFontManager for. In this new AIR SDK all I get is the next warning:
command line
Warning: 'compiler.fonts.managers' is not fully supported.
And of course fonts do not embed.
Is there a solution for it?
Here's how I embed them
[Embed(source = "VERDANA.TTF", fontName = "verdana")]
private static var Verdana: Class;
Well, the answer to this is that Adobe (for some unknown reason) have cut font pretranscoding out of ASC 2.0, so all fonts must be pretranscoded now to be able to embedded into code. The easiest way is to use Adobe Flash pro, to embed font and pack it as SWC. Then attach it to your project somewhow, and register font via Font.registerFont(Arial); (or some other class you have attached to it). Bingo! Now you can use it.
The second, more complicated, but cheaper way is to use fontswf utility from adobe
Details can be found here http://www.bytearray.org/?p=4789 and here: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html (at the bottom of the page)
Related
I'm implementing Google video Ads in flash game, using FlashDevelop. Google has a sample where they're using FLVPlayback component to display video... problem is, I don't have this class anywhere.
I've searched how to add it, but all solutions say "link to C:\Adobe\Flash CS\Components\etc" path, which obiouvsly without Flash CS I don't have... and don't want to install it just for this :)
I wonder if there is a way to get the FLVPlayback without installing Flash CS?
You can try import external adobe components swc through Flashdevelop interface.
Maybe this can help you: link
I quit and just installed the Flash Professional CC, and there linked to the component path, but it didn't work for some reason. Then I included the FLVPlayback.swf component inside my AS3 app, which compiled etc. but as I learned FLVPlayback wasn't really what I needed.
After some fumbling I made it work with Flex Spark component - VideoPlayer, used inside AS3. You can find some code on the devlist: https://developers.google.com/interactive-media-ads/community?place=msg%2Fima-sdk%2Fc3KH11vxSd0%2FeLuYneYpch4J
I don't know whether it's the right place to put this up. But I've been trying from past 12 hours and haven't found anything related.
I'm creating a Adobe AIR project (which'll run on desktop), it'll ask for image locations on the local pc.
After the user is done selecting images. I want to output a SWF video (slideshow) of the selected images.
How to do the second step. Please guide. I want to create an output file (SWF) from my AIR Flex Desktop Application.
Check out https://github.com/claus/as3swf to compile SWFs at runtime...
This individual seems to have had a similar issue AS3 to Generate Dynamic SWF?
You can try following options from SWFtools
JPEG2SWF Takes one or more JPEG pictures and generates a SWF slideshow from them. Supports motion estimation compression (h.263) for better compression of video sequences.
PNG2SWF Like JPEG2SWF, only for PNGs.
GIF2SWF Converts GIFs to SWF. Also able to handle animated gifs.
Here is what I did :
Install the as3 compiler (mxmlc)
Run the command mxmlc.exe sample.as3 using NativeProcess
import android.media.MediaScannerConnection;
import android.media.MediaScannerConnection.MediaScannerConnectionClient;
These are classes available in Java to refresh the detected images on an SD card on an Android device.
If you save an image to the SD card, it's there, but not visible unless you mount the device, unmount the device. These Java classes fix that problem.
But I'm building an App using AS3 and AIR, does anyone know the equivalent classes for AIR, AS3?
You can use Adobe Air's File class to poke around the device (also cf., Working with Files). Once you figure out what code gets you to the USB device, you can load it as a ByteArray and convert that to an image.
If you are looking for image import/conversion code, just search for what you need; there are numerous posts out there, and the answers are fairly standardized.
The flash player has a little window that can be opened (similar to flash->settings) telling the user to update the player if the movie loaded is for a more recent version. How can you instruct the player to do this? ITV have managed it with their catchup-tv player.
Context: I am allowing users to copy flash into their PowerPoint presentations and would like to tell them to update their flash player if necessary. I am not embedding a web page in the power point so no JS can be run for checking etc (because I know this is not necessary).
Thanks in advance
For getting the current version of flash:
var version:String = Capabilities.version;
I don't know what ITV has done, but I don't know of any way of forcing the player to show that box, although it may do it automatically.
EDIT:
I just found a complete blog post that answers this.
There is no way to force the window to open itself. It's a user defined setting:
Have a look at the Security class. I have used it in some Flash to prompt users to increase storage limits. The panels that you can show are found in SecurityPanel. However, this may not be the way to prompt for outdated Flash version. (If you are looking to customize these panels, that is off limits.)
You can actually test the browser/Flash version in Javascript, so there really is no point in loading Flash to tell the user to upgrade Flash.
Someone else wrote and gave me an ActionScript source file that defines a subclass of Sprite. I am told that I need to, from this, generate a .swf file whose behavior is entirely defined by that one sprite. In other words, when the "movie" starts, one instance of that Sprite subclass should be created and set running, and it should keep running until the <object> is destroyed. The sprite doesn't define its own dimensions as far as I can tell, so I also need to know how to specify those (it's supposed to cover the entire area of the movie, and ideally that would not be hardwired into the .swf but rather taken from the <object> definition in the HTML).
I know basically nothing about Flash, and I'm much more of a command line guy than an IDE guy, so if there's a way to write the necessary wrapper in a text editor and then just use the Flash IDE to compile it (or better still, compile it using some sort of command line utility that either came with CS4 or I can install on my Linux box, without paying Adobe an additional arm and leg), detailed instructions on how to do that would be the ideal answer to this question. Failing that, please provide step by step instructions for how to create said wrapper in the IDE. I've got CS4.
The sprite tries to communicate with the containing HTML document, so if there's any glue needed inside the .swf but outside the .as code to achieve that, I need to know how to implement that too.
Since you already have CS4 you can compile your source file by using the DocumentClass.
http://www.heaveninteractive.com/weblog/2008/03/04/introduction-to-the-document-class-in-actionscript-30-tutorial/
Alternatively, for future reference , if you download the free Flex SDK , you could use the command line to compile your source file
mxmlc SourceFile.as
You can then use SWFObject to embed the resulting swf file in your HTML page
http://learnswfobject.com/