AS2 font embeding in seperate swf file.....

Dear all,
I tried to embed font in as2 its working...this is the sample code
var test_fmt = new TextFormat();
test_fmt.font = "Font1";
createTextField("text1",2,100,150,100,20);
text1.text = "what the hell";
text1.setTextFormat(test_fmt)
text1.embedFonts = true;
text1._rotation = -45;
But i want to embed the font in seperate swf, how to call the font embeded swf.....Please if u have any sample share with me...
Thanks in advance...
Rajasekaran

I tried the below code with your two lines inplace but it came up with an error
trymeon_btn.addEventListener(MouseEvent.CLICK, tryMeButtonFunction);
function tryMeButtonFunction(event: MouseEvent) {
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
  function startLoad() {
   var trymeon_btn:Loader = new Loader();
   var mRequest:URLRequest = new URLRequest("hand2.swf");
   trymeon_btn.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
   //trymeon_btn.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
   trymeon_btn.load(mRequest);
  function onCompleteHandler(loadEvent:Event) {
   loadEvent.currentTarget.x=(stage.stageWidth-loadEvent.currentTarget.width)/2;
   loadEvent.currentTarget.y=(stage.stageHeight-loadEvent.currentTarget.height)/2
         addChild(loadEvent.currentTarget.content);
  function onProgressHandler(mProgress:ProgressEvent) {
   var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
   trace(percent);
  startLoad();
ERROR: Error #1056: Cannot create property x on flash.display.LoaderInfo.
at MethodInfo-2()
Justin

Similar Messages

  • CS3 and AS2: Embedding an external swf file

    Hey everyone,
    I have built a few flash sites before and am trying to make one that is slightly more complicated and allows for dynamic, database stored images and text. I have built a dynamic gallery based on an XML feed in AS2 which works fine. I am trying to embed it into another FLA file that contains the remainder of the site (the gallery will be one page of the main site). I have tried a ridiculous number of different methods but just cannot get it to work. The gallery is built in AS2, so I am using an AS2 FLA file for the main template it is to be embedded in. The simplest method i have tried that i think should work is to create a new AS2 fla file, edit the actions on my actions layer to be:
    Empty.loadMovie("My Gallery.swf");
    I have then created a new layer for the content and added a MovieClip to the top left of it, named Empty. I have set the instance name of this movie clip to be Empty. From what I have understood from my reading this is the simplest way to display the external file but for some reason it just will not work. It seems to see My Gallery.swf as when i delete it from the local directory i get an 'Error opening URL 'file:///D|/Websites/My Gallery.swf'' message. This message does not appear when this file exists locally, however it just opens a blank screen with nothing within it.
    I have been reading numerous tutorials and posts and i'm pretty sure i'm being thick, but for some reason i can't seem to get it to work!
    Thanks so much for any light you could shed on this for my guys, it's driving me crazy!
    Dave

    I have  checked that a number of times and unless i'm going crazy (which is distinctly possible) then the instance name is set to Empty. I have uploaded a zip file containing the fla and swf file and the test swf file that is being embedded. You can download it here.
    Thanks so much for your help, i really am completely stumped and i know it's going to be something crazy i'm doing and i'm going to hate myself when i finally discover why!
    Dave

  • Fonts Not appearing in swf file

    When I compile my swf file from flash, the dynamic text
    fields disappear completely.
    I know this sounds like a n00b problem, but I've done dynamic
    text a million times. I've never had this happen. I'm embedding the
    characters from the fonts in the preferences for the text field.
    I've manually written the characters I want to embed as well to try
    and override the character selector in flash. I've reinstalled
    flash. I've reduced the number of fonts loaded in my system. I've
    changed the font to other types to see if it's an issue with the
    font. I've tried to toggle display as html and selectability. None
    of this makes a difference. I've also ensured that my variables are
    loading properly (list variables in the debug pulldown on export)
    so there should actually be something to load.
    As a test, I tried to break apart my text. As with all text,
    you need to break it twice to render the text as a bitmap. On the
    second break, the text disappears. This should not happen either.
    This tells me that flash, though it's obviously getting the
    vector information for the fonts so it can display them properly,
    some level of the application isn't getting the information to
    render it when I either export the file or when I try to break
    apart my text.
    Sounds like a permissioning issue.... so I fixed permissions
    on my mac. Still have the problem.
    Here's a link to the file in the wild. If you want a link to
    the xml file, let me know. I'm getting the data from it, so it
    really shouldn't be the issue. There should be a large number in
    the price area of the first order option, and all options should
    have text in the burgundy rounded corner box at the bottom.
    http://www.omaxtra.com/Can_Help/rheumatoid_landing.html
    I'm developing on a PowerMac G5 2.0 completely patched to OS
    10.4.8.
    Perhaps I'm over-thinking this. Any thoughts?

    I never did figure out what the problem was. I sucked it up
    and exported it as a flash 7 swf. Thankfully I wasn't using
    anything from flash 8 in that particular instance.
    I have since embedded fonts in flash 8 files with much
    success. All of it for programatically set (AS) dynamic text.
    I'd be more than happy to try and help identify common
    variables (perhaps typefaces used, etc) with you to figure out what
    combination of things makes this bug appear. But other than that,
    unless you're using specific code from flash 8 or some of the new
    effects, I'd suggest rendering it in 7.
    Good luck, and PLEASE do let us know if you ever get a
    resolution.
    Happy new year!

  • FLV embedded in a SWF file, does not play in HTML file.

    Hi,
    I embedded a FLV file into flash movie clip, which on publish plays well on SWF file, but when the same is embedded in HTML, it does not play.
    What is it i'm missing ..
    Kindly help.
    Regards
    Shashi

    First, clarify this... are you embedding the .flv into the time line, as in:
    The .FLV file is imported on the  timeline of a movie clip.
    I embedded the .flv file,
    If you are in fact embedding the video, then there is no external video file... it's embedded into the timeline.
    If you are using the FLVPlayback component and an external vid file to display the video and the .swf when testing plays the video just fine but not on the HTML Web page:
    SWF plays external video file, as soon as I embed SWF in HTML, it no longer playes the external video file.
    then it's most likely a pathing problem.
    If you are placing the .swf on a Web page and the .swf and/or the .flv file are not both in the same folder as the Web page.... then the .swf should NOT work when you test it directly! That's because it should be pathed to play from the Web page and not the location of the .swf.
    For your review:
    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
    Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT it’s physical location.  So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in it’s folder should NOT work! That’s because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
    So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    Best of luck,
    Adninjastrator

  • Loading photos without embedding them in swf file

    I am planning to make a personal photo album website and am not able to decide whether to embed the photos at compile time or to load them at run time, and need some suggestions:
    1. First how to load at run time?
    2. Second what is the best practice, i think keeping the swf file as small as possible should be the right way to go any suggestion?
    Thanks

    Hi There
    This is a bit scruffy cos as quick response but.  Have a look below
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()" xmlns:local="*">
         <mx:Script>
              <![CDATA[
              import mx.controls.Button;
              import mx.collections.ArrayCollection;
    [Bindable]
    private var ac:ArrayCollection = new ArrayCollection([
    {imageTitle : 'Car 1', imageUrl : 'http://www.geekologie.com/2007/12/07/future-car-1.jpg'},
    {imageTitle : 'Car 2', imageUrl : 'http://www.speedace.info/solar_cars/solar_car_images/Solar_Wing_front_Japanese_electric_po wered_car.jpg'},
    {imageTitle : 'Car 3', imageUrl : 'http://www.dezeen.com/wp-content/uploads/2008/09/gem-peapod-car-by-chrysler-llc-et008_027e vsqu.jpg'}
    private function showCar(num:int):void {
    img.source = ac.getItemAt(num).imageUrl;
    imgTitle.text = ac.getItemAt(num).imageTitle;
    ]]>
         </mx:Script>
         <mx:Image id="img" source="{ac.getItemAt(0).imageUrl}" width="426" height="243"/>
         <mx:Label id="imgTitle" text="{ac.getItemAt(0).imageTitle}"/>
         <mx:Button label="Button" click="showCar(0)"/>
         <mx:Button label="Button" click="showCar(1)"/>
         <mx:Button label="Button" click="showCar(2)"/>
    </mx:Application>
    Yes use HTTP service with what ever backend technology asp, php etc you use to populate the arrayColletion.  You'd have to build better navigator thats dynamic as I've just added 3 hardcoded mxml buttons but should be simple enough.
    Good luck I hope this helps.

  • Embedding Flash Charts (*.swf-file) to WebTemplate

    Hi, due to customer requests we want to embedd Flash Charts to our WebTemplate in BI7.0. The examples we´ve got contain JavaScript and the necessary staff. There are *.swf files available. But is it possible to use the Scripting in a WebItem Chart ? Has someone just experience in that ? I´m looking forward for some interesting information. I couldn´t find the right answer yet here.
    Regards,
    Peter

    Answered by a former colleague at SAP.

  • Font licensing for font embedded in a swf

    Hi,
    Can someone please clarify the following two question regarding fonts purchased from Adobe:
    1. Can I embed them in a Flash/Flex swf in a non-editable textfield?
    2. can I embed them in a Flash/Flex swf editable textfield?
    Thanks.

    Since no one else has given an answer, I will venture one.
    As far as I know, you may use the font in any application you wish, editable or not editable, and any infringement will be on the part of the user, not you.
    The obvious case is PDF, where the font is embedded. That format was created to let others see what you create.
    In an Illustrator document, the user cannot use the font without having it on the system; otherwise, it is substituted.
    I do not know enough about Flash/Flex to know what happens there.

  • Help with embedding fonts in swf file

    Hi, I am haviing a problem with my fonts displaying in my swf file. I created the flash site using CS4 on a mac. I thought the fonts were embedded but when I tested the swf in safari and firefox the fonts disappeared are all scrunched up in 1/2" on top of each other in several lines. Its a mess. It is displaying in times or some other font when viewed in on a pc browser.
    What I did so far that did not work:
    Made fonts static with animation
    made fonts dynamic with animation
    How can I fix this?
    I am still a beginner using flash so the simpler the option the better.
    Thanks!!!

    there are quite a few ways you could mess this up but no one way that's typical.
    create a new fla.  click on the text tool, select static in the combobox and add a textfield to the stage.  animate it.  test it.  any problems?
    any other way (or ordering of steps) you use to create static text is prone to problems.

  • AS3 issue embedding AS2 .swf files

    Hi there,
    I'm attempting to create a menu navigation system with Flash/AS3 that opens up a series of older AS2 activities.
    At the moment I'm testing it with two buttons/two activities.
    The problem I'm having is that when I'm testing the navigation, the first button clicked will open its respective activity correctly, which can then be shut down using the original activity's exit button, and return to the two buttons on my AS3 menu. However, if I then select the other activity from the same screen, it won't load. I'm able to click the original activity again, and have it open, but not the new one.
    If I test the main flash navigation file again and click the other button first (that wasn't working), the other activity opens fine, and can be closed down. However the first button now won't open the activity. So both the buttons work (if they're the first ones clicked), but from then on, only the first button clicked works.
    In the debug panel, it looks as if the AS2 .swf files that I'm attempting to embed are themselves embedding a wrapper.swf file (with navigation buttons) as well as another sub set of shared .swf files for their own operation. Might it possible that these sub swf files aren't being unloaded properly when I switch between the main AS2 movies from my menu system?
    Is there a way to clear/unload everything that's been loaded (even resources loaded by the external files themselves - like a hard reset) between button presses?
    I have no access to the original AS2 code as this was done by another team years back.
    I'd be really grateful for any help or advice that anyone might be able to give.
    Thanks

    Just looking at the debugging panel, this is what I see when I try and run the program:
    Attempting to launch and connect to Player using URL /*****/*****/****.swf
    [SWF] Volumes:Data:Documents:*****:****:****:*****.swf - 876582 bytes after decompression
    [SWF] Volumes:Data:Documents:*****:****:****:*****:F11_pr_qu_3:quiz.swf - 176016 bytes after decompression
    LocateFolders.enginesFolder(file:///*****/****/****/*****/F11_pr_qu_3/quiz.swf)
    [SWF] Volumes:Data:Documents:*****:****:****:*****:F11_pr_qu_3:wrapper.swf - 481279 bytes after decompression
    ### Latest wrapper ###
    etc etc...
    Then follows a whole set of loading instructions and trace instructions put in the as2 swf which show XML files being loaded and the program launching. These must have been put in place by the previous programmer.
    When I click the exit button on the 'embedded' swf, the debugging panel shows things shutting down:
    ActivityToolbar clickQuit()
    Wrapper quitActivity()
    EndGame clear(false)
    Now when I click the second button, I should see a similar set of launching greetings etc. instead it bottles out at the following:
    [SWF] Volumes:Data:Documents:*****:****:****:*****:F11_wb_fc_1:flashcards.swf - 94720 bytes after decompression
    LocateFolders.enginesFolder(file:///file:///*****/****/****/*****/F11_wb_fc_1/flashcards.s wf)
    And there it stops.
    If I restarted the program and pressed the second button first, it would show the flashcards.swf activity loading correctly, but would then refuse to load the first activity when I clicked on the button.

  • Disable link in embedded .swf file?

    Hi, all,
    I have embedded a flash .swf file in a topic, and it plays
    just fine in WebHelp output.
    The .swf was made as a banner in another application, where
    the user clicks on the image to bring up a new window with its own
    content. That link must be embedded in the .swf, because the html
    code in RH just puts it there and lets it run.
    I'm planning to insert a note to explain the dead link,
    saying my presentation is only to show the swf. As it stands, it
    displays a hand pointer, but a click generates a js error.
    Is there a way to disable the link from the swf without going
    back to the original developer?
    Thanks.
    Harvey

    Hi Harvey
    You said you omitted the JavaScript? Why? Was it causing
    issues? Or is it the fact the link points somewhere you really
    don't want it to?
    If so, I'm thinking you could amend the JavaScript
    to point it where you want.
    Just thinking out loud... Rick

  • How to place a Flash swf file with a movie FLV file embedded in DW

         My hair is getting shorter by the hour or maybe missing.  I have created a SWF file with Flash 8 that has an embedded FLV file that was created from a MP4 file.   The SWF file works perfectly in FLASH including my Flash nav buttons, and the movie with soundtrack and the buttons for control of volume and start stop.  Now I am ready to place it on the web using DW to make the html page.  What happens when I test the page on FireFox or IE is the background loads, the buttons load but do not work properly anymore but worse than that:  The slide show and the control buttons do not even show up. 
         I am also having trouble defining my site locally.  I select new site and tell it where every thing is but no luck. All in the same directory, right now I have a image directory but I have not used them on the page as the only image is a jpg and flv file and they are embedded in the swf file.
         I know this is 2 different programs but the Flash files need to be placed in a HTML file to be uploaded, and I have to text them first.
    HELP
    Randy

    from the Premiere Pro Help section about importing SWF files:
    " Interactive content and scripted animation are not retained. Animation defined by keyframes in the main, top-level movie is retained."

  • Loading external swf files

    I have a Flash presentation where the chapters are made of
    seperate swf files. How can I link them, so they play in the
    correct order automatically? I will also need to make a clickable
    version. Any help greatley appreciated.
    Thanks
    D.

    dazzlah wrote:
    > I have a Flash presentation where the chapters are made
    of seperate swf files.
    > How can I link them, so they play in the correct order
    automatically? I will
    > also need to make a clickable version. Any help greatley
    appreciated.
    You could have one base movie which load your first movie in
    level 1.
    Then on the last frame of the first movie place an action to
    load next movie
    in level 1 as well, what automatically will replacing the
    previous loaded
    content with a new one. That's probably as simple as you
    could go.
    Tho, take note, that's good idea when comes to any flash till
    version AS3.0
    player 9. Loading in AS3.0 is ridicules, so it unloading of
    loaded content
    The functionality is no longer the same as in early versions
    so if you can
    export as2.0, you can achieve it using very basic methods
    like loadmovie action
    attached to last frame of the timeline.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How can I play many swf files back to back in AS3

    I have many swf files
    fileA.swf , fileB.swf, fileC.swf
    I want to play them from a MainFile.swf  back to back, fileA.swf , then fileB.swf then fileC.swf ...then to remove them and have the MainFile.swf only.
    How is this done in AS3.
    can anyone send me the code needed to do this. i don't know AS3 very well. I know how to do this in AS2 , i used to put code loadmovie in each files last frame that loaded the next file to a mc object in the mainfile.
    I would apprciate to have all the code appear only in the main file without haveing to code each seperate swf file.

    You should work out how to do it with just one file first in AS3.  The approach to doing many sequencially would be similar to what you did in AS2... the simplest way being to add a command at the end of each swf to trigger the main file to remove it and add the next swf.  I don't know of any way to detect the end of an swf... it has to tell you it's done.
    In AS3 you use the Loader class to load swf and image files.  You use the addChild family of methods to place things on the stage, and you use the removeChild family to get them out of the picture.

  • SWF File not working after upload to server, but works on local system

    HELP PLEASE.....I have created a Fla and exported a swf file
    from Flash 8 and Export (Flash 6). I can preview the page in
    Dreamweaver just fine, but when i upload it and the html file, it
    isn't showing up. It leaves a blank spot on the page. It is just a
    simple banner with graphic clips and motion tween text, with image
    bgd. All images are jpg.
    I have tried:
    1. Using a full link to the swf file.
    2. Removed drop-shodows in swf file
    3. convert to Flash mx 2004 file
    4. Exported to higher Flash version to see if the flash
    player was an issue.
    5. Exported with no dashes in name
    6. Added Scr file into Dreamweaver
    7. Made a new test file to see if it was something in the
    current html doc, same result.
    8. Tried viewing on a pc, same result. Created on mac.
    Here is the test page if anyone wants to take a look.
    THANKS FOR ANY ADVISE.
    Test
    Page Link

    The link you provided is to the SWF file, not to an HTML
    file, so no one can test your HTML file.
    Have you checked the code for the embedding of the SWF file
    in your HTML file? I don't use Dreamweaver much, but I do know that
    if you start assembling a Dreamweaver file without first saving the
    HTML, embedded graphics and other items are inserted as direct
    links to the files on your computer, rather than as relative paths.
    There is one other possible issue: I note that your swf is
    called CWABanner.swf. Depending on your FTP settings, it is
    possible that your server is forcing all file names to lower case
    (a common practice). Which means the file on your server will be
    cwabanner.swf. Again, depending on how the web server is set up, if
    it is case sensitive, it will treat CWABanner and cwabanner as
    separate files. So if the HTML calls CWABanner.swf, but the FTP
    upload has forced a rename to lower case to cwabanner.swf, the HTML
    file will not find it. Check this out, or to be absolutely certain,
    rename everything to lower case: the file name itself and the
    reference in the HTML file.

  • Flash 10.3 installed ok but Player 9 activates for standalone swf files

    This is a rather interesting scenerio. I am running Vista 32 Bit (upgrading to Win 7 soon), using IE9 and I am trying to view .swf files that require Flash Player 10. No problem, I uninstalled all Flash Player components using the Flash Player uninstaller. I rebooted, reinstalled Flash Player and confirmed all was working ok. Add-ons are enabled, and all checks show that I do have 10.3 installed. The problem that I am facing is when I try to run a seperate .swf file, the player that pops up says "Flash Player 9." The .swf file will not play as a standalone but it will play in my browser. How do I get Flash Play 10 to be my default player? TIA for your help.

    The Flash Player browser add-on and the standalone player are two different downloads.
    Get the latest standalone player (Projector) from http://www.adobe.com/support/flashplayer/downloads.html
    Note that the download is the player, not an installer.  Replace your current player with the new download.  You may also need to change the file association to reflect the new name (flashplayer_10_sa.exe).

Maybe you are looking for

  • The Quicktime manual indicated that .pdf is an acceptable format yet I can't open a pdf file with Quicktime?

    The Quicktime manual indicates that .pdf is an acceptable format, however I can't open a pdf file in Quicktime.  Any suggestions?

  • My external drive keeps setting to read only, why???

    Periodically a 1TB external drive suddenly switches to read only and won't let me save edited documents to it any longer.  It shows as read and write for my access but still won't accept written items.  I'm curious as to why.  It's getting a lot of f

  • Issue with new secondary index

    hi i have created new secondary index in VEPO table.( mandt, werks,lgort, sonum).index is activated. but when i am doing activate and adjacent in database in SE14.it is giving warings and error. warning 1: Enhancement category 3 possible , but includ

  • Error message )x80090318

    When trying to access I Tunes with my laptop with Windows 7 (64 bit) installed, I receive an error message i Tunes could not connect to the iTunes store as an error occurred (0x80090318)

  • Language Version of InDesign vs. Dictionary Language

    hi, i'm new here so first of all  i'm saying hello to this forum. after i have tried some layout softwares  i made my mind to buy InDesign. I'm from Slovakia and a Czech version  of InDesign is closest to our language (since Slovak doesn't exist). bu