Full action script swf dimension

hi guys i want to ask something to that been confusing me..,
if i create and swf let say for desktop application and it is full action script without any object in the stage ( movie clip and etcetera is created and placed by action script 3) not even in the library panel ( i mean no manual object that i added to library oanel and linking it to my code by using the linkage ) what would become the width  and height of this application?? let just say for example i make a slideshow swf which load it's image by reading a xml file (the url of the image file is in the xml file).
i ask this because when i test my swf (stage.width) it return 0..,
and when i loaded it into another swf i cannot set the loaded swf dimension (i did use event.complete)..,
please do help my..,
thanks..,

I'm not sure how you would do this with a swf but I know if you build a
class and in the class constructor write a param like this the-stage:*
then when you instantiate the class from the main swf just pass in this *
ie* theInstance = new myClass(this);  then in your constructor equate a
variable with the-stage  ie:  stg = theStage; then throughout your
class you can reference the stage using stg  as in this example:
stg.stage.stageWidth

Similar Messages

  • Setting External Loaded SWF dimension

    hi guys...,
    i'll be straight to point,well i'm now working on a project using action  script 3 now what i'm trying to make is a Main SWF that load whatever  other swf into it the tricky thing is that i used 1 xml document read  the external swf source and it's setting(such as it's x,y position and  it's width and height) and i'm having problem setting the loaded swf width and  height btw it's an desktop application and not a website application.,
    here is my code:
    //variable list
    var swfList:XMLList; //hold all the zone list from the xml
    var totalZone:uint; //total of zone there is in the xml
    var myURLLoader:URLLoader = new URLLoader();
    var swf:Movie Clip;//hold the loaded swf
    var swfLoader:Loader = new Loader();//loader instance used to load the external swf
    var myCounter:uint = 0;
    //load the xml file
    myURLLoader.load(new URLRequest('myXMLFile.xml'));
    myURLLoader.addEventListener(Event.COMPLETE, processXML, false, 0, true);
    function processXML(e:Event):void
        removeEventListener(Event.COMPLETE, processXML);
        XML.ignoreWhitespace= true;
        var myXML:XML = new XML(e.target.data);
        swfList = myXML.SWF;
        totalSWF = myXML.SWF.length();
        loadSWF();
    function loadSWF():void
        swfLoader.contentLoaderInfo.addEventListener(Event.INIT, swfSetting);
        swfLoader.load(new URLRequest(swfList[myCounter].@source));
    function swfSetting(e:Event):void
        //making new instance of sprite to hold the new loaded swf
        swf = new MovieClip();
        //casting the loader content into a movieclip
        swf = e.target.content;
        addChild(swf);
        swfLoader.unload();
        swf.x = swfList[myCounter].@left;
        swf.y = swfList[myCounter].@top;
        swf.width= swfList[myCounter].@width;
        swf.height= swfList[myCounter].@height;
        addChild(swf);
        if(myCounter < totalSWF)
            myCounter++;
            trace('myCounter: ' + myCounter );
            loadSWF();
    and here is what the result ( it make the width and height of the loaded swf to 0):
    swfLoader.contentLoaderInfo.width : 320
    swfLoader.contentLoaderInfo.height : 240
    module: MyVideo/flvplayer.swf
    x:0
    x container:0
    y:0
    y container:0
    xml width:550
    width container:0
    xml height:400
    height container:0
    myCounter: 1
    swfLoader.contentLoaderInfo.width : 550
    swfLoader.contentLoaderInfo.height : 400
    module: AnalogueClock.swf
    x:50
    x container:50
    y:0
    y container:0
    xml width:250
    width container:250
    xml height:200
    height container:200
    myCounter: 2
    swfLoader.contentLoaderInfo.width : 800
    swfLoader.contentLoaderInfo.height : 30
    module: MyNewsticker/newsticker.swf
    x:0
    x container:0
    y:0
    y container:0
    xml width:300
    width container:0
    xml height:50
    height container:0
    most of my loaded swf beside the analouge clock is full action script code and in case of the analouge clock it is a swf that has a movie clip on it's stage (the other are fully created from action script 3.0)
    please do help me..,
    cause i'm already really desperate and going crazy by this problem..,

    sorry i copied the code from the other swf i used to do try and error test..,
    basically the container is the same as swf varibale
    here the code so you would'nt get confused:
    //variable list
    var swfList:XMLList; //hold all the zone list from the xml
    var totalZone:uint; //total of zone there is in the xml
    var myURLLoader:URLLoader = new URLLoader();
    var swf:Movie Clip;//hold the loaded swf
    var swfLoader:Loader = new Loader();//loader instance used to load the external swf
    var myCounter:uint = 0;
    //load the xml file
    myURLLoader.load(new URLRequest('myXMLFile.xml'));
    myURLLoader.addEventListener(Event.COMPLETE, processXML, false, 0, true);
    function processXML(e:Event):void
        removeEventListener(Event.COMPLETE, processXML);
        XML.ignoreWhitespace= true;
        var myXML:XML = new XML(e.target.data);
        swfList = myXML.SWF;
        totalSWF = myXML.SWF.length();
        loadSWF();
    function loadSWF():void
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfSetting);
        swfLoader.load(new URLRequest(swfList[myCounter].@source));
    function swfSetting(e:Event):void
        //making new instance of sprite to hold the new loaded swf
        swf = new MovieClip();
        //casting the loader content into a movieclip
        swf = e.target.content;
        addChild(swf);
        swfLoader.unload();
        swf.x = swfList[myCounter].@left;
        swf.y = swfList[myCounter].@top;
        swf.width= swfList[myCounter].@width;
        swf.height= swfList[myCounter].@height;
        addChild(swf);
        if(myCounter < totalSWF)
            myCounter++;
            trace('myCounter: ' + myCounter );
            loadSWF();
    well in my code i did cast the loader into a movie clip and then set it's width and heigt,right???
    wouldn't it just give me the same result??
    if it's not can u describe what u mean in more detail??
    some example about accessing the loader content would be really appreciated

  • Projector's "Full Screen" viewing action script for Flash Cs5.5

    How do I set a Projector to "Full Screen" viewing on Flash Cs5.5
    Knowing that it already has action script.
    I have tried to add FSCommands on top, to no avail.

    stage.displayState="fullScreen";

  • .SWF Redirect Action Script

    Hi, I was wondering if someone could make me a .swf redirect
    action script I don't have any programs to do this. If someone
    could me a the .swf redirect to
    http://www.freewebs.com/self_concept/myspace.html
    that would be awsome heres a example of my friends.
    http://img241.imageshack.us/img241/1194/madfriendsyorn3.swf
    it redirects to a page thats not up anymore. But thats what I want
    it to do. thanks. just reply me back were I can download the .swf
    you uploaded. :)

    getURL("
    http://www.freewebs.com/self_concept/myspace.html","_self");

  • Flash photo gallery - loading first movie - action script

    Hi,
    I have a movie gallery (they are basically images with a fading effect), and I got it setup, and working, but I cannot get right the action script to make the first movie load when the page opens. The only thing I get to see is the scroll bar with the thumbnails, and after I click on the images I can see the full size. I would like the full size image of the first thumbnail to show up as default when the page opens. And then, if you click on the thumbnails the other images will appear. This is my link:
    http://www.mauriciolopez.info/paintings/
    This is the action script for a typical Thumbnail (setup as a button):
    on (release) {
    loadMovie("clip0.swf", "_root.screen");
    I appreciate your help!!!!
    Thanks!!!!

    Rob, thanks for your answer. I do have a movieClip, at the root level. All my other movies load when I click the thumbnails. For some reason I'm not able to make a video appear before clicking on the thumbnails. I'd like to open the gallery and see the first video full size (automatically), before even clicking the thumbnails. Then, when you scroll and enlarge the other ones, they will replace the default one. I haven't been able to make it do this, and it's driving me crazy....
    Thanks again for your help.

  • How do I use the button states in an action script?

    In my Captivate 8 project I use smart shape as buttons. The buttons have different images presented dependent on the state of the button. I have also created a simple action script that shows what happens when the button is pressed. When the button has been pressed the normal state of the button appear. I, however, want the down state of the button to remain visible util the user presses another button. How do I accomplish this? Is there variables for the buttons different state or how can I create that?
    BR,
    Madeleine

    When you talk about 'actionscript' do you mean advanced or shared actions? You cannot write actionscript within Captivate, only Javascript. If you use advanced/shared actions they'll be converted on runtime to either Actionscript (for SWF output) or Javascript (for HTML5 output).
    The states in shape buttons are the normal way buttons behave (not only in Flash). If you are indeed using shared/advanced actions, and you want the down state to remain until the next shape button is clicked, you'll have to go the way described by iFlashAppsToo. Create shapes that have the look of the down state, make them initially invisible and group all those shapes on one slide. Add two statements to the shared/advanced action (please do use shared actions, you'll save time):
    Hide Group   so that eventual down mimicked states on previously clicked buttons disappear
    Show Im_Downx    to show the down image for that button

  • Error while loading an child movieclip if the child has any action script

    Hi
    I am developing an application where I need to load a child.swf . All works fine when I load the mc but as soon as I add Action Script (lets say trace("test")) to the Child.swf I get a Error #1009: Cannot access a property or method of a null object reference. On the addChild line.
    Code
    trace("Toothpaste click");
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("Child);
    mLoader.load(mRequest);
    mcContainer.addChild(mLoader);

    Sorry.Thanks
    Typo on the forum.
    I can load the child.swf see the image/text in the child  displayed in the parent but as soon as I add as3 to the child page I receive the above mentioned error. If I run the child.swf from the IDE or by itself everything works fine .
    trace("Toothpaste click");
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("Child.swf");
    mLoader.load(mRequest);
    mcContainer.addChild(mLoader);

  • Error in phase of assigniment Action Script

    Hello Guys!
    I created the following action script named "sketch.as" :
    package
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import com.adobe.images.JPGEncoder;
    public class sketch extends Sprite {
    public function sketch():void {
    //this is your documentclass constructor
    stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);
    Mouse.hide();
    function moveCursor(event:MouseEvent):void
        pencil.x = event.stageX;
        pencil.y = event.stageY;
    var canvas_mc:MovieClip = new MovieClip()
    addChildAt(canvas_mc, 0);
    canvas_mc.swapDepths
    function sketch()
    canvas_mc.graphics.beginFill(0xFFFFFF);
    canvas_mc.graphics.drawRect(0, 0, 600, 500);
    canvas_mc.graphics.endFill();
    canvas_mc.addEventListener(MouseEvent.MOUSE_DOWN, startDrawing);
    canvas_mc.addEventListener(MouseEvent.MOUSE_UP, stopDrawing);
    canvas_mc.addEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function startDrawing(event:MouseEvent):void{
    canvas_mc.graphics.lineStyle(1, 0, 1);
    canvas_mc.graphics.moveTo(mouseX, mouseY);
    canvas_mc.addEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function stopDrawing(event:MouseEvent):void{
    canvas_mc.removeEventListener(MouseEvent.MOUSE_MOVE, makeLine);
    function makeLine(event:MouseEvent):void{
    canvas_mc.graphics.lineTo(mouseX, mouseY);
    sketch();
    var serverPath:String = "";
    function createJPG(m:MovieClip, q:Number, fileName:String)
    var jpgSource:BitmapData = new BitmapData (m.width, m.height);
    jpgSource.draw(m);
    var jpgEncoder:JPGEncoder = new JPGEncoder(q);
    var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
    var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
    var jpgURLRequest:URLRequest = new URLRequest ( serverPath+"jpg_encoder_download.php?name=" + fileName + ".jpg");
    jpgURLRequest.requestHeaders.push(header);
    jpgURLRequest.method = URLRequestMethod.POST;
    jpgURLRequest.data = jpgStream;
    var jpgURLLoader:URLLoader = new URLLoader();
    //jpgURLLoader.load(jpgURLRequest);
    navigateToURL(jpgURLRequest, "_blank");
    save_btn.addEventListener(MouseEvent.CLICK, saveBtnPress);
    save_btn.addEventListener(MouseEvent.ROLL_OVER, saveBtnOver);
    save_btn.addEventListener(MouseEvent.ROLL_OUT, saveBtnOut);
    function saveBtnPress(e:Event):void
    createJPG(canvas_mc, 90, "sketch");
    function saveBtnOver(e:Event):void
    Mouse.show();
    pencil.visible = false;
    function saveBtnOut(e:Event):void
    Mouse.hide();
    pencil.visible = true;
    Lately I created a file .fla in the same root of the file .as naming it "sketch.fla"
    When I try, in the Adobe Flash CS4 Professional screen, to assign to  ".fla" in the properties Publish my action script, the following message appears:
    “A definition for the document class could not be found in the classpath, so one will be automatically generated in tha SWF file upon export.”
    Obviously, it doesn’t function
    Could somebody help me??

    i don't understand, "When I try, in the Adobe Flash CS4 Professional screen, to assign to   ".fla" in the properties Publish my action script, the following message  appears:"
    but i do understand that error message.  you need to assign the document class for your fla.  in the properties panel with the backstage selected, assign sketch in the class or document class field.

  • Is Import to DRM by action script the only way to build hierarchies?

    Hi,
    If I am getting by source file as a big generation wise excel format and even properties in excel sheet with large number of custom property field values.
    Is making a Import action script out of the excel to load to DRM is the only way, or do we hav any other option to load these hierechies to DRM from excel without going fpr manual efforts in making scripts one by one for large no of dimensions.

    hi, the import functionality can build hierarchies. It has a draw back of only building NEW hierarchies. So if your source master hierarchy is external to DRM, action script or API is best way, if it is to be automated. If this is only be imported/updated once a month the import can be used to create the "new" version. You can use then blend update your old version.

  • Action script 3 and adding code to buttons

    When I open a new doc and selct action script 3 it won't
    allow me to insert code by selcting the button on the stage. It
    does if I select action script 2. All my old pages update ok but if
    I make new buttons it wont take the code. CAn someone tell me what
    is going on???
    Thanks a lot

    If your in a bind at the moment, I would suggest not
    attempting to learn AS3. The system is very different, good, but
    different, the syntax structure is much more strict and most things
    have been revised to use a listener/broadcaster (or event
    dispatcher) model, as well as most coding being class oriented,
    additionally the graphic display structure is quite different.
    Now did you change your publish settings back to AS2? If so,
    you should still be able to apply the above code to a button
    instance. However, as Dave stated, even in AS2 the code is best
    used from the timeline, to do so with the code above (which the on
    handler above is meant for Object attachment) you need to write it
    like this:
    my_btn.onPress = function() {
    _root.loadMovie("graphic_arts/graphic_arts.swf");
    I would also consider using a MovieClipLoader and the
    loadClip method forloading swf files, as it gives you more control
    over the load targeting, progress reporting, and event
    notifications.
    All this said, to use a button and load a file in AS3, you
    need to add an event listener to the button instance and construct
    a responding function to the event, in this case the loading of a
    swf file. Additionally, in AS3 the MovieClipLoader class, as well
    as the loadMovie methods have been replaced by the Loader classes
    and must be used to load swf files. So construct a button in AS3
    you must write something like the following:

  • Where do I put my Action Script?

    So, I created a small Flash site with no loading of external
    swfs. I am strictly using the timeline using labels. I have a layer
    for my main buttons (home, portfolio and timeline). I have selected
    AS3 for the file and I have those buttons working fine.
    I have a button for my portfolio where thumbnails will pop up
    after being pressed. I want to link those thumbnails to the URL's
    of the actual websites. Where do I put the action script?
    I also want to have my email at the bottom of the screen so
    you can click on it to email me. I am used to using AS2 whwere you
    simply put the code on the button.
    Thanks,
    Gabe

    Hey, so thank you for the fast reponse. I totally agree with
    you on learning AS3, I don't want to go back to AS2.
    I already have the code you supplied so I understand what it
    is doing but my question is where do I put it in this case? I
    always create an action layer as you mention. In my action layer, I
    have frame 1 with my preloader code and then frame 2 with my code
    for my main buttons. They call to the labels. So, when I press
    portfolio for example, it goes to that label.......a shape tween
    starts and my portfolio thumbs appear. I then want those thumbs to
    link to the URL of those sites.
    So, where do I stick your code?
    Thanks again for all your help. I am NEW to AS3 and this is
    great learning.
    Thanks,
    Gabe

  • CS3 action script 2.0: compiled clip components do not appear in the component panel

    Hi,
    I have a FLA file containing 3 compiled clip components.
    I use a MXP file to copy this file to the components panel,
    this works fine when using Macromedia Flash 8 or Macromedia MX
    2004, but when using CS# the components do not appear in the
    components panel, only if a use regular component or SWC component
    it appears in the panel, any reason why?any ideas?
    Thanks
    Maya

    I can use this code from html. I'm able to say where the swf
    and xml file are. I just don't know how to do this using action
    script.
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    width="768" height="576" id="tech" align="middle">
    <param name="movie"
    value="slideshow.swf?xml_path=musicbox_slideshow/slideshow.xml"
    />
    <param name="quality" value="high" />
    <embed
    src="slideshow.swf?xml_path=musicbox_slideshow/slideshow.xml"
    quality="high" width="768" height="576" name="tech" align="middle"
    allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>.

  • Using  FDM Import Action script to import data from ERPI table "tdataseg_t"

    Hi Experts
    I have extracted data from EBS using ERPI and loaded into the intermediate table "tdataseg_t"
    I am trying to use Import Action script within FDM to extract data from "tdataseg_t" table (where ERPI extract data is stored) as i could not use the normal import script.
    Requirement : I have to restrict the custom 2 dimension based on Account dimension.
    Dim Account
    Account = ???? ( i am struck here)
    If Account = 1000 to 5000 Then
    Custom2 = Right( product , 5)
    End If
    but , I could not find the exact syntax to call the Account dimension from the "tdataseg_t" table.
    Please Advise
    Thanks
    Sak
    Edited by: user12292415 on Feb 26, 2012 1:19 AM

    Hello,
    Importing data via a manual script defeats the purpose of ERPi. As it will not provide you an audit trail, drill-through/drill-back, etc.
    Your best bet is to use the default settings by the software. Just because it returns more records than you want is not a bad thing. You can conditionally change/alter the information either in an EventScript inside of FDM or by mapping the un-needed information to IGNORE.
    Thank you,

  • Action Script Import

    Hey Guys I love the idea and I know it is a daunting task to convert .fla into html5. I am working on removing any action script in any of my .fla files so that, 1: they may convert, but in doing so I realized that It may be possible to create a seperate stand alone action script...place it in the server, and the import said script into html5 the similar way you would when calling an image href, but the problem is... How if at all would I be able to import script into html5, and/or java for each individual scene related to a large .fla? My thoughts are I would need to create a new individual (Java class's) related to each individual action script scene and then import those into the html5 code! I am on track with the thought, or am I just crazy...
    In order to accheive this I would need to import the action script standalone into the root folder any recommendations?
    For example: stop(); frame 10 scene 1 layer Bck_Ground
    Then file name would be: layer 1 Bck_Ground.AS
    Java class  1Bckground. js
    .requires(
    bck_ground.as
    This only as an eample of thought not real code!
    and or the ssame ideal in HTML5?
    Could this work?
    Thanks James

    Then no offense to Adobe, but this to me is an intermediate way of creating an animated gif...Granted if I wanted to create a animated gif from.swf I have to go through several steps, but at least I don't get the annoyance of ".fla not supported"! My input to Adobe in your Wallaby creation is this...Please consider the creation of a re-write enging for pre-existing action script that will interpelate the data of each scene, and layer directly from the .fla, and then import it into several native languages that the user can select such as java, html5, possibly C, xml, and be compatible for Mobile Web, IOS, SDK, and Stand-Alone Java!, and export all media assets into a seperate file folder with the a fore mentioned extensions placed and housed with coresponding media...After-all none of us Flash Heads really want to re-write code the hours of code we spent developing for a product that can't or won't be seen by mobile applicatioins. If you can do that I would pay my top dollar for it...and I would think everybody else would agree with me! Thanks for your hard work...keep plugging along!
    James

  • How to use fscommand or equivilant in action script 3

    Hello every one,
    I am new to action script 3, I want to burn my flash
    projector file on a CD so that when it plays it opens in full
    screen mode with movie size set to 100% and no scaling allowed. I
    use to do it with FScommand in previous versions but it doesn't
    work in flashcs3. Can someone help this poor soul how to use it in
    actionscript3.
    Thanks in advance.

    do a search for fscommand in the Flash CS3 help and look for
    a file heading called AS2.0 Migration Once you find that file, do a
    search for fscommand again inside the document.

Maybe you are looking for

  • Blank screen on Mac Mini running Boot Camp 3.1 with XP SP3

    After upgrading from 3.0 to 3.1 of Boot Camp I now am getting a blank screen after Windows finishes it's loading screen. Booting to safe mode works. I have tried uninstalling 3.1 and reverting back to 3.0, but the issue remains. Reinstalling 3.1 agai

  • Font Rastering Problem

    Hi All... this thing is driving me crazy. Got this Win 2003 Server with a Fonts problem: all fonts (problem is more evident using Serif Fonts like Times New Roman, but happen with all fonts) are displayed in a bad way. Seems like problem on smoothing

  • Workbbok is very slow

    Hello, I have a workbook which is very havy to use in one computer(even to move from one cell to the other) while in the other computers it runs very fast. The workbook doesnt have any calculations in it. what can it be? Please Advice, David p.s I fo

  • Transfer from PC to MacBook

    How do I transfer my Itunes from my Dell to my MacBook when I get it?

  • Report of material BOM

    hi! I want to get a report of all the fert materials that don't have a BOM (the BOM created with cs01) thanks!