Control Timeline from base class?

How do you do this?
I'm extending the MovieClip class, and no amount of
this.stop() is working.....
wth?

use trace(this) to see if you're in scope of your
class.

Similar Messages

  • [svn] 4600: Flex SDK - Move style metadata from base class down to component classes

    Revision: 4600
    Author: [email protected]
    Date: 2009-01-20 13:11:33 -0800 (Tue, 20 Jan 2009)
    Log Message:
    Flex SDK - Move style metadata from base class down to component classes
    Previously, all spark and text styles were defined on FxComponent even though not every component supports all of those styles. So I have moved each style to the top-most base class where the style will apply to all descendant classes of that base class.
    This is the set of styles that were added to the various classes:
    baseColor
    color
    focusColor
    symbolColor
    selectionColor
    contentBackgroundColor
    rollOverColor
    alternatingItemColors
    basic text styles
    advanced text styles
    Here are some details about the implementation:
    - baseColor was added to FxComponent because every component and container supports it
    - FxContainer and GroupBase are containers, so their children can potentially support any of the styles. Thus the container classes support all of the styles indirectly.
    - FxDataContainer doesn't support all of the styles because its subclasses (FxButtonBar, FxList) don't support all styles.
    - FxList supports selectionColor, but not inactiveSelectionColor or unfocusedSelectionColor. All other components that support selectionColor, support the other two styles, and thus include styles/metadata/SelectionFormatTextStyles.as
    - GroupBase contains the style declarations that have the full ASDoc. All other declarations use the @copy keyword to reference the asdoc from GroupBase.
    QE Notes: Update tests to remove references to styles that are no longer allowed on various components/FxButton.as
    Doc Notes: Write the ASDoc comments for the style declarations in GroupBase
    Bugs: n/a
    Reviewer: Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxCheckBox.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxRadioButton.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxSpinner.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextArea.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxScrollBar.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSlider.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as

    Gordon, it looks like its been a while since you made this post.  Not sure how valid it is now...   I am particularly interested in the LigatureLevel.NONE value.  It seems that it is no longer supported.
    How do I turn of ligatures in the font rendering?
    My flex project involves trying to match the font rendering of Apache's Batik rendering of SVG and ligatures have been turned off in that codebase.  Is there any way (even roundabout) to turn ligatures off in flash?
    Thanks,
    Om

  • Change a text field on the timeline from a class

    Hi,
    I need some help in changing the content of text fields that are on the stage of the main timeline from within an external class. I have created a countdown timer which is called from the Document Class. I think it is a problem with the scope of the variable but I can't work it out.
    Main Document Class:
    package
        import flash.display.*;
        import flash.events.*;
        import count_timer;
        import RectangleButton;
        public class main extends MovieClip
            public function main()
              [create a Start Btn]
                var startBtn_mc:MovieClip = new MovieClip  ;
                addChild(startBtn_mc);
                var startBtn:RectangleButton = new RectangleButton("Start",90,25,18,0xCC0000,0x000000);
                startBtn_mc.x = 105;
                startBtn_mc.y = 200;
                startBtn_mc.addChild(startBtn);
                startBtn_mc.addEventListener(MouseEvent.CLICK,onClickStartBtn);
                function onClickStartBtn(event:MouseEvent):void
                    var inputDay1:String = dayInputtxt.text;[these are input fields on the stage]
                    var inputHr1:String = hrInputtxt.text;
                    var inputMin1:String = minInputtxt.text;
                    var inputSec1:String = secInputtxt.text;
                    var counter:count_timer = new count_timer(inputDay1,inputHr1,inputMin1,inputSec1);
    Countdown Timer:
    package
        import flash.display.*;
        import flash.utils.Timer;
        import flash.events.*;
        import flash.text.*;
        import RectangleButton;
        public class count_timer extends MovieClip
    //not sure this is correct
    public var daytxt:TextField;
    public var hrtxt:TextField;
    public var mintxt:TextField;
    public var sectxt:TextField;
            public function count_timer(inputDay1,inputHr1,inputMin1,inputSec1)
                var inputDay = inputDay1;
                var inputHr = inputHr1;
                var inputMin = inputMin1;
                var inputSec = inputSec1;
                var msinputDay:Number = Number(inputDay);
                var msinputHr:Number = Number(inputHr);
                var msinputMin:Number = Number(inputMin);
                var msinputSec:Number = Number(inputSec);
                var ms:Number = Number(msinputDay);
    //convert input to milliseconds
                ms = ms + msinputDay * 24 * 60 * 60 * 1000;
                ms = ms + msinputHr * 60 * 60 * 1000;
                ms = ms + msinputMin * 60 * 1000;
                ms = ms + msinputSec * 1000;
                addEventListener(Event.ENTER_FRAME, loop);
                function loop(e:Event):void
                    ms = ms - 1000;
                    var sec:Number = Math.floor(ms / 1000);
                    var min:Number = Math.floor(sec / 60);
                    var hr:Number = Math.floor(min / 60);
                    var day:Number = Math.floor(hr / 24);
                    sec = sec % 60;
                    min = min % 60;
                    hr = hr % 24;
                    daytxt.text = day.toString();[everything appears to work to these variables. I think it should be root.]
                    hrtxt.text=(hr<10)?"0"+hr.toString():hr.toString();
                    mintxt.text=(min<10)?"0"+min.toString():min.toString();
                    sectxt.text=(sec<10)?"0"+sec.toString():sec.toString();
               if (ms <= 0)
                        removeEventListener(Event.ENTER_FRAME, loop);
                        gotoAndPlay("TimesUp");
    Many thanks in advance.

    Your code is not going to work as you show it. First, you should not be putting your class methods inside the constructors... And yes - scope. You make your new count_timer as a local variable inside a function that is called on click. Essentially, the timer is gone just as fast as it's created. If you want the timer available to the other methods in the class it should be declared as a private var in the class definition.
    And I agree with kokorito - have your timer extend EventDispatcher and then it can do like: dispatchEvent(new Event("myTimerEvent")); and you can then add an eventListener to it when you create it in your main class. You just listen for "myTimerEvent" or whatever string you use, and call whatever function you want - just like using any other listener.

  • How get controls name from a class private data?

    How can i get the names of the controls inside a class private data?
    I am using Actor Framework and trying to create a method tha will be executed when launch the actor. This method need a list o all the control names inside the class data to search for the initial value inside a configuration file (config.ini), the key on the configuration file will be the name of the control.
    Thanks.
    Solved!
    Go to Solution.

    You are already making the overriding method just because you have to write to the Bundle By Name.  And then how are you going to handle all of the data types the keys could be.  You are making things more difficult than it should be for really very little benefit.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Implement abstract method from base class problem

    Here is the example:
    public abstract class AbstractClass{
    protected double aVariable;
    protected abstract double abstractMethod();
    public class RealClass extends AbstractClass{
    public double abstractMethod(){
    return aVariable;
    Error message:
    RealClass should be declared abstract; it does not define abstractMethod() in AbstractClass

    I also compiled the code with Jdk1.3 and it
    worked.. The code would not have compiled
    if the access modifier in the derived class
    was more restrictive(eg private )...

  • Casting base class object to derived class object

    interface myinterface
         void fun1();
    class Base implements myinterface
         public void fun1()
    class Derived extends Base
    public class File1
         public myinterface fun()
              return (myinterface) new Base();
         public static void main(String args[])
              File1 obj = new File1();
              Derived dobj = (Derived)obj.fun();
    Giving the exception ClassCastException......
    Can't we convert from base class object to derived class.
    Can any one help me please...
    Thnaks in Advance
    Bharath kumar.

    When posting code, please use tags
    The object returned by File1.fun() is of type Base. You cannot cast an object to something it isn't - in this case, Base isn't Dervied. If you added some member variables to Derived, and the compiler allowed your cast from Base to Derived to succeed, where would these member variables come from?
    Also, you don't need the cast to myinterface in File1.fun()
    Also, normal Java coding conventions recommend naming classes and interfaces (in this case, myinterface) with leading capital letters, and camel-case caps throughout (e.g. MyInterface)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reflection: attributes from the base class

    Is there a way to get the attributes from the base class of a derived class via reflection? I only found methods to get the attributes from the derived class.
    Example:
    class A
    int a = 4;
    class B extends A
    int b = 5;
    Object unknown = new B();
    Code/Idea to get all attributes from baseclass A using unknown (here: a=4)?

    Thank you all for your hints. The mistake I make, was to use the baseclass, and not the derived class for getting the attributes. By using an extra parameter of type class I got all attributes in their context.
       private StringBuffer getDump(Object obj, Class cl)
             dmp.append(cl.getName() + " {\n");
             Field[] attribute = cl.getDeclaredFields();             <--- only the fields of the current class
             for (int j = 0; j < attribute.length; j++)
                attribute[j].setAccessible(true);
                try
                   if (attribute[j].getType().isPrimitive() || attribute[j].getType() == String.class)
                      dmp.append(attribute[j].getName() + "=" + attribute[j].get(obj) + "\n");
                   else
                      if (((attribute[j].getModifiers() & Modifier.STATIC) != Modifier.STATIC) &&
                          (attribute[j].getType().getName().startsWith("java.lang") == false) &&
                          ((attribute[j].getModifiers() & Modifier.FINAL) != Modifier.FINAL))
                         dmp.append(getDump(attribute[j].get(obj), attribute[j].get(obj).getClass())); <- recursive call
                catch (IllegalAccessException ex)
                   ex.printStackTrace();
             dmp.append("}");
          return dmp;
       }

  • Flex/AS3 Best way to construct a derived class instance from an existing base class instance?

    What is the best way to handle the instantiation of a derived class from an existing base class.
    I have a base class which is being created via remote_object [RemoteClass alias] from the server.   I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.     The base class has meta data that defines what the derived class is, for example
    [RemoteClass (alias="com.myco...')]
    public Class Base
         public var derivedType:String;
         public function Base()
    public Class Derived extends Base
         public "some other data"
         public function Derived()
    In my Cairgorm command which retrieves this object from ther server I want to do this:
    public function result (event: Object):void
        var baseInstance:Base = event.result;
         if (baseInstance.derivedType = "derived")
              var derivedInstance:Derived = new Derived( baseInstance );
    What is the most efficient way of doing this?   It appears to me that doing a deep-copy/clone and instantiation of the derived class is pretty inefficient as far as memory allocation and data movement via the copy.

    Thanks for the assistance.  Let me try to clarify.
    MY UI requires a number of composite classes.    The individual components of the composite classes are being transfered to/from the server at different times depending upone which component has changed state.    The construction of the composite classes from the base class happens in my clients business logic.
    Composition happens in a derived class; but server syncronization happens using the base class.    When I recieve the object from Blazeds through the remote object event, it is in the form of the base class.  I then need to instantiate the derived class and copy the elements of the base class into it (for later composite construction).   And likewise when sending the base class back to the server, I need to upcast the derived class to its base class.   But in this case just a mere upcast does not work.  I actually need to create a new base class and copy the attrbutes into it.  I believe this is limitation of how remoting works on Flex/AS3.
    My question is, what is the best way to turn my base class into it's derived class so further composite construction can take place.   The way I am currently doing it is to create a  load method on the base class, that takes the base class as on argument.  The load function, copies all of the instance attribute references from the base class to the target class.
    public Class Base
         public function Base()
         public function load(fromClass:Base)
        {  //  copy the references for all of the instance attributes from the fromClass to this class }
    Then,  after I recieve the base class from the server.   I create a new derived class and pass the base class into the load function like this:
                for (var i:int=0; i < event.result.length; i++) {
                    var derived:Derived = new Derived();
                    derived.load(event.result[i]);
    The drawbacks of this approach is that it now requires 2 extra instance creations per object serialization.   One on recieving the object from the server and one sending it to the server.    I assume copying references are pretty efficient.  But, there is probably some GC issues.     The worst of it is in code maintenance.   The load function now has to be manually maintained and kept in sync with the server class.
    It would be interesting to hear how others have solved this problem.      The server side is an existing application with around 2M LOC, so changing the code on the server is a non-starter.
    Thanks for your help.

  • Controlling a Movie Clip on the Main Timeline from a loaded SWF?

    Is it possible to control a MovieClip on the main timelne from another loaded clip?
    I see posts that control loaded clips, but most are all from the loader in the main timeline.  I have a moviclip on the main timeline that I want to make visible or invisible depending on what keyframe is playing in another loaded swf.
    If I try to call the movieClip from the loaded SWF I get "error #1119.  Access of possibly undefined property...." because it doesn't exist in the loaded SWF, just the main timeline. 
    The old AS2 way just used "_root".  Since "_root" doesn't exist any more, how do you control items on the main TimeLine from a loaded SWF?

    I am not clear what you mean because you are saying you are trying to target a movieclip that does not exist where you are trying to target it.
    Try using a trace to see what you are targeting when you you target the MovieClip(parent.parent)....
    trace(MovieClip(parent.parent));
    The other approach I mentioned earlier is the more OOP-correct approach if you would rather try that way.  Here's a rough outline of it...
    AS3 - Dispatch Event
    http://forums.adobe.com/thread/470135?tstart=120
    Example:
    Add something to trigger the event in the child (your loaded swf):
    dispatchEvent(new Event("eventTriggered")); (
    if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
    In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf.
    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
    function eventHandler(event:Event):void {
        trace("event dispatched in loaded swf");
       // this is where your main file can set the visible property of your movieclip

  • 12.4 beta: private copy constructor in base class required to be called from temporary reference when -g option used

    Hi,
    We've got an abstract base class (StringBase) which various types of strings inherit from. The copy constructor for this base class is private, since we don't want to allow copying when this class shouldn't be directly instantiated. A number of our methods take specify the base class as a reference, but take a derived class temporary as a default argument (see code appended).
    This worked fine in 12.3, but in 12.4 beta, this now says:
       Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    This works fine in clang and gcc, and indeed, this GNU document says it was a bug which was fixed in gcc 4.3.0:
        Copy constructor access check while initializing a reference
    which references http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391
    It only appears to error when the "-g" option is used, however, which doesn't seem right, and compiles fine if the "-g" option is removed, which makes me think it's a bug. Presumably the optimizer is eliding the copy when not using -g, but it's left in for debug mode, causing the compile error?
    Many thanks,
    Jonathan.
    $ clang++ -std=c++11 defaultarg.cpp
    $ g++ -std=c++11 defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -c defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -g -c defaultarg.cpp
    "defaultarg.cpp", line 6: Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    1 Error(s) detected.
    $ cat defaultarg.cpp
    #include "stringbase.h"
    #include "conststring.h"
    static const ConstString S_DEFAULT("default value");
    void SomeMethod( const StringBase& str = S_DEFAULT )
       (void) str;
    int main( void )
       SomeMethod();
    $ cat stringbase.h
    #ifndef STRINGBASE_H
    #define STRINGBASE_H
    class StringBase
    protected:
       StringBase() {}
    private:
       StringBase( const StringBase& );
    #endif
    $ cat conststring.h
    #ifndef CONSTSTRING_H
    #define CONSTSTRING_H
    #include "stringbase.h"
    class ConstString : public StringBase
    public:
       ConstString() {}
       ConstString( const char* ) {}
       ConstString( const ConstString& );
    #endif

    Thanks for reporting the problem!
    This looks like a compiler bug, I think an artifact of creating a helper function for the debugger for the default argument.
    I have filed bug 18505648 for you.

  • Problems with data controls from java classes in JSF pages.

    Hi! We have a problem in our Application that we are developing with JSF pages using Data Controls generated from facades java classes. When we running a page in debug mode and the page are loading, if we insert a breakpoint in the first line of method referenced in the data control, the execution enter two times in the method, and this is a problem for us. How to solve this?
    We are using JDeveloper 11.1.1.2 with ADF faces.

    You might need to play around with the refresh property of the action binding.
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adf_lifecycle.htm#BJECHBHF

  • CONTROLLING THE TIMELINE FROM EXTERNAL MC

    I have a website
    http://www.charlesmarsden-smedley.com/index1.html
    that I am building.
    In the projects section, if you navigate to Projects >
    Museum > Tower of London. You will see 'more information' link.
    This loads an external Movie clip for the text feild. I would
    like to make the 'more information' dissappear when it is clicked
    and the text appears in the target. The way I thought is best is to
    move the timeline on one frame and just remove the link, but when I
    click on 'back to images' link it reloads the images (external MC)
    but the 'more information' link is still hidden.
    How can I control the main timeline from an extrernal movie
    clip?
    Am i being rediculously long about this operation?
    thanks
    Harky

    maybe you didnt understand correctly.
    the 'more information' link loads an external movie clip (the
    text) into the right side of the page.
    At the bottom of this movie clip is a green link 'back to
    images' this button sits within the movie clip. So my problem is
    making this button controll the main timeline (as its root is the
    movie clip root, not the main web page root)

  • Controll the ROOT timeline from externally loaded movie clip?

    does anyone know how to controll the root timeline from an
    externally loaded movie clip?
    I have loaded a movie clip, which has buttons on it that I
    would like to controll the main original website timeline with.
    something like this.parent.parent?
    thanks a lot
    harky

    feedmeapples <[email protected]> wrote:
    > does anyone know how to controll the root timeline from
    an externally
    > loaded movie clip?
    >
    > I have loaded a movie clip, which has buttons on it that
    I would like
    > to controll the main original website timeline with.
    >
    > something like this.parent.parent?
    _root.doStuff;
    Freundliche Grüße,
    Franz Marksteiner

  • Initialize/set a base class from a another base class instance

    Hi,
    How can I initialize/set a base class from a another base class instance? I do not want to do a copy of it.
    It would look something like:
    class A {...}
    class B extends A
        B(A a)
            // super = a;
        setA(A a)
            // super = a;
    }Thank you.

    erikku wrote:
    Thanks Winton. It is what I did first but A has lots of methods and if methods are later added to A, I will have to edit B again. For those two reasons, I wanted to use inheritance. The part I was not sure with was the way to initialize B's base (A).You pays your money and you takes your choice. One way (this way) you have to provide forwarders; the other way (inheritance) you have to provide constructors (and if A has a lot of em, you may be writing quite a few).
    Ask yourself this question: is every B also an A? No exceptions. Ever.
    If the answer is 'yes', then inheritance is probably the best way to go.
    However, if there is even the remotest chance that an instance of B should not exhibit 100% of the behaviour of A, now or in the future, then the wrapper style is probably what you want.
    Another great advantage of the wrapper style is that methods can be added to A without affecting the API for B (unless you want to).
    Winston
    PS: If your Class A has a constructor or constructors that take a pile of parameters, you might also want to look at the Builder pattern. However, that's not really what we're talking about here, and it should probably be implemented on A anyway.

  • How can I to control any element of my GUI from another class?

    How can I to control any element of my GUI from another class?

    For that, you need the external class to have the reference to your element.. If your idea is to change basic properties like width, height etc.. then you can have the constructor of the external class to take the object of the parent of your class as the parameter and modify ..
    However, if the properties to be altered/accessed are custom to your element, then you will have to have the class accept an object of your class as the parameter. No other option..
    What exactly is your requirement?

Maybe you are looking for

  • Faxing BW Web reports

    Hi Gurus, Please let me know how to fax the BW Web reports . We are on Netweaver 2004s BI and EP 6.0. Thanks in advance. Raj.

  • I cannot quit the icon for mail. It stays on and because of that, I cannot shut down the computer?

    I cannot quit mail, the icon stays on and if I try to shut down the computer, the window appears and tell me to quit mail first and then shut down the computer. How do I get to quit the mail?

  • Strange problem e=mailing photos

    I have been sending some photos from my iMac to my wife's iPad. Yesterday I sent 4, 2 arrived and 2 did not. They are shown as "sent" in my Mail system. I tried again to day. I resent the 2 from yesterday and another one that she wanted. The new one

  • Images For DVD Menu Not All Appearing

    Can someone please explain, when I drag 4 or 5 jpeg images for my theme into the "Drop Photos Here" boxes to be cycled, only 2 images get cycled through during the preview; even after I burn the DVD. Why aren't the remaining 2 to 3 images being recog

  • Price List Issue

    Hi Experts, I am preparing Price List for Item Master Data. I go through procedure as below : 1. Filled Base Price for Item 'A' in Price List. 2. In Spl price for BP selected BP Code '123' and updated price, Set Price List on both header and row leve