Preloader in Document Class Help.

Hello,
I want to know that how can I add a Preloader to my existing document class. In my FLA all content is on 1st Frame. I'm loading an external image to a MovieClip which is on 1st frame and on stage. My document class is working fine but when i try to add any preloading script, its not working...
Can any one please help me in this regard..
A Garden of Thanks.
My Document Class is here...  (This was also a tutorial which I'm using..)
package com.ahmad.bg
     //import all classes
     import caurina.transitions.Tweener;
     import flash.display.Loader;
     import flash.display.MovieClip;
     import flash.display.Sprite;
     import flash.display.StageAlign;
     import flash.display.StageDisplayState;
     import flash.display.StageScaleMode;
     import flash.events.Event;
     import flash.events.MouseEvent;
     import flash.net.URLRequest;
     public class MainClass extends MovieClip
          //create variables
          private var loader:Loader;
          private static const IMAGE_PATH:String = "bgs/bg.jpg";          
          public function MainClass() {
               stage.align = StageAlign.TOP_LEFT;
               stage.scaleMode = StageScaleMode.NO_SCALE;               
               stage.addEventListener(Event.RESIZE, stageResize);          
               //load external image
               loader = new Loader();
               loader.load(new URLRequest(IMAGE_PATH));
               loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
               pic.addChild(loader);     
          private function showImage(e:Event):void
               try {                              
                    e.target.content.alpha = 0;
                    Tweener.addTween(e.target.content, { alpha:1, time:1, transition:"easeOutSine" } );                    
                    e.target.content.smoothing = true;                              
               } catch (e:Error) { };
               stageResize();
          private function stageResize(e:Event=null):void
               pic.x = 0;
               pic.y = 0;
               pic.scaleX = pic.scaleY = 1;               
               if ((stage.stageHeight / stage.stageWidth) < pic.height / pic.width) {
                    pic.width = stage.stageWidth;
                    pic.scaleY = pic.scaleX;
               } else {
                    pic.height = stage.stageHeight;                    
                    pic.scaleX = pic.scaleY;
               pic.x = stage.stageWidth / 2 - pic.width / 2;
               pic.y = stage.stageHeight / 2 - pic.height / 2;          
               //my bottom navigation
                        bottomNav.x = Math.floor(stage.stageWidth / 2 - bottomNav.width / 2);
               bottomNav.y = Math.floor(stage.stageHeight - bottomNav.height - 0);

package com.ahmad.bg
     //import all classes
     import caurina.transitions.Tweener;
     import flash.display.Loader;
     import flash.display.MovieClip;
     import flash.display.Sprite;
     import flash.display.StageAlign;
     import flash.display.StageDisplayState;
     import flash.display.StageScaleMode;
     import flash.events.Event;
     import flash.events.MouseEvent;
     import flash.net.URLRequest;
     import flash.events.ProgressEvent;
     public class MainClass extends MovieClip
          //create variables
          private var loader:Loader;
          private static const IMAGE_PATH:String = "bgs/bg.jpg";          
          public function MainClass() {
               stage.align = StageAlign.TOP_LEFT;
               stage.scaleMode = StageScaleMode.NO_SCALE;               
               stage.addEventListener(Event.RESIZE, stageResize);          
               //load external image
               loader = new Loader();
               loader.load(new URLRequest(IMAGE_PATH));
               loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
               loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preload_image, false, 0, true);
               private function preload_image(event:ProgressEvent):void
                      var per = int((event.bytesLoaded / event.bytesTotal) * 100);
                      pic.addChild(loader);
                      //make a textfield or preloader animation and assign this per to it.
          private function showImage(e:Event):void
               try {                              
                    e.target.content.alpha = 0;
                    Tweener.addTween(e.target.content, { alpha:1, time:1, transition:"easeOutSine" } );                    
                    e.target.content.smoothing = true;                              
               } catch (e:Error) { };
               stageResize();
          private function stageResize(e:Event=null):void
               pic.x = 0;
               pic.y = 0;
               pic.scaleX = pic.scaleY = 1;               
               if ((stage.stageHeight / stage.stageWidth) < pic.height / pic.width) {
                    pic.width = stage.stageWidth;
                    pic.scaleY = pic.scaleX;
               } else {
                    pic.height = stage.stageHeight;                    
                    pic.scaleX = pic.scaleY;
               pic.x = stage.stageWidth / 2 - pic.width / 2;
               pic.y = stage.stageHeight / 2 - pic.height / 2;          
               //my bottom navigation
               bottomNav.x = Math.floor(stage.stageWidth / 2 - bottomNav.width / 2);
               bottomNav.y = Math.floor(stage.stageHeight - bottomNav.height - 0);
Oh.. Thanks.. its working now... Thanks aloooooooooooooot.....
Any other tip if you have a time to give me will be a greatful to you...
Thanks again for your precious time.. I've seen your Awesome Portfolio at your website....

Similar Messages

  • Preloader and Document Class BIG question (yeap please help)

    Hy,
    I know that this its a question posted many, many times, but
    after searching the net, reading a lot of books and searching this
    forum too, I cant get out with a solution. If I'd say for sure
    there is no possibility to create something like this, I just go
    back to old methods but is not the scope of Adobe with AS3 to
    encourage the use of OOP principle or not?
    The problem:
    I have a single fla file (AS3) with a single frame on
    timeline, frame that its there when you will create the file with
    flash. In the library I have different symbols, that for simplicity
    are only jpg image, (BitmapData) checked for export for
    ActionScript and exported on frame one. An external .as file called
    DocumentClass its off course my Document Class
    This its all that I want to do with the fla, the goal its to
    create, animate etc. only with AS3 in external classes, no timeline
    script. I don't want to load external files, XML, or else in this
    movie. I just want a single swf after compilation, no additional
    files.
    Ok, how do I create a preloader that will take care of
    starting the logic after the whole swf its loaded and in the same
    time shows the user a percentage or a load bar or something that
    its not the blank screen when the swf its downloading. I want to do
    this without another swf that load this swf, or timeline scripts,
    or place all the content on second frame and then gotoAndStop to
    the third frame. All this are not solution but cheap tricks, that
    are against all this OOP principle that I just continue to read in
    books and here from guru programmers.
    The big question is:
    It is possible to create a preloader, when use a document
    class with your fla? And if yes, how?
    I know that the Document Class its not instantiated if its
    not fully loaded, if that's true when the document class will be
    fully loaded? maybe after the whole movie its loaded? And, if its
    true, it will never show a percentage bar "while" the movie its
    loaded. And if that's true WHY use a document class anyway?
    Thank you for reading this and I really wait to get some
    answer.

    I am pretty sure you cannot do self preloader with one frame
    and all the objects in the library. I guess the key here is
    one-frame design. Screen refreshes (renders) only when all the
    scripts in the frame are executed - this is a very important thing
    to understand about how Flash works. Yes, you can force screen
    refresh with updateAfterEvent() method but it is attached to a
    handful of events only (MouseEvent and TimerEvent) but, again, all
    this functionality is available only after first frame scripts are
    executed. Thus, it seems like the only way to create preloader from
    within SWF is to use multiple frames and set library objects to
    load in later (not first) frame.
    quote:
    And if that's true WHY use a document class anyway?
    Well, preloader is the last thing that would be on my mind in
    terms of using AS3 ability to link DocumentClass to the top movie.
    This feature allows for very sophisticated architectural
    approaches. It has no connection to preloader as to any other
    features developer wants to implement. Neither it depends on or
    negates timeline. As a matter of fact, although I love one-frame
    applications, I find on numerous occasions that my application
    would be more efficient if I used several (at least two) frames.
    gotoAndStop is not deprecated. It is a valid MovieClip class'
    method. After all, having only one frame doesn't mean not having
    frames at all - there is one already. Frames are fundament of
    Flash. AS3 did introduce frameless entities like Sprite, etc. but
    it doesn't mean that frames are going anywhere.
    I would agree that timeline code is inferior to
    classed/packaged (read: better organized) code but, still, how is
    it not OOP? Frame is an Object, right? Why using timeline is cheap
    and not a solution?
    On a side note, I see too many times how some authors (and
    managers) are pushing their agenda (or close mindedness) onto their
    audience with no real substantiation. Claiming that timeline in
    Flash is not valid architectural decision from OOP standpoint is
    totally wrong. As wrong as strict adherence to design patterns. I
    don't think there is sharply defined "right" or "wrong" in
    programming. One finds the best optimal solution. The goal is to
    create something that works fine. Unless, of course, the process is
    the goal - but very few of us can afford focusing on the process.

  • Document Class {add image library + preloader}

    Hi there,
    I'm learning AS3 and want to use a document class to control
    my Flash movie (i.e. I want the time line to be completely empty).
    I've run into two problems.
    1.) I have a large image in the Flash library which I setup
    with "Export for ActionScript", but I was unable to work out how to
    add the image to the displaylist as i think it needs to be added as
    BitmapData? Can anyone advise how best to do this and provide an
    example please.
    2.) I have yet to find a simple example of creating a
    preloader in a document class? There was a BizTalk website tutorial
    but I don't think that explained very well what the code was doing
    - so I'm hoping someone here can provide a code example with
    comments (if the code example could tie into the point 1. above
    that would be brilliant).
    Finally, also I'm unsure of how a document class can preload
    content that doesn't actually exist until the class itself creates
    the content, just seems a bit odd?
    Any help with these two issues would be greatly appreciated!
    Thank you :)
    Kind regards,
    M.

    Hi there,
    I'm learning AS3 and want to use a document class to control
    my Flash movie (i.e. I want the time line to be completely empty).
    I've run into two problems.
    1.) I have a large image in the Flash library which I setup
    with "Export for ActionScript", but I was unable to work out how to
    add the image to the displaylist as i think it needs to be added as
    BitmapData? Can anyone advise how best to do this and provide an
    example please.
    2.) I have yet to find a simple example of creating a
    preloader in a document class? There was a BizTalk website tutorial
    but I don't think that explained very well what the code was doing
    - so I'm hoping someone here can provide a code example with
    comments (if the code example could tie into the point 1. above
    that would be brilliant).
    Finally, also I'm unsure of how a document class can preload
    content that doesn't actually exist until the class itself creates
    the content, just seems a bit odd?
    Any help with these two issues would be greatly appreciated!
    Thank you :)
    Kind regards,
    M.

  • Class has be instantiated in document class but having issue..HELP

    Guys,
    I am making my way with AS3 in little steps and have hit a
    road block. This is what I have:
    I have a document class called "Document Class"
    I have a custom class called "Game"
    I have instantiated an object of "Game" class and I am able
    to trace a class method which return a simple "HELLO".
    within my Game class, I have a variable(type Array) called
    "questions" as instance variable.
    I would like to add questions to "questions" array by using
    "Mutator" method, or count the current elements with the questions
    array and return the total number of questions. I am unable to add
    or access elements to the questions array.
    Any help would highly be appreciated, please.

    First thing: you need to set the functions you're calling to
    public, so that you have access to them outside of your class.
    Second: you are initializing 'questions' to null. I made some
    changes and it seems to work for me:
    //////////////Game
    Class///////////////////////////////////////////////
    public function Game()
    //this.questions = null;
    this.correctAnswers = null;
    this.userAnswers = null;
    // SETQUESTION FUNCTION CAN ADD QUESTIONS TO THE QUESTION
    ARRAY;
    public function myArr():void
    trace(questions.length);
    public function AddQuestions(val:String)
    this.questions.push(val);
    trace(val);
    }

  • Document Class / Action Script Help

    Dear all,
    From a tutorial page, i manage to built this flash page with
    xml capabilities. but when i add more scene to the flash page, i
    have errors like this.
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MyContent/init()
    at MyContent()
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MyContent/onComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    How do i edit the "MyContent.as" file so that i can add more
    scene to the flash.
    I understand that, once i put the "MyContent.as" in the
    document class, it will load immediately, is there any way to tell
    it to load only in scene 2 (which is where the xml is needed).
    Thanks. Any help will be very grateful.
    Attach is the actionscript

    other then defining the document class, can i "call up" the
    MyContent.as (external script) when needed?
    If this can be done, what must i do to add into the .fla file
    and the .as file..
    Sorry, i'm very new to AS3.
    Thanks!!!

  • Today is the day the preloading will work! Help...

    I've tried and tried to find different ways to make the preloading work correctly but there is always something that doesn't seem to work with each way. Could someone dumb it down for me and help me understand how to make this work. I've read everything on the safeloader and at this link:
    http://www.stevensacks.net/2010/05/28/flash-cs5-tlf-engine-causes-errors-with-loaded-swfs/
    I've also browsed all blogs and adobe tech notes and just had no luck getting a way that always worked. Here is what I'd like to do:
    Create a preloader swf that contained a movie clip to display the percent.
    Allow the preloader swf to call functions inside of the loaded swf. (this is for stage resizing, usually)
    Be able to use the tlf textengine in my loaded swf's.
    Keep my reference to the stage or pass it from the preloader swf to the loaded swf.
    Every way I've tried seems to lose at least one of these items. Right now I have a file that uses the tlf textfield and a stage reference. It works fine as a standalone swf but it needs a preloader. In the as 3 settings the tlf is merged into the code. The extra size isn't that big of a deal, for now. However, I would love to not do that and point the preloader away from adobe's stock preloader to my own in the as 3 settings. However, I can never get it to work correctly.
    Can anyone point me in the right direction? Thanks!

    Kglad, I created a system
    that works. I will post it here so others can use it if needed.
    Outline: I'm using a custom preloader.swf to load another swf file. The loaded swf file contains a document class and the tlf textfield. I am able to load this correctly, track the percent loaded, pass the stage reference, use the tlf textfield and use the stage resize functions to dispatch listeners for sites that are 100% of the browser.
    THE PRELOADER SWF
    This file simply contains the preloader movieclip in the library and code in frame 1. I guess a doc class would work here but I have not tested. The AS 3.0 settting are the default settings for player 10.
    Code:
    //======================================================================================== =================================================
    //     import classes
    //======================================================================================== =================================================
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.filters.BevelFilter;
    import flash.display.MovieClip;
    import flash.display.Loader;
    //======================================================================================== =================================================
    //     set stage alignment
    //======================================================================================== =================================================
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    stage.addEventListener(Event.ACTIVATE, activateHandler);
    stage.addEventListener(Event.RESIZE, resizeHandler);
    //======================================================================================== =================================================
    //   variables
    //======================================================================================== =================================================
    var pre_loader:Preloader;
    var this_page:String = "sbBackground.swf";
    var load_bar_width:Number = 150; // make this the width of your image
    //======================================================================================== =================================================
    //    variables
    //======================================================================================== =================================================
    function activateHandler(event:Event):void {
    trace("here");
    //======================================================================================== =================================================
    //    variables
    //======================================================================================== =================================================
    function resizeHandler(event:Event):void {
    trace("resizeHandler: " + event);
    trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
    //======================================================================================== =================================================
    //    variables
    //======================================================================================== =================================================
    var background_ldr:Loader;
    var background_mc:MovieClip;
    var background_holder:MovieClip = new MovieClip();
    addChild(background_holder);
    //======================================================================================== =================================================
    //    init site
    //======================================================================================== =================================================
    function init():void{
    // show preloader
    pre_loader = new Preloader();
    addChild(pre_loader);
    pre_loader.x = Math.round(stage.stageWidth/2) - Math.round(pre_loader.width/2);
    pre_loader.y = Math.round(stage.stageHeight/2) - Math.round(pre_loader.height/2);
    pre_loader.load_bar.width = 1;
    // load page
    loadThisPage(this_page);
    //======================================================================================== =================================================
    //    load called page
    //======================================================================================== =================================================
    function loadThisPage(thisPage:String):void{
    // load new page
    background_ldr = new Loader();
    var pageRequest:URLRequest = new URLRequest(thisPage);
    background_ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, pageCompleteHandler);
    background_ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, pageProgressHandler);
    background_ldr.load(pageRequest);
    function pageCompleteHandler(loadEvent:Event){
    background_mc = MovieClip(background_ldr.content);
    background_holder.addChild(background_mc);
    removeChild(pre_loader);
    function pageProgressHandler(e:ProgressEvent){
    var loaded:Number = e.target.bytesLoaded;
    var total:Number = e.target.bytesTotal;
    var pct:Number = loaded / total;
    trace(pct);
    pre_loader.pct_txt.text = String(Math.round(pct * 100)) + "%";
    pre_loader.load_bar.width = Math.round(pct * load_bar_width);
    THE LOADED SWF
    This file also used the default settings for Flash player 10. Therefore, I am not merging into the code my tlf library so no increase in file size.
    The doc class:
    package com {
    // core
    import flash.display.MovieClip;
    import flash.display.Stage;
    import fl.text.TLFTextField;
    import flash.events.Event;
    // import custom classes
    import com.main.BuildStageClass;
    // initialize class
    public class DocClass extends MovieClip {
      // custom classes
      // variables
      public static var build_stage_class:BuildStageClass;
      // stage containers
      public static var main_stage:MovieClip;
      // private toggle var
      private var init:Boolean = false;
      // main constructor
      public function DocClass() {
       addEventListener(Event.ADDED_TO_STAGE, stageAddedHandler);
      private function stageAddedHandler(e:Event){
               // trace("Document Class Stage: " + this.stage);
       // initialize classes
       build_stage_class = new BuildStageClass();
       // wait until second added to stage call to initialize application
       if(init == false){
        init = true;
       else{
        removeEventListener(Event.ADDED_TO_STAGE, stageAddedHandler);
        // add containers to stage
        main_stage = new MovieClip();
        addChild(main_stage);
        // start app
        startApplication();
      public function startApplication():void{
       //trace("here at start");
       // build stage
       build_stage_class.buildStage();
    This works 100% for me without using the safeloader in the preloader.swf. I've experienced some issues with the safeloader before so not using it is a blessing.
    I hope this helps someone! Enjoy.

  • NEED TO KNOW HOW CONVERT GIF FILE TO SYMBOL FROM DOCUMENT CLASS

                                                ROBERT LEAHONG
                                      COMPUTER PROGRAMMER / ASP Web Devloper
    Hello,
            I need to convert a GIF file (PICTURE) to a symbol (Button) From within The Document Class using ActionScript 3.0 .
    Thanks in advance for your help.

    So you imported a .gif into the library and need to get to it from the document class? If that's the case you need to  right-click the image in the library, select properties, select the ActionScript tab and then set it to export for ActionScript. Give it a class name - I'll use myGif for example. You'll see it will have a base class of BitmapData...
    Then in your document class you can just instantiate it like:
    var myImageData:BitmapData = new myGif();
    You can turn it into a useable image that you can place on stage by putting it into a Bitmap object:
    var myImage:Bitmap = new Bitmap(myImageData);
    If you want to make a button out of it, ie make it clickable - stick it into a Sprite:
    var mySprite:Sprite = new Sprite():
    mySprite.addChild(myImage);
    addChild(mySprite);
    mySprite.addEventListener(MouseEvent.CLICK, clicked);
    function clicked(e:MouseEvent):void
         trace("clicked");
    HTH

  • ArchiveLink - creating a new document class - how?

    Hello,
    I want to store csv files on our archive via archive link.
    But the file type that I need is not available in R/3.
    Ok, I think here is where my solution could be found:
    -> archive link -> basic customzing -> edit document classes
    Document class:  I add "CSV"
    But what´s behind the MIME type of a web object.
    What do I have to do to fill this field with something useful.
    What is to implement behind?
    Any help is appreciated!
    Best regards
    Dirk

    if you  go  throught  there   archive  link  creation  in the  archiveing  process  ...
    FTWP   is the comfiguration   tcode  for archive   of  DART  extract ....
    there   Comtemporary  Repository    has to be  created  with   document  area->   here     dropdown  is there  for    for archieve  link ,  for MIME ,, BFT ...etc ..
    this will decide the file  format  .....
    i am working in DART   Exctraction   project  .....we  use  to  create the  archive link    for that ......
      normally   in archiving processs all the files  stored  in csv   only 
    Girish

  • Document Classes and other Questions

    Basically, i am working on an application that will eventually be deployed to the desktop as an AIR application.
    I am wanting to create an Analogue clock and Digital clock with a button that toggles the display between either one when pressed. As well as this, i will be wanting to display the Date below, i am having a number of issues however.
    I have the code sorted for three of the four components, i have not attempted to figure out the button thus far as i would be more than happy to have the digital clock, analogue clock and date all being displayed on a drag and drop desktop application first. When i say i have it sorted, i have a fully working analogue clock which i have managed to display on the desktop through air on its lonesome, however, i did not include the drag and drop function. For the digital clock and date components i am not sure how to configure them into document classes. The main issue i am having is i do not know if you can reference a dynamic text box within a movie clip to a document class.
    This is the code to show the date
    [code]{
    var currentTime:Date = new Date();
    var month:Array = new Array("January","February","March","April","May","June","July","August","September","Octo ber","November","December");
    var dayOfWeek:Array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    date_text.text = dayOfWeek[currentTime.getDay()] + " " + currentTime.getDate() + " " + month[currentTime.getMonth()] + " " + currentTime.getFullYear();
    [/code]
    I have put the actionscript frame inside the movie clip file, and i have given both the movie clip, and the dynamic text box within the movie clip the instance name "date_text".
    Basically, i am just struggling in how to put this code into a working document class, since the digital clock and date functions are both, some what similar, i feel the solution to one will more than likely lead to me discovering the solution for the other.
    The other problem i am having, i do not know how i will display all of the components on one air application. I am assuming, that you create one other document class file which links the other four together? i have tried to do this by just linking a new FLA file with the analogue clock, but it does not work. The code for that is below.
    [code]package
              import flash.events.Event;
              import flash.display.MovieClip;
              public class time1 extends MovieClip
                        public var now:Date;
                        public function time1()
                                  // Update screen every frame
                                  addEventListener(Event.ENTER_FRAME,enterFrameHandler);
                        // Event Handling:
                        function enterFrameHandler(event:Event):void
                                  now = new Date();
                                  // Rotate clock hands
                                  hourHand_mc.rotation = now.getHours()*30+(now.getMinutes()/2);
                                  minuteHand_mc.rotation = now.getMinutes()*6+(now.getSeconds()/10);
                                  secondHand_mc.rotation = now.getSeconds()*6;
    [/code]
    That is the original clock document class (3 Movie clips for the moving hands, and the clock face is a graphic, which i may have to reference somehow below)?
    [code]package
              import flash.display.MovieClip;
              public class main extends MovieClip
                        public var hourHand_mc:time1;
                        public var minuteHand_mc:time1;
                        public var secondHand_mc:time1;
                        public function main()
                                  hourHand_mc = new SecondHand();
                                  addChild(mySecondHand);
                                  hourHand_mc.x = 75;
                                  hourHand_mc.y = 75;
                                  minuteHand_mc = new SecondHand();
                                  addChild(mySecondHand);
                                  minuteHand_mc.x = 75;
                                  minuteHand_mc.y = 75;
                                  secondHand_mc = new SecondHand();
                                  addChild(mySecondHand);
                                  secondHand.x = 75;
                                  secondHand.y = 75;
    }[/code]
    This is my attempt at creating the main document class in a seperate FLA file to attempt to load the analogue clock, and later on the Digital Clock, Date Function and Toggle Display button in the same AIR application.
    Any help on this is much appreciated, i have been reading up a lot on it through tutorials and the like, but i can't seem to fully grasp it.

    why do you have code in a movieclip?
    if you want to follow best practice and use a document class you should remove almost all code from timelines.  the only timeline code that might be reasonably used would be a stop() on the first frame of multiframe movieclips.
    so, you should have a document class.  that could contain all your code but it would be better to just have your document class create your 2 clocks and date objects and possibly manage toggling between the two clocks.  you could have a separate class the tracks the time and date and that class is used by your two clock classes and your date class.

  • Document Class not work when I shift my MovieClip to 2nd Frame.

    Hello,
    All my content is at 1st frame of my FLA file...and I'm using Document Class... When I try to shift my content to 2nd frame, so I can use 1st frame for preloader.. but its not working...
    This is my document class... Basically at 1st frame I'm loading external jpg image to a MovieClip..
    Is it possible, I can **** my MovieClip and other content to 2nd frame of the timeline... ??? and Document Class work???
    Thanks...
    package com.ahmad.bg
         //import all classes
         import caurina.transitions.Tweener;
         import flash.display.Loader;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.display.StageAlign;
         import flash.display.StageDisplayState;
         import flash.display.StageScaleMode;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.net.URLRequest;
         public class MainClass extends MovieClip
              //create variables
              private var loader:Loader;
              private static const IMAGE_PATH:String = "bgs/bg.jpg";         
              public function MainClass() {
                   stage.align = StageAlign.TOP_LEFT;
                   stage.scaleMode = StageScaleMode.NO_SCALE;              
                   stage.addEventListener(Event.RESIZE, stageResize);         
                   //load external image
                   loader = new Loader();
                   loader.load(new URLRequest(IMAGE_PATH));
                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
                   pic.addChild(loader);    
              private function showImage(e:Event):void
                   try {                             
                        e.target.content.alpha = 1;
                        Tweener.addTween(e.target.content, { alpha:1, time:1, transition:"easeOutSine" } );                   
                        e.target.content.smoothing = true;                             
                   } catch (e:Error) { };
                   stageResize();
              private function stageResize(e:Event=null):void
                   pic.x = 0;
                   pic.y = 0;
                   pic.scaleX = pic.scaleY = 1;              
                   if ((stage.stageHeight / stage.stageWidth) < pic.height / pic.width) {
                        pic.width = stage.stageWidth;
                        pic.scaleY = pic.scaleX;
                   } else {
                        pic.height = stage.stageHeight;                   
                        pic.scaleX = pic.scaleY;
                   pic.x = stage.stageWidth / 2 - pic.width / 2;
                   pic.y = stage.stageHeight / 2 - pic.height / 2;         
                   bottomNav.x = Math.floor(stage.stageWidth / 2 - bottomNav.width / 2);
                   bottomNav.y = Math.floor(stage.stageHeight - bottomNav.height - 0);

    If you have code in your main class that references specific movieclips on the stage, they have to be on every frame you plan on using.
    If you have a movieclip named "pic" on frame 2, but you are referencing it right away in the main class, which starts on frame 1, then it is looking for a movieclip that does not exist until you move it to frame 2

  • TREX does not index all documents fro document class SOLARGNSRC

    Hi all,
    I've setup a connection between a TREX server (which is also used by a portal system) and Solution Manager. I've gone through the settings in SAP Note 750623 and I was able to create a index, the queue and even bypass the basic authentication in the preprocessing for document class SOLARGNSRC
    According to everything I've read, this should be enough to be able to index all documents in Solution Manager and find them with Full Tex Search. But this doesn't work. From the 50.000 documents in de class (35.000 English and 15.000 German) only 6300 documents are passed to TREX. Most of them are German HTML links to help.sap.com. I can see in the trace files that the URL's to some documents in the content server are passed to TREX. I can open dthe document using the links but I cannot find the documents using the full text search which I think means that nothing was really indexed.
    Questions:
    1. Has anyone been able to succesfully index Solution Manager documents for full text search purposes?
    2. Why are only 10% of the documents passed to TREX? Is there a specific setting for this?
    3. Why does TREX use the Content Server HTTP links to index the documents and not the RFC connection?
    Cheers
    Marcel Rabe

    Yep, all lights green
    SSR maintained. DRFUZZY as Search Engine (I have not tried Verity)
    Return Code? Interesting, I don't get an return code when I trigger the Index/Deindex. I just see the hourglass for about 5 minutes (when I run it in the foreground) and after that its back to the way it was. No messages. Nothing appears in the application logs as far as I can see.
    The program RSTIRIDX  is scheduled in the background and runs every hour minutes for about 10 seconds without an error.
    TREX Version 7.00.39.00
    Five languages actived, including German and English. In SKPR07 under Indexed documents I can see that 300 German and 6000 English documents have status indexed.
    No proxy server. Systems sit within the same network segment
    Thnx for your help. I posted a message with SAP as well as this seems strange to me.
    Marcel

  • Changing a document class to an imported class

    Hello everybody!
    My following document class is working fine. But, when I want to import it instead of using as a document class, it reports an error "1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject.". My class code is here:
    package
    import flash.display.Sprite;
    import flash.display.Shape;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    public class Shapes extends Sprite
      var square: Sprite = new Sprite();
      var txt: TextField = new TextField();
      public function Shapes()
       square.graphics.lineStyle(4, 0xFF66CC);
       square.graphics.beginFill(0x990066);
       square.graphics.drawRect(250, 35, 175, 175);
       square.graphics.endFill();
       square.buttonMode = true;
       addChild(square);
       square.addEventListener(MouseEvent.CLICK, clickHandler);
       txt.text = "A Child of the Square";
       square.addChild(txt);
      function clickHandler(ev: MouseEvent): void
       if (square.numChildren > 0)
        square.removeChild(txt);
    My FLA file script is as below:
    import Shapes;
    addChild(Shapes);
    Seeking help, please!

    You need to create an instance of the class Shapes and tha add this isntance
    i.e. something like this
    var shapes: Shapes = new Shapes();
    addChild( shapes );

  • Organising document class?

    Hi team,
    I am using a document class for a project to keep the code off the main timeline - only problem is now my document class is running to almost 2000 lines of code and becoming unwieldy to scroll through and find stuff.  Is there any way I can better organise this? Or should I be building in some other way?
    I am really not very sure on how classes actually work.  I have got this document class working but that is about as good as it gets. Any help would be greatly appreciated.
    cheers
    Sub

    When you are getting into thousands of lines of code, there is not alot you can do to avoid having to scroll thru it to find things, though you can do things to reduce the amount of scrolling needed. 
    What you could do is go thru the code and organize it into functional sections.  To aid in the need to scroll to find things, you can make use of keywords as comments in combination with the Find tool (the magnifying glass in the toolbar), and use it to jump to sections.
    You could probably break it all down into separate class files, but then it might be even moreso unwieldy for you to have to remember which file you need to look at for different things.  Still, for major functional divisions this can be useful.

  • Document Class with Flash Lite 4.0

    I'm developing for Flash Lite (4.0) for the first time and I see that in the properties panel the Document Class section is grayed out. Does this mean that Flash Lite doesn't utilize a Document Class? If so, am I unable to use any external classes? I'm not going to have to code on the timeline am I? (shudder)
    I've noticed that I can set a Document Class in the Actionscript Advanced Settings, will that work? Why is it not available through the properties panel?
    Thanks for any help.

    im wondering the same thing.
    my first thought is to include a .as class through a timeline include statement, kind of like as2 practices

  • Document class problem

    I'm working out of Colin Moock's Essential ActionScript 3.0
    and I get this message when I try to save my file: "A definition
    for the document class could not be found in the classpath, so one
    will be automatically generated in the SWF file upon export." The
    document class is set to zoo.VirtualZoo
    My .fla file sits on the desktop. Also on the desktop, there
    is a folder named zoo. Within this folder named zoo there are
    several .as files, one of the is named VirtualZoo.as
    Even when I try to run the completed file that he provides I
    get this same message. I'm running MacOS10.4.11, using Flash CS3,
    and have already reset all of my ActionScript settings within my
    preferences.
    Here's the link to the files:
    http://moock.org/eas3/examples/moock_eas3_examples/virtualzoo_Flash_authoring/
    Any help would be much appreciated,
    Joe

    I tried it from you're link and it still gave me the same
    problem. Do you think that I've changed some setting? Is there a
    way to completely reset all the defaults in flash? This sucks.
    Joe

Maybe you are looking for

  • Mail.APP has been deleted and don't know how to get it back ?

    Please forgive my stupidity, But I have deleted my Mail app I don't know how but all that appears now in it's place on the dock is a black piece of paper with a ruler and stuff. Could somebody please help me out and tell how to get it back

  • Can I download photos from I pad2 to computer

    Can I download photos from I-pad 2 to the computer? Also, how I can check or change assuring on my camera at I pad 2? How many megapixel and what size of photo i'm getting?

  • Inject EJB using @EJB in Servlet Filter on Weblogic 11g

    Hi All, I want to inject the EJB (Local interface) into the Servlet Filter and the EAR is deployed on Weblogic 11g. My question is: Shall the @EJB Annotation work on Weblogic 11g or it will be ignored in case of Servlet or Servlet Filter? OR I have t

  • Elements 13 Editor Won't Open

    I recently upgraded from Elements 11 to 13. The new Organizer works fine, and the catalogue converted fine. But when I try to use the Editor, it won't open. It asks me to sign in with an Adobe ID and to register the product. (It is registered). After

  • Keyboard start typing and make "Funk" sound by itself after upgrading to OS X Mavericks

    After I upgraded to OS X Mavericks, whenever I press the Home key (↖︎) OS X starts typing "~6" characters in Terminal and making the sound called "Funk". Also this happens after wake up and power up and randomly. On the login screen it always start m