Loading font from external *.swf

So!
I have 3 movies.
1)Main movie - index.swf
2)Movie with created & checked in linkadge "Export for
runtime sharing" fonts in library - fonts.swf
3)movie with text fields which need embeded fonts to work in
a proper way. Fonts in the library checked in linkage as "import
for runtime sharing" - content.swf
What happens:
I strike CTRL+ENTER and run movie index.swf.
on the (for ex.) 10 frame it loads fonts.swf with
movieClipLoader class..
then in the same way on (for ex.) 100 frame, i load content
swf
BUT!!! before it starts loading process IT DOWNLOADS FONT.swf
again
SO HOW DO I PRELOAD fonts from external *.swf..
maybe there is yhe way without using runtime sharing..
but i've heard that loaded whith movieClipLoader movies don't
adds objects from their library to main movie liblary...
HOW DO I SOLVE THIS PROBLEM!

can you give your erroe source code,and then i will give you the success code.
in the function
private function onLoadComplete(e:Event):void {}
ApplicationDomain.currentDomain.getDefinition("com.scottgmorgan.ExternalMovie") ;
use like this:
var EMClass:Class=loader.contentLoaderInfo.applicationDomain.getDefinition("com.scottgmorgan.ExternalMovie") ;
then you can new a instance :
var emInstance:Object=new EMClass();
emInstance.alert("hello word");
and we also can use other method. so email me  [email protected]

