How to resize an object and show on stage

Im trying to resize a simple object according to what dimensions I set, but it does not work.

so now the stageHeight and width is 600 x 600 and it still does not work.

And how do I resize the object immediately when the SFW load (so early, it will be 3 times bigger)

I have a MainClass with this code

                        public var  rescaleRatio:Number = 1;
                    public var _element1:CreateRow_Col

                    public function MainClass_Test() {
                    addEventListener(Event.ADDED, init);
                    _element1 = new CreateRow_Col(rescaleRatio)
                    addChild(_element1)
                    }

                    public function init(e:Event):void{
                               stage.scaleMode = StageScaleMode.NO_SCALE;
                                 stage.align = StageAlign.TOP_LEFT;
                                 stage.addEventListener(Event.RESIZE, setUpScreen);
                    }


                    public function setUpScreen(ev:Event):void{
                              stage.removeEventListener(Event.RESIZE, setUpScreen);
                              if(stage.stageHeight > 500){  
                                        rescaleRatio = 3;  
                              }else 
                                        rescaleRatio = 5;  

                    }

and the CreateRow_Col class has this

public class CreateRow_Col extends Sprite {

                    public var theAppliedScale:Number;
                    public var myObject:BG = new BG()

                    public function CreateRow_Col(reScalling:Number) {
                              theAppliedScale = reScalling;
                              addEventListener(Event.ADDED_TO_STAGE, zzz);
                    }


                    private function zzz(e:Event):void {
                              removeEventListener(Event.ADDED_TO_STAGE, zzz);
                              myObject.scaleX = myObject.scaleY = theAppliedScale
                              addChild(myObject)
                    }

Copy the following code and paste it into your document class:

package {}

import flash.display.MovieClip;

import flash.events.Event;

SerializableAttribute public class MainClass_Test extends MovieClip {}

                        public var  rescaleRatio:Number = 1;
                    public var _element1:CreateRow_Col

public function MainClass_Test() {
                    addEventListener(Event.ADDED, init);
                 
                    }

public function init(e:Event):void{
                               stage.scaleMode = StageScaleMode.NO_SCALE;
                                 stage.align = StageAlign.TOP_LEFT;
                                 stage.addEventListener(Event.RESIZE, setUpScreen);
setUpScreen(null);
                     }

public function setUpScreen(ev:Event):void{
                              if(stage.stageHeight > 500){ 
                                        rescaleRatio = 3; 
                              }else
                                        rescaleRatio = 5;

}

 if(!_element1){ _element1 = new CreateRow_Col(rescaleRatio);                    addChild(_element1)} else {_element1.zzz(null);  //<-make zzz() public in your other class.}

}

}

}

Tags: Adobe Animate

