Using external files in flash

Helo all and thank you very much for your attention ,realy I
tried to use two external text file (bill.txt and les.txt) .when I
click on bill button ,the flash file load bill.txt and when I click
on les button the flash file load les.txt .for this case I use two
sepaate action script for each of the buttons:
action script for bill button:
on (release) {
willieLoad = new LoadVars();
willieLoad.onLoad = function() {
_root.twoNuts.text = this.bill;
willieLoad.load("bill.txt");
action script for les button:
on (release) {
leslieLoad = new LoadVars();
leslieLoad.onLoad = function() {
_root.twoNuts.text = this.les;
leslieLoad.load("les.txt");
It worked but as you see it's kind of duplication of code .I
decide to catch the instance name of the button name in a global
varibale ,then I load the text file according to the name of the
global varaible ,Now please tell me how can I get the name of the
instance of the button when I click on it and please guide me in th
is way.
sincerely yours Mohsena

are you using movieclip buttons or true buttons?

Similar Messages

  • FAQ: SWF's and loading external files in Flash Catalyst

    How do I make the images in my Flash Catalyst project external to the published SWF?
    You can choose whether images are embedded in your Flash Catalyst SWF, or loaded dynamically; this can help to keep your SWF's small. Simply right-click an image and chose "Externalize Image".
    Answered by: Adam Cath.
    See entire discussion.
    How do I make the SWF I imported to Flash Catalyst load external files?
    When importing a SWF, Flash Catalyst only pulls the SWF asset into your project. Many SWF's, such as slideshows and media players, rely on external data files, such as configuration files or media assets. If you would like to use such a SWF in Catalyst, then you will have to place these external resources into your Catalyst project as well as importing the SWF.
    Let's assume you have a SWF source folder that contains your SWF file and all of the external files it needs. You can open the SWF file from this folder and it works fine. But, if you import the SWF into Catalyst, the Catalyst project doesn't display it correctly because it can't load the external files. Here's what you do:
    1. Open your swf source folder, and copy all of the files/folders there except the SWF you imported.
    2. In Catalyst, Run/Preview your project (Ctl/Cmd-Enter)
    2. Note the file path to Main.html in your browser
    3. In your OS, open the folder that contains /bin-debug/Main.html from above
    4. Open the "src" folder
    5. Paste all of the files from step 1 into the src folder.
    6. Catalyst won't pick up that your project changed, so tweak it a bit (add a Rectangle), and save it.
    7. Run your project. If it doesn't work, try closing and reopening your project and running again.
    For an example, check out: Using an XML-driven SWF in Catalyst to create a slideshow.
    See entire discussion.
    Answered by: Bear Travis

    You can make you swf a custom component with 2 states.
    The first state will be empty and rename it "OFF" the second state will have your swf file and name it ON.
    Then go back to your artboard/project, add your 2 buttons ON & OFF.
    For the ON button add interaction "play transition to custom component ON"
    For the OFF button add interaction "play transition to custom component OFF"
    Here is an example swf_control

  • Referencing external files from flash in Dw

    I am working on a web page that has an embedded .swf, the
    flash movie reads an xml file which describes some photos and then
    displays a slide show with the photos and their captions. It works
    fine when I play .swf in Dw, but when I preview it in Firefox
    within Dw, it doesn't work, i.e. just a blank area. When I open the
    .swf file with firefox in the directory where I first created it,
    it works fine in the browser. However, when I try to open the file
    in the Dw site with Firefox it doesn't open.. The referencing used
    in the Dw copy is "/flash files/XML/slideshow1.xml" and the
    reference to the pictures in the XML file is /flash
    files/mainslideshow/filename.jpg
    I don't understand why it works in Dw but not Firefox. This
    has been "bugging" me for a couple of days now so any help would be
    greatly appreciated. Thanks

    eizzor wrote:
    > bregent thanks for the reply. No all the files are
    within the Dw site. The site structure is:
    > Site
    > Css
    > flash files
    > .fla
    > .swf
    > XML
    > .xml
    > mainslideshow
    > .jpg
    Not that I actually know what is going on here, but I do
    notice that you
    are using spaces in folder names - "flash files".
    Never a good idea.
    Harvey

  • Error importing external files in flash cs6

    I am getting this error message when I try to import image files into my flash CS6 animation: "Unable to load external importer C:\Program Files\Adobe\Adobe Flash CS6\es_ES\Configuration\Importers\PhotoshopReader.dll". I am using Windows XP SP3.
    Thanks.

    The file was in the directory. We finally solved it by installing SP3 again.
    Thanks,

  • Image-to-Image Fade Using External Files

    Hi all,
    I'm trying to create a fairly basic random image-to-image fader.  I've got a LOT of images that need to rotate through and they've all been optimized, however the swf file just becomes too big w/all of them.
    So what I was hoping I could do was use AS3 to load up a random jpg from an XML file, apply the fade effect, preload the next one it's planning on grabbing while the current one is being displayed, and repeat the process indefinitely.  By doing this I'm hoping to keep the footprint of the application extremely small.
    Is such a thing possible (I'm using a trial of CS5 at the moment) and if so, can someone point me in the right direction?  I'm pretty new to AS3 so any amount of help would be greatly appreciated!

    Yes, it is possible to do.  You can probably search Google using terms like "AS3 XML slideshow tutorial" to get the whole thing in one package.  Though what you might want to do is take it in steps so that you can come to understand how each aspect works.
    The basic elements would involve loading an XML formatted bit of data into an array and using the Loader class to load the images, using a COMPLETE event listener so that you know when an image is loaded and ready to be processed into an object within the show.
    Then you would want to look into using some actionscript tweening to get the alpha fading effect working for you.  Flash has its own Tween class, and there are thrid party tween classes as well. I'd say use the Flash version first just to eliminate one level of complication for now (installing and using an external class). Many people recommend the thrid party tweening classes over Flash's.
    You might also want to incorporate some form of Timer (the Timer class) to help manage when things change and/or when they load. If you have optimized your images already, then it would take less time for them to load, which means you probably do not want to use loading status to control the timing, but only as logic to enable timed actions.

  • How can I use a file in flash cs6 that I made in flash cs5.5 air for android

    I have made an app in in air for android in flash cs5.5 air for android, and I want to edit it in cs6 and play it in cs6.
    But if I put Ctrl+Enter I got an error: createWin process failed with error 2: system couldn't find the file. I think the problem is that I'am using air for android 2.6 version in flash cs5.5 and version 3.2 in flash cs6. I have searched the web and found out that you can add older air versions using the sdk manager and I have tried it but first I get the error that the version of the sdk I am trying to install is not valid and after some files that I added to the sdk folder I get this error:Only SDK higher than version 3.4.2540 may be added.
    I there a possible way to update the air for android for an fla or apk? Or how can I let my originally file work fine in flash cs6??

    system couldn't find the file
    If you can´t get a more specific hint why your project can´t compile then I can think of some reasons theis error might occur
    1.You had files included besides the swf, like videos, audio files, xml files, that are not present in the place air expects them to be
    2.somewhere in your createWin functions there is a class import needed that isn`t present in 3.2 anymore, for example some classes or functions from classes that were valid in 2.6 are not any more in 3.2
    3. to achieve better eror logging, allow for debugging in the publishing options and see what specific lines in your code throw the error
    4.any air app needs a cert file, this needs to be created once, if you migrated to e new system it might be you never created that file which air expects to even begin the compiling process
    once you isolate the problem, report back

  • Embedding and using external fonts in Flash CS5

    I just upgraded to Flash CS5.  Font embedding is entirely different than it was in CS4.  I've been looking for examples online but none seem to show me a solution that matches what I need.
    In the project I'm working on, code changes the font a text box uses based on region and language.  To keep file size down I created separate swf files with the fonts embedded.  That way I only download the font I need.  The way I did this and the code I used in CS4 doesn't seem to work anymore.  Can someone please point me to a tutorial on this.
    Thanks

    OK, maybe you can help me figure out what I'm doing wrong.  Below is the code I'm using.
    LOADING THE FONT
    Font SWFs:
    I'm trying something new with CS5.  To create a swf with the font I need I'm creating a library symbol of the font with all the characters in it.  Titled it "Verdana".  I've also turned on Export for ActionScript and given the font a unique class name (VerdanaFont).  Then of course publish the swf, name it Verdana.swf, and put it in the correct location.  Does doing it this way automatically register the font?
    The Loader code:
    private function LoadFont()
    var fontPath:String = "assets/fonts/Verdana.swf";
    var fontLoader:Loader = new Loader();
    fontLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createTextBox);
    fontLoader.load(new URLRequest(fontPath));
    The TextBox code:
    private function createTextBox()
    var tf:TextFormat = new TextFormat;
    tf.font = "Verdana";
    tf.align = "left";
    var textBox:TextField = new TextField;
    textBox.embedFonts = true;
    textBox.selectable = false;
    textBox.htmlText = "This is test text";
    textBox.setTextFormat(tf);
    stage.addChild(textBox);

  • Problem with using swc files in Flash Player 10

    I have two Actionscript projects in Flex. One is using Flash Player 9 the other is using 10.  Both projects use the fl classes specifically FLVPlayback.
    In the Flash Player 10 project I am using the recently released version 2.5.  Both players use individual controls instead of a complete skin swf.  So the code goes something like video_player.playPauseButton = playPauseBtn.  All the swc files are imported through properties-ActionScript Build Path-Library path-add swc.  This all works great in both projects exept in the Flash Player 10 project the volumeBar swc does not load properly.  In the debug variables for a break point at the function below in FLVPlayback.as the variables handleLeftMargin, handleRightMargin, handleLinkageID and handleY are missing even though they are all in the original fla used to compile the swc.  I have tried compiling swc in both Flash CS3 and 4.  I have tried moving the Actionscript inside the fla files but nothing changes. This leads me to believe it is a bug in the Flash Player 10 or the version 10 playerglobal.swc since this part of FLVPlayback.as is identical in versions 2 and 2.5. The result is that only the volume bar renders but no handle. Debugging all through fl.video.UIManager.as handle_mc remains null?
           public function set volumeBar(s:Sprite):void {
                uiMgr.setControl(UIManager.VOLUME_BAR, s);
    In the Actionscript 9 project all the variables are accounted for so the volume bar and handle render and work fine.

    Further info for anyone who can help!
    I am opening a session from a server via the following sql
    statement:-
    http://servername/virtualdirectoryname?sql=SELECT
    * FROM table1 for XML auto&root=root"
    I only get the popup window when trying it out from our
    webserver?
    The server is MS SQLServer
    The virtualdirectory is created with access set as Windows,
    and always log on set as "myusername" + "mypassword"
    So I thought (hoped) I could pass the "myusername" +
    "mypassword"
    bits into the above sql statement (maybe appended at the
    end?)
    If I type the above sql statement into a browser it works
    perfectly with the xml returned in a web page,
    also as I state above, when I run it from within my flash
    prog on my local machine it runs OK and returns the results into
    the text area specified within the flash prog.
    BUT - When I upload my flash prog to the webserver and try it
    from there, I get a windows popup asking me for username + password
    + domainname.
    any ideas please?

  • Using PDF files with Flash

    With Flash Professional 8, can I import or attach a standard
    PDF file to a flash document so that it can be downloaded off the
    web?

    You don't need to, even if you could (which I don't think you
    can). Using the getURL() method should provide the access to the
    file so that it can be opened and saved.

  • DW CS5 use ActionScript files without Flash

    Our websites must avoid requiring a Flash download in the client browser.
    Can we use Dreamweaver CS5 with ActionScript files (.as) without requiring Flash in a browser?
    For example, DW CS5 menus include File -> New ... -> ActionScript,
    but I cannot find literature or examples on using .as with Dreamweaver.
    thanks,
    Bruce

    ActionScript is the backbone for Flash applications (FLV or SWF).
    Unlike HTML & JavaScript, ActionScript is not a web programming language per se.  It is a Flash programming language.  And while some web devices support Flash many others do not.
    If your site cannot use Flash then your ActionScript will need to be replaced with a suitable web alternative.  Perhaps jQuery or Ajax (JavaScript & CSS).
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • ECATT - How use external file/new variant for input data

    Good day,
    I want to use an eCATT created by someone else for another request. I want to be able to specify my new input data based on the new request WITHOUT generating a new Transport. Same thing as I'm doing for the CATT ... the CATT is transported but only the input data change depending on the request without generating any transport.
    How I build my new input file and how to use it? I tried to download my variant but the only possible format is XML and it's very hard to build a new file based on my request.
    Thanks for your help.
    Simon

    Hi,
    Can you tell me how you are generating the xml file. My guess is you are downloading the Test Script/ Test Configuration. In that case it creates an xml file.
    As mentioned by Ajay, In Test Configurator / Test Data -  you can create the internal variant first, i.e assuming you have already created parameters.. On the top, you have a download button "Download Variant". This creates a .txt file. You can open the file in excell and edit it.
    For the next test, you can select external variant and give the modified file path name.
    Let me know if this helps.
    Regards
    Phanidhar

  • How can I mask on flv file in flash cs4?

    Hi,
    I am new to Flash CS4. I saw one video on how to use flv file in flash and mask it. It is working fine when I am using the following option while importing a video file to flash:
    Load external video with playback component
    But when I tried with the following option it doesn't show the background, it shows only movie which is playing nicely. But not the background which has a bill board.
    Embed FLV in SWF and play in timeline
    It seems the mask is not working with this option.
    How to solve this problem? Please help.
    Actually it should be like the above.
    But when I am using the option Embed FLV in SWF and play in timeline while importing the flv video, getting the result like below: It is not showing the Bill board as above.
    See the layers created:

    Hi,
    I Tried with CS4 by creating mask layer and importing video , layers created were same as you have created and it is working for me .
    Here is the screen shot of the .fla file.
    Screenshot of .fla file

  • Is Dynamic Loading of Text from an external file possible in Captivate?

    Hello all,
    I am wondering if Dynamic loading of text is possible in captivate or not.
    As we can load an external file in flash.
    & which is the universal font to be used for the text entry box which will visible on any media?
    Thanks & Regards,
    Chirag

    Hello,
    I'm not a specialist about JavaScript. Have a look at Jim Leichliter's blog:
    http://captivatedev.com/
    Lilybiri

  • SmartObjects: placing from external files + auto-refresh

    Hello,
    when I place a SmartObject from an external file PSP CS3 seems to store it in the current file; if I change the external file, the placed object does not change automatically (I have to use the replace function to apply changes in the external file).
    Is there any way to use external files as SmartObjects and apply changes in the external files automatically?

    No at the moment everything is embedded within the file, even Illustrator Smart objects are embedded as Illustrator files. Even if you dont own Illustrator, and you get such a PSD, you can't open the smart object. External links are at the moment impossible, and it doesnt look like they are a feature of CS4 either.
    I had a freelance job recently where I was working with a team of 4 other retouchers - I desperately needed the feature of external linking preferably with server access. It would have cut hours off the job just by avoiding people having to repeat each others work. pity its not on the cards.

  • Export illustrator file from Flash Professional CS6

    Can a background/scene created in Flash profession be exported to illustrator file with extension Ai without illustrator?

    SIcsempertyrannus wrote:
    Thanks for trying to help. Some how I managed to do it-but I did it some kind of meatball way. I kept clicking into the image until everything was selected...then I grouped it all and exported as fxg because I do not have the eps option. Somehow it worked, But I have 20 of these to do and this is def not the right way to do it. Hope someone else can wise me up. Thank-you for your help.
    You did not have to group it you could have exported the image or the selection only or the movie in the FXG format (Flash Exchange Graphic) and what is wrong with doing it a newer and better way. FXG is supported in Flash Catalyst as is Illustrator and Photoshop FXG can be exported from Illustrator so you use the file in Flash more readily and though Photoshop does not support FXG that might change.
    I am leased they finally came up with a rational method of exporting to and from Illustrator and Flash.
    Eps was never the right way since Flash is not a postscript application.
    You found the right way and format you just went about it in an unusual and unneccessary way.
    Next time if you want all the art choose image instead of selection if you only need some elements of the art select them export choosing selection only that art will be exported no need to group.
    if you want the whole movie then again choose the whole movie of course that will be a motion type format not FXG.
    Anyway you sort of did it the right way.

Maybe you are looking for

  • How to add Column field in the custom Query Link search page as a header

    Hi, I have created a Query page link in web layout editor. Now, I want to customise the view of the result. I see an option to change the "Text1" and "text2", but how do I add other fields as a colum in the search result ? The only column I see by de

  • Data transfer from mac to pc using ipod

    I need to transfer some data files from my MacBook to my PC using my 30GB ipod. I get all the files copied onto my ipod from my mac with no problems. I have my ipod set to be used in disk mode. Once I plug it into my pc, it tells me that I need to fo

  • Read a file with a variable=counter : NAMEFILE001,NAMEFILE002..

    Hello, I would need your councils. I can read a logical file on my server(logical example of name: NAMEFILE) with function FILE_GET_NAME. But I would like to be able to read a file with a counter i.e. the first time: to read NAMEFILE001; the second t

  • AP 1552E NOT JOINING WLC 2504

    Hello, I am currently having issue relating to my AP not joining the WLC. Have made the WLC the internal DHCP server and the AP has picked an IP Address but the below is what i get from the AP: *Feb 14 22:48:56.707: %CAPWAP-5-CHANGED: CAPWAP changed

  • RME Fireface 800 iMac G5

    I recently purchased an RME FF 800 to use with my home recording projects. I use it to mainly record myself playing guitar with added loops in logic pro. The Total MIx to me is hard to undrstand. I was also told recently to disable software monitorin