Similar Messages

  • Loading library movie symbol from external swf

    Hi, I have a Flex/Air Application and I want this application
    to load in an external SWF and display a particular asset from the
    SWF library (just like attachMovie in AS2). I dont want to embed
    the SWF into the Air application. For the life of me I can't find
    any tangible info on how to do this. My second problem is that the
    assets sit in an SWF published for AS2 (is that an issue?). All
    content resides locally.
    Can anyone help or point me in the right direction?

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Loading Fonts from diff domain

    Hi - When I try to load fonts from a diff domain, it loads but when I call a font.regiserfont, it throws a AS error.
    In the main application, this is what I do to load the fonts.
    var loaderContext:LoaderContext = new LoaderContext();
    loaderContext.checkPolicyFile = true;
    var testFontloader:Loader = new Loader();
    testFontloader.contentLoaderInfo.addEventListener(Event.INIT, function(e:Event):void{
         var FontLibrary:Class = e.target.applicationDomain.getDefinition("testFont") as Class;
         Font.registerFont(FontLibrary.font);
    var testFontReq:URLRequest = new URLRequest(model.serverLocation + ServiceURLConstants.ASSETS_PATH+"/embeddedFonts/testFont.swf");
    testFontloader.contentLoaderInfo.addEventListener(Event.COMPLETE,CheckFontLoadComplete);
    testFontloader.load(testFontReq,loaderContext);               
    And it throws an exception while it tries to register the font and it does not register it acutally. The main app is in code domain (domain1) and font swfs were placed in content domain (domain2)
    Error is:
    ArgumentError: Error #1508: The value specified for argument font is invalid.
         at flash.text::Font$/registerFont()
         at MethodInfo-778()
    I tried wih diff options, as to set loaderContext.checkPolicyFile = false; but they did not bear any fruit.
    This is the code to acualy embedd the font.
    package
         import flash.display.Sprite;
         import flash.system.Security;
         import flash.text.Font;
         public class testFont extends Sprite
             Security.allowDomain("*");
             [Embed(source="/fonts/testFont.ttf", mimeType="application/x-font", fontName="testFont",
                 unicodeRange="U+0020-U+007F,U+00A0-U+00A3,U+00A8-U+00AB,U+00AE,U+00B4,U+00B8,U+00BB,U+00B F-U+00CF,U+00D1-U+00D6,U+00D8-U+00DC,U+00DF-U+00EF,U+00F1-U+00F6,U+00F8-U+00FC,U+00FF,U+01 31,U+0152-U+0153,U+0178,U+02C6-U+02C7,U+02DA,U+02DC-U+02DD,U+2013-U+2014,U+2018-U+201A,U+2 01C-U+201E,U+2022,U+2026,U+2030,U+2039-U+203A,U+20AC,U+2122,U+FB01,U+FB02", embedAsCFF="true")]
             public static var font:Class;       
    Can someone guide me on what am I doing wrong? or is it possible at all to load and register fonts from a diff domain at all? Pls let me know if you need more info. Pls treat it as urgent!!

    I have not tried it, but the principle should be that you load the SWF into
    the same security domain which requires that you have a crossdomain.xml file
    in the right place with the right permissions.  You will probably not be
    able to test your configuration from urls that begin with file://.  You will
    have to deploy to a server and fetch via http://.
    BTW, did you prove it works from the same domain.  I'm not sure INIT is the
    right event to wait for.  I'd wait for an ENTER_FRAME after COMPLETE.

  • Sound from External swf

    I have a main movie (index.swf) that preloads my external SWF
    that is a menu button 4.swf
    My index.swf has background music (song1) that plays on load.
    I also have background music (song2) that plays on my 4.swf
    It works fine when I test 4.swf directly however when I load
    my main index.swf I do not hear the song2.
    I used stopAllSounds(); in my4.swf to stop the background
    music (song1) and then load my song2
    stopAllSounds();
    my_sound = new Sound(sound_loop);
    my_sound.loadSound("4.mp3",true);
    my_sound.start(0,100);
    This has gotten me to get both songs to play when the site is
    loaded and when I click on my menu for 4 button all the sound stops
    and my song2 never plays.
    My actionscript is not very good so any details you can give
    would be greatly appreciated.
    Thanks much!

    here is frame 3 of my loader in index.fla
    var movie:MovieClip =
    _root.StoredActions.Holder.Movies.Holder2.CMovie.duplicateMovieClip("CMovie"
    + n,n);
    loadMovie(n+".swf",_root.StoredActions.Holder.Movies.Holder2["CMovie"+n]);
    if(n>1){
    _root.StoredActions.Holder.Movies.Holder2["CMovie"+n]._x =
    3000;
    var MovieLoaded = 0;
    percent = 0;
    frame4
    MovieLoaded =
    _root.StoredActions.Holder.Movies.Holder2["CMovie"+n].getBytesLoaded();
    loadTotal =
    _root.StoredActions.Holder.Movies.Holder2["CMovie"+n].getBytesTotal();
    percent = int(MovieLoaded/loadTotal*100);
    Bar.gotoAndStop(percent);
    loadingName = ("Loading... " + percent+ "%" + " of "+ n);
    Loadtext_txt.text = loadingName;
    if (loadTotal>10) {
    if (MovieLoaded>=loadTotal) {
    gotoAndPlay(6);
    frame6
    if (n < _root.StoredActions.nMenus) {
    n++;
    gotoAndPlay(3);
    } else {
    gotoAndStop("Stopload");
    _root.gotoAndPlay("Play");
    I know that the above code is loading all the external swf
    and causing the music to start after load. Is there a way to stop
    it from loading the sound?

  • Load fonts from file

    In Java I can load fonts from a file or register it:
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
         ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf"));But in JavaFX this code shows the error:
    cannot find symbol
    symbol  : function registerFont(java.awt.Font)
    location: class java.awt.GraphicsEnvironment
    It is probably because the registerFont method was only added in JDK 1.6
    How can I register a font in JavaFX or load it from a file or create a JavaFX font from the java.awt.Font class?

    I tried this but the text is not shown.
    I guess it is because the font size is zero.
    How can I change the font size in this case?
    The code below shows an error:
    def fxFont = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader().font(awtFont);
    fxFont.size = 24;Main.fx:19: size has script only (default) write access in javafx.scene.text.Font
    fxFont.size = 24;
    1 error
    My application is:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import java.io.File;
    // http://www.fontfreak.com/charactermaps/a/AajaxSurrealFreak.htm
    def path = "D:/Download/Browser/temp/AAJAX.TTF";
    def awtFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, new File(path));
    def fxFont = com.sun.javafx.tk.Toolkit.getToolkit().getFontLoader().font(awtFont);
    Stage {
        title: "Application title"
        scene: Scene {
            width: 250
            height: 80
            content: Text {
                font: fxFont
                x: 10
                y: 30
                content: "Application content"
    }

  • How to load webParts from external assemblies ?

    Hi
    i'm facing the problem when loading webParts from external assemblies. i've a lot of searched on internet, but nothing found! also i create a thread on
    asp.net forum, but nobody answer!
    does something wrong or is there any way to accomplish this ?
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Hi, Sure!
    here is my code :
    Aspx :
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    </asp:WebPartManager>
    <div>
    <asp:DropDownList ID="ddlDisplayMode" runat="server" AutoPostBack="True"
    onselectedindexchanged="ddlDisplayMode_SelectedIndexChanged">
    <asp:ListItem>Browse</asp:ListItem>
    <asp:ListItem>Design</asp:ListItem>
    </asp:DropDownList>
    <br />
    <div id="divWebPartBar" runat="server" visible="false">
    <asp:DropDownList ID="ddlWebParts" runat="server">
    </asp:DropDownList>
    <asp:DropDownList ID="ddlZones" runat="server">
    </asp:DropDownList>
    <asp:Button ID="btnLoadWebPart" runat="server"
    Text="Load WebPart to Selected Zone" onclick="btnLoadWebPart_Click" />
    </div>
    <div>
    <asp:WebPartZone ID="WebPartZone1" runat="server">
    <ZoneTemplate>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </ZoneTemplate>
    </asp:WebPartZone>
    </div>
    <div>
    <asp:WebPartZone ID="WebPartZone2" runat="server">
    </asp:WebPartZone>
    </div>
    </div>
    </form>
    </body>
    </html>
    Default.aspx.cs :
    public partial class Default : System.Web.UI.Page
    const string _webPartsPath = "~/bin/CustomWebParts";
    private static Dictionary<string, Type> _dicWebparts;
    protected void Page_Load(object sender, EventArgs e)
    if (!Page.IsPostBack)
    _dicWebparts = LoadWebParts(_webPartsPath);
    foreach (string webPart in _dicWebparts.Keys)
    ListItem item = new ListItem(webPart);
    this.ddlWebParts.Items.Add(item);
    foreach (WebPartZone wpz in this.WebPartManager1.Zones)
    ListItem item = new ListItem(wpz.ID);
    this.ddlZones.Items.Add(item);
    //MyWebPart myWebPart = new MyWebPart();
    //this.WebPartManager1.AddWebPart(myWebPart, this.WebPartZone2, 0);
    protected void ddlDisplayMode_SelectedIndexChanged(object sender, EventArgs e)
    if (ddlDisplayMode.SelectedValue == "Browse")
    this.WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
    this.divWebPartBar.Visible = false;
    else if (ddlDisplayMode.SelectedValue == "Design")
    this.WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
    this.divWebPartBar.Visible = true;
    protected void btnLoadWebPart_Click(object sender, EventArgs e)
    Type type = _dicWebparts[this.ddlWebParts.SelectedValue];
    WebPart webPart = (WebPart)Activator.CreateInstance(type, null);
    //this.WebPartManager1.AddWebPart(webPart, this.WebPartManager1.Zones[this.ddlZones.SelectedValue], 0);
    WebPartZone zone = (WebPartZone)this.WebPartManager1.Zones["WebPartZone2"];
    this.WebPartManager1.AddWebPart(webPart, zone, 0);
    private Dictionary<string, Type> LoadWebParts(string path)
    Dictionary<string, Type> dicResult = new Dictionary<string, Type>();
    string[] webPartsAssemblyPath = Directory.GetFiles(Server.MapPath(path), "*.dll", SearchOption.AllDirectories);
    if (webPartsAssemblyPath != null & webPartsAssemblyPath.Length > 0)
    foreach (string file in webPartsAssemblyPath)
    Assembly assembly = Assembly.LoadFile(file);
    Type[] types = null;
    try
    types = assembly.GetTypes();
    foreach (Type type in types)
    if (typeof(WebPart).IsAssignableFrom(type))
    //object obj = Activator.CreateInstance(type);
    //WebPart plugIn = (WebPart)obj;
    dicResult.Add(Path.GetFileNameWithoutExtension(file), type);
    catch (Exception ex)
    continue;
    return dicResult;
    My sample webpart in external assembly :
    namespace MyWebPart1
    public class MyWebPart1 : WebPart
    protected override void CreateChildControls()
    this.Controls.Clear();
    Label lbl = new Label();
    lbl.Text = "Hello web part 1";
    this.Controls.Add(lbl);
    this.ChildControlsCreated = true;
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

  • Load data from external table

    Hi ,
    How to load data from external table to transaction table using SQLLDR ?

    You use an external table to load the data it is described in the link to the manual I provided.
    Here is an example.
    Re: Using DML order to import a .xls file
    You would not be using SQLLDR though as external tables replace that functionality.

  • Loading library assets from external .swf

    Ok, so here's what I want to do. I'm creating an application
    that has optional classes that it can instantiate based on what the
    needs are. These classes operate things like Session Logging
    utilities, etc. These items obviously have assets that they need
    available such as movieclips and buttons. For example, the Session
    Logger has a sessionLog_mc clip that has a log window with buttons
    and the log display. I want to be able to have my class load the
    external .swf that contains the assets for the Session Logger and
    then use attachMovie(), once the .swf is loaded, to attach the
    sessionLog_mc from the library of the loaded external .swf file.
    This does NOT seem to work at all. This seems like it has to be
    possible. I don't want to be forced to put all my code into
    external .swf's too. I just want some external asset .swf's (or
    maybe just one large one) that I can load. Is this possible? I am
    wanting to have the ability to show the progress of loading each of
    these components while the application is starting up and loading
    the asset files. Thanks so much!
    Here is an example of what I'm trying: (the attachMovie does
    NOT work at all)

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Button from External SWF to Play Movie in Main SWF

    Hi Guys,
    Ok I'm working in Flash 8, Action Script 2;
    I'm building a website, in which the 'Gallery Page' has a link to an external swf file, which is a scrolling clip of thumbnails.
    What I want to do, is create each thumbnail into a button, which will then play a Movie Clip from a frame located in the Main swf file.
    (So basically, each thumbnail button is a small photo, will play that photo in a large scale as a movie)
    eg.
    thumbnail1_btn  needs to go to main swf and play movieclip1.mc, frame 1
    thumbnail2_btn nends to go to main swf and play movieclip1.mc, frame 2
    I'm unsure of the code for this? Or if I've built this up wrong?
    If someone could help me out, that would be great!

    If you haven't set _lockroot on the loaded SWF, than a simple _root call from the loaded SWF will talk to the main SWF.
    IE:
    on(release){
    _root.gotoAndPlay(1);
    If you did set the lockroot, then call the level directly, via:
    on(release){
    _level0.gotoAndPlay(1);
    Once on the root level, you can access a movie clip as normal.
    So:
    on(release){
    _level0.movieClip1.gotoAndPlay(1);
    will call the movie clip "movieClip1" which resides on the timeline of _level0 (which is main.swf in your instance), and tell it to jump to the first frame and start playing.

  • Fully loaded and rendered external SWF printing problem.

    I have an application that loads external SWF files that I have not built and do not have the codebase for.
    I need to know when these SWFs are fully loaded and have rendered themselves on the screen.
    Even gone to the point of giving them 80 enter frame events before trying to print and they show up on the paper sporadically.
    Does anyone know if there's some standard event coming from some object internal to SWFLoader that would let me know when the SWF is "running?"

    There is no way to know in the general case.  If it had an animation of
    birds flying around on it, when would be the right time to print it?

  • AIR 3.0 mx:HTML embedded fonts in external swf - silent craziness

    The recent upgrade to AIR 3.0 has hosed our application.  We rely heavily on an mx:HTML control to render the UI of our application using javascript and HTML templates.  Everything has been working great in production for months, until Adobe released AIR 3.0 last week.  We use embedded fonts in our application that our defined in an external .swf (loaded at runtime).  The HTML control loads a .css file that references the name of our embedded font "ArialEmbedded" and it all worked great.  But now, with 3.0 it does not respect anything in the external .swf.  We get the default Times New Roman font in all of our content, and the app crashes with reliability (in debug mode and release mode) without any exceptions being thrown.
    Using the Windows Debugger, I have been able to track it down to this call consistently - Webkit!cairo_pattern_get_type with an Access Violation erros - c0000005 . 
    After some Googling, it seems webkit uses Cairo for the graphics rendering portion of the library, and in this case it is trying to render a specific color.
    1) I've tried forcing the moduleLoader on the HTML control to use the moduleLoader of the parent Spark component - to no avail.
    2) Did something change with style management and loading external .swf files?
    3) Any other help?  At this point, I have no idea where to begin.  When it crashes, usually during the rendering of items in a grid the AIR process will grab about 2GB of RAM all at once and then stop working with the windows process stopped working dialog.
    Thanks for any help,
    Steve

    Hi,
    Could you please open a new bug report on this over at bugbase.adobe.com? Please include sample media, code, project or app to help us reproduce the issue. Finally, once the bug has been added, would you mind posting back with the URL so that others affected can add their votes and comments?
    Thanks,
    Jian
    Adobe Flash Runtime team

  • Screenshots from external swfs

    How can i draw a movieclip that contains an external swf onto
    a BitmapData variable?
    I'm loading the movieclip with:
    moviecontainer=_root.createEmptyMovieClip("moviecontainer",10);
    moviecontainer.loadMovie("pacman.swf",0);
    Then i initialise the BitmapData var with:
    var snap:BitmapData = new BitmapData(Math.floor(nwidth),
    Math.floor(nheight),false);
    When a button is pressed i try this:
    snap.draw(moviecontainer,new Matrix());
    I expected the BitmapData snap to contain a screenshot from
    the external swf pacman.swf, but it doesn't.
    Does anyone know what i'm doing wrong?

    Thanks! I was close to giving up, but this really works
    great.
    The code for the php script is:
    <?php
    $data=explode(",",$_POST["img"]);
    $im=imagecreatetruecolor(max(1,$_POST["iwidth"]),max(1,$_POST["iheight"]));
    imagefill($im,0,0,imagecolorallocate($im,255,255,255));
    $i=0;
    for($x=0;$x<$_POST["iwidth"];$x++){
    for($y=0;$y<$_POST["iheight"];$y++){
    $r=hexdec(substr($data[$i],0,2));
    $g=hexdec(substr($data[$i],2,2));
    $b=hexdec(substr($data[$i],4,2));
    $color=imagecolorallocate($im,$r,$g,$b);
    imagesetpixel($im,$x,$y,$color);
    $i++;
    imagepng($im);
    ?>
    i changed the code inside the two for-loops in the .fla to:
    tmp = snap.getPixel(a, b).toString(16);
    pixels.push(tmp);

  • Best to load preloader from external file or place it directly into existing movie?

    Is it best to load the preloader from external file or place it directly into an already existing movie?

    there's no one answer for everyone.
    but for an inexperienced coder that's already completed their main project and is adding a preloader as an after-thought, it's usually easiest to create a stand-alone preloader.
    and even for experienced coder's, that's usually the easiest way to preceed.

  • Loading Images from external website using Applet...

    Hello,
    I want to load an Image from an external website (image hosting site) but I seem to get an error using the following code:
    images.add(ImageIO.read(urlsToGet.pop()));The error is get is something with security...
    Is there any "safe" and usefull way to load an Image from an external website?
    Thanks

    The_Pointer wrote:
    The error is get is something with security...
    Is there any "safe" and usefull way to load an Image from an external website?You need to sign the applet. An applet is normally only allowed to load resources from the host that it came from.
    Kaj

  • Problem loading fonts from ID3 to ID CS5...

    Hello,
    My company just upgraded from In Design 3 to In Design CS5 and I have tried to load some fonts from the previous version. I keep getting blocked. I drag and drop the fonts and I get this error message:
    ERROR MOVING FILE OR FOLDER
    CANNOT MOVE (SPECIFIC TEXT) ACCESS IS DENIED.
    MAKE SURE THE DISK IS NOT FULL OR WRITE-PROTECTED
    AND THAT THE FILE IS NOT CURRENTLY IN USE.
    My co-worker has done the same thing and has had no problem. I've sent in a help desk ticket, but that was a while ago so I thought I'd give you a try.
    Thanks in advance
    CS InDesign 5.5
    Microsoft Windows XP
    Professional x64 Edition
    Version 2003
    Service Pack 2
    Intel(R) core(TM)2 Extreme
    CPU Q6850 @ 3.00GHz
    2.99 GHz. 8.00 GB of RAM

    This is not an InDesign issue, it’s a system issue and you should take very serious note that XP64 is completely unsupported.
    Bob

Maybe you are looking for

  • Two TV connection

    I have one tv connected via hdmi and another via coax. TVA are located one in the living room and the other in the kitchen. The tv by coax does not have a sound when I turn the other off. When I disconnected the hdmi, the other tv worked fine. How do

  • Space above horizontal (landscape) photos in iWeb

    Hi, I created a website using iWeb and when I posted photos, the horizontal pictures (landscape oriented) have too much space at the top between the header I created and the top of the picture. It causes the viewer to have to scroll down to view the

  • Routing Service tickets using Rule Modeler

    Hi experts,   We plan to use Rule Modeler for routing Service tickets created in Interaction center. But, I am not aware of how it can be done. Could you let me know how this can be done? Thanks & Regards, Raj

  • Comment modifier les titres dans IMOVIE  10.0

    Bonjour J'ai IMOVIE 10.0 sous MAVERICKS et je n'arrive pas à modifier les titres. Les possibilités sont toujours grisées. J'ai eu beaucoup de problèmes avec cette version, heureusement la procédure RICOVERY de mon MACBOOK PRO a réussi à réparer. Je p

  • Calendar and reminders take forever to load with ios5

    Since I upgraded my iPhone 4 to ios 5, my calendar and reminders take forever to load. Sometimes they crash rather than load. Any suggestions? This is extremely frustrating. By the time they load, I forget what I was going to write. Even once they op