Similar Questions

  • How to resize an object and also to mitigate the effects (transparencySettings)?

    I want to to scale an object through script but also effects nationwide, currently my resizing does not only. My effects are TransparencySetting: drop shadow, inner glow, outer glow.

    For example using the following does not work:

    pdf.resize(CoordinateSpaces.innerCoordinates, AnchorPoint.topLeftAnchor, ResizeMethods.multiplyingCurrentDimensionsBy, [pointSizeScale, pointSizeScale]);
    
    

    I have to resize the effects that I have at hand for example:

    thisObj.transparencySettings.dropShadowSettings.xOffset = dSXYOffset*pointSizeScale;
    thisObj.transparencySettings.dropShadowSettings.yOffset = dSXYOffset*pointSizeScale;
    thisObj.transparencySettings.dropShadowSettings.size = dsSize*pointSizeScale;
    

    Thanks in advance!

    I think that by using a transformation matrix will solve your problem (pdf.transform (.))

  • How can I watch movies and shows with my dishanywhere account?

    How can I watch movies and shows with my dishanywhere account? Is required to download the video optimizer dishes online but surface rt will not let me.

    Hi Emily,.

    1. what browser you use to access dishanywhere account?

    2. what exactly happens when you try to watch movies through dishanywhere?

    3. have you successfully registered your account on dishanywhere?

    4. What is the exact error that you receive when you try to install the video optimizer online?

    Dishanywhere may require a user to install some software on a computer before using their services on this computer. But in Windows RT, we cannot install anything outside of what is available in store Windows. So, if dishanywhere was indeed need applications must be installed in a computer, we are not able to do in a Windows RT device.

    Therefore, I suggest you check with the support of dishanywhere once to see if we need any application to be installed on a computer to use their services.

    For your reference:

    http://www.dish.com/technology/dish-anywhere/

    http://www.dishanywhere.com/

    http://www.mydish.com/support/dishanywhere?WT.SVL=container

    Please answer back with more information to help you further.

  • How to resize the object + text lighting

    Hello

    1 lately, I can't resize an object.

    The surrounding border of the object is with filled rectanglers and

    not with rectangler hollow. So, I can't resize objects - how can I solve this problem?

    2. when I try to mark the text, there score perfectly but I do not see the location eventhough I choose what he.

    How can I mark the text and display the marked text (marked selected text)

    Kind regards

    Koko Fiko

    Koko Fiko,

    You can open the view drop-down list and check out the edges and Bounding Box (both must hide, indicating the possible action, implying that are displayed).

    According the description I'm not sure who can apply.

  • How to change data objects and update the corresponding task and task forms?

    Hi all

    I modified this thread because I found that I had many questions to ask.

    1.
    I'm quite new to OBPM and would like to know how to change data - for clarity objects add a new attribute "Dependents of the Client" "Customer care" - and therefore update the task that uses the 'customer information' what makes via data binding - I get an error message here - or via the data about the data Task-The chosen tab it does not appear to be linked to my approach in some sort.

    2.
    Will be the task form that I generated earlier in < 1 > update automatically? Is it possible to update manually if the task has been clearly customized?

    3.
    What are the objects of project data? They do not store values in my process. They are for the arguments only - like reusable process?

    Thanks in advance,

    Kind regards

    Yanis

    Hi Yanius,

    (1) assume that you start from scratch. First, you declare your data object structure. To do this, you must go to the BPM project Naviagtor, right-click on 'Catalogue of trades' and create a new Module. Then you can right click on the module you created and select the new object of trade. Add all the attributes you need. It is the same to declare a class in Java. Second, you must declare a variable of the type process you have created: select the process, go to the Structure display (if you don't go and activate it in menu view Jdev-> Structure). Right click on the Process data object and create your variable. It's like setting a variable in Java. In short, answering your question, make the path opposite: find in your process of type "Customer Details", then go to your catalog Business, right click and change the definition to add what you need.

    (2) the human task will not update automatically (annoying). If you change the object itself, so you don't need to change your mappings because actually there the same object you are through the task as in / out argument. There are two things here: the human task and form associated with it (where probably change you the subject i.e. customer details). Go to the form (.jspx) - click on the tab links (by default, you are in the Design). In the links page, there is a link on top: "Page Définition File" (something like proj/pageDef/...xml). Open the XML file and go to the source. There you can add manually now all the attributes you need and that were not available before (i.e. dependent Client). It's a little complicated, but at least you don't have to recreate it. particularly useful if you have already implemented and subsequently form, you need to add more things (business is very good to say otherwise, "I would like to see something else in the form" ;)

    (3) project data objects are visible by all processes that you have in the project rather than the object of process data that are visible only to the method where you set the variable to. This means that you declare an object of data of the project once and then it will be available to all processes. Keep in mind that each process has a copy of it. In other words, it is not like a global variable that everyone sees. If edit you in a single process, other processes will not see the new value.

    I hope that I have answered your questions.
    See you soon,.
    Felipe

  • Problems with rotation, resizing of objects and paths

    Hello

    I've recently upgraded to CS6 (latest version of MAC OS x, Illustrator CS6 last version) and I have some super weird questions that occur.

    If I flip a non uniform in shape of path/object it distorts and modifies. Even if I apply a stroke to the path/object and then remove it, it changes the position and shape of the object/path.

    I've attached a video for example:

    Has proved to be a problem with the option 'snap to grid of pixels. For some reason even if I unchecked it from the options when you create a new file, it was always create objects with the option selected in the Trnasform Panel

    Now, I disable when you create a new file and verify that it is turned off during use.

  • How to resize the layers (and keep the properties)

    Hello to all and forgive my lack of knowledge of the AferEffects.  Currently, I got the task to my work to create a video for a display at a local arena.  The height of the screen of the arena is 36px.  I bought a model of Envato that I liked but resizing has been a problem.  I created a new composition for the appropriate specifications and copied the model layers in my new composition.  "Then I went to the size equal to the composition but noticed that there are layer 'points' and I guess that 'transformations or effects' ' are not scale with the height of the composition.

    Is there an easy way to resize the layers and all their properties to meet up to my composition?

    Thanks in advance and I promise you I won't go to the current on the use of AE, but for the moment I'll have to get finishing with searches google and help forum.

    Have you tried to use the script of the Composition of the ladder by going to file - Scripts - scale Composition.  Define a height 36, click scale and then copy and paste all your layers model comp above the 36 x 2760 model. Who should maintain relationships between all layer properties in the model.  Forgive me if I'm struggling to understand what you're trying to do, but a few screenshots of your comps might help illustrate your workflow.

  • How to reduce an object and also the race together...?

    Hello

    The subject line was not easy to convey what is my problem.

    Here goes.

    When I have a line on something and I reduce the race remains the same, so it seems bigger.

    Is there a way to prevent this?

    So, when I reduce a vector image I did not find the object and manually set the race.

    I hope this makes sense

    Sorry, but im English is my mother tongue...

    See you soon

  • How to resize a document and its content?

    I'm having trouble, only part of this page, on my document and resizing of a single page.

    First details: my page dimensions are 800 x 1200. On this black background, there is texture layer measurement 760 x 130 up (for the declaration of name/logo/misson of the site) and 760 x 990 below (for content and graphics of the site). There are 20 px border (between textured layer and background) on the top and sides and 10 px border at the bottom. The gap between the top and the main textured areas 50 px is for the navigation bar.

    Now the problem: I want to resize a page at 800 x 1250 px. And to complicate things, I want to only push the lower part of these 50 px, so that the layer of texture which measures 760 x 1040 (I need to add something to the main content of the page, so I don't want to influence the size of bar of navigation or the name/logo of the site).

    Instructions for adobe (http://help.adobe.com/en_US/Fireworks/10.0_Using/WSAE41683F-ED20-4488-9389-79DC28BD7CE0.ht ml) were not much help. I go to modify > canvas > size of the Image, change to 1250 pixels, Unsnap "constrain proportions" and click on "resample image" and "current page only." When I do this, enlarged both the black background and the layer textured to the size I want. But it also:

    1 change the entire page - in other words, it pushes the navigation bar and the areas of logo as well as the main content section.

    and, strangely,.

    2 layer textured on my two dozens of other pages is growing, but not the black background. In other words, I change the background and the layer size on the page I want to edit, but I inadvertently as the textured layer (but not substantive) on all my other pages. (If the texture on all other pages now spills on black background).

    So my question: How can I resize only the main content background and layer textured on one page? Is it still possible?

    A big thank you to all those who can help. And my apologies for the long explanation.  But I am new to the Web design and Adobe Fireworks, and I tried to be as clear as possible about the problem.

    PS Si importantly, I'm using Fireworks CS4

    OK if this rectangle is on the master page, but must be in a different location on some pages, you need to delete the master page, add it to a page in your design (on its own layer) and then share that layer to all pages except those who are different in the dimension.

    Add the object to the longer page (not shared this time) and scale it as needed.

    Sharing layers to pages is much more flexible than the application of objects to the master page.

    HTH

    Jim Babbage

  • How can I update time and show it.

    I have to show the current time in a tab in my application...

    my date format is hour: minute (hh: mm)

    Show I want to upadte my dateField in every minute...

    How can I do this... I don't want to use wire...

    BlackBerry API has a RealTimeListenerinterface...

    It has a clockUpdate() function

    I can solve my problem with this interface...

    Help, please...

    Or if you know how to do it with wire you can also answer...

    The RealtimeClockListener interface is the perfect tool for this.

    Here is a snippet of code showing how you can use this to a DateField.  Note how the listener is added when the field is displayed and removed when it is not.  Code is not compiled, probably syntactically incorrect, but I hope you get the idea.

    public class updatingdatefield extends DateField implements {RealtimeClockListener}

    ....

    public void onDisplay() {}

    Application.getApplication () .addRealtimeClockListener (this);

    }

    public void onUnDisplay() {}

    Application.getApplication () .removeRealtimeClockListener (this);

    }

    public void clockUpdated() {}

    final UpdatingDateField myDateField =;

    UiApplication.getUiApplication () .invokeLater (new Runnable() {}

    public void run() {}

    myDateField.setDate (System.currentTimeMillis ());

    });

    }

    I would avoid using timer for this.  This one uses just one wire under the covers in any case!

  • How to get to share and show of cisco

    Hello

    I have a multimeter with version 5.2 and since that I have it on my licesing show and share. But how do we install show and share? I can install it on server DMM? Do I need to install it in another server? Where can I download it? I think the show and share installation is called SS - 5.2.0.20.iso, but I found it not on the download section for the cisco support.

    Mario,

    Show and Share (SnS) is a device just like your manager of digital media (DMM).

    You buy the appliance from Cisco or Cisco partner.  Then, you must

    to buy licenses to use for authors etc...   The device software is not separated

    of the material and is not downloadable.

    Please contact your Cisco sales representative or account for more explanations and they

    can help you with your business needs.

    Thank you!

    T.

  • How to resize an object on a layer, while a certain characteristic of the image measures a certain width?

    Hello

    I have a number of images of preparation of animals and they all must be 40mm at 300 DPI from tip of nose to their buttocks. The problem is a bunch of them have antennas, of long ears, long tail, etc. which may not be included in the measure, which prevents me to perform the entire image a certain size. How the entire image would turn so I can be sure that most of the animal measured exactly 40mm? TYIA!

    Crop the image for measurement points (do not delete the cropped pixels). Then the Image-> resize to 40 mm wide with 300 dpi. Then select reveals all and crop once again if you want.

  • How to divide an object and preserve its gradient?

    Hello!

    I tried to do something that seems simple enough, but unfortunately I failed. I tried to find advice on the forums, but did not as well. So hopefully someone here can point me in the right direction.

    I have an object with a gradient (in my case a simple triangle - see below) now I want to divide it into 4 parts without losing the way in which the object appears.

    ex1.jpg

    No matter how I try, I always end up with 4 parts which each have degraded originally applied to them (see below).

    ex2.jpg

    I would like to get something that looks like this:

    ex3.jpg

    I hope that I can do this with Illustrator and someone knows how. Thank you very much!

    Simply select the 4 pieces and use the gradient tool to drag the gradient across all 4 pieces.

  • How do I programmatically load and show the façade of a vi but NOT run it?

    Is it possible to load and display the front panel of a vi but NOT run?  I start with the AsynchronousCallAndForget.vi from the example finder and inserted a node invoke with the Open FP method call before the starting node the asynchronous call. The vi that I'm loading has the "Run when opened" unchecked and the menu bar IS visible so I can manually click the run arrow. Thank you!

    Why do you use the asynchronous call? If you simply open the VI reference, then call the FP. Open method, it works very well. You can then call the VI run method which wait until is set to false if you want to execute asynchronously, it is how we did in ye olde days before we have this fangled tricks "Start Asynchronous Call.

  • How to read the objects and collections dynamically?

    Hello
    I want to read database/collection objects dynamically. Please advice!
    Here is an example

    Create the user as an object type (name varchar2 (100), number (3)) of the age
    /

    create a family of fonts as a user table
    /

    I want to do something like this

    DECLARE
    user of the var;
    BEGIN
    ...
    ...
    SELECT "family (1)" INTO var FROM DUAL;
    ...
    ...
    END;
    /

    Thank you

    As I suggested, you can define your own method of "diff" for the object. You haven't told us exactly what form you would like to work to take. I'll define a (pretty useless) function which will just create a string that tells you how to modify the data of an object to match the data in another. Obviously, you would like a more useful output. Potentially, rather than a member function, you can choose a procedure Member who emits DML is required for the underlying table is necessary.

    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE location_typ AS
      2  OBJECT
      3  (
      4    building_no NUMBER,
      5    city        VARCHAR2(40),
      6    MEMBER FUNCTION diff(
      7                l location_typ)
      8    RETURN VARCHAR2
      9  )
     10* ;
    SQL> /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE TYPE BODY location_typ
      2  AS
      3    MEMBER FUNCTION diff(
      4      l location_typ)
      5    RETURN VARCHAR2
      6    IS
      7      l_diff_str varchar2(4000);
      8    BEGIN
      9      IF building_no != l.building_no THEN
     10        l_diff_str := 'Building_no needs to change from ' || building_no ||
     11                         ' to ' || l.building_no;
     12      END IF;
     13      IF city != l.city THEN
     14        l_diff_str := l_diff_str ||
     15                        'City needs to change from ' || city ||
     16                          ' to ' || l.city;
     17      END IF;
     18      RETURN l_diff_str;
     19    END;
     20* END;
     21  /
    
    Type body created.
    
    SQL> DECLARE
      2    loc location_typ;
      3    secloc location_typ;
      4    a NUMBER;
      5  BEGIN
      6    loc    :=NEW location_typ(300, 'San Francisco');
      7    secloc :=NEW location_typ(200, 'Redwood Shores');
      8    dbms_output.put_line( loc.diff( secloc ) );
      9  END;
     10  /
    Building_no needs to change from 300 to 200City needs to change from San
    Francisco to Redwood Shores
    
    PL/SQL procedure successfully completed.
    

    Justin

    Published by: Justin Cave on 9 April 2012 14:12

Maybe you are looking for

  • Why a particular site is slow in firefox?

    I tried the http://visual-regexp.rhcloud.com site in Firefox (latest version) and other browsers, but all of a sudden, Firefox has been that the slower, even old opera 12.15 seems to be much faster. Why is this?

  • VNC Mac does not not after security update 2016-002

    After the 2016 002 security update, I am unable to VNC into any Mac Machine that has been updated. Error: The account you selected is not available

  • Need your opinion on Satellite A110-153

    Hello AI? m new here and here? m looking for a laptop. The A110-153 seems interesting to me.Could someone give me more information as comments on what are the + and - of the product?Also, I saw on a site that has this laptop has 2 hard drives. Is thi

  • HP envy m6: product key

    How can I get my product key because I can't activate windows

  • bbUI how-to

    Hey guys,. I was wondering how to actually initialize bbUI; I seem to have a little trouble... So I have my application that works properly, but it's horrible, it is entirely on HTML5 and has no aspects of the native user interface. I use bbUI and in