Animation API

Hi, can someone share me snnipet code on the Animation API. I tried the demo app provided by the Blackberry API. but I'm not able to get hw to do. can someone help me.

Here are a few documents for you.

https://developer.BlackBerry.com/Java/documentation/animation_1984773_11.html

Tags: BlackBerry Developers

Similar Questions

  • How link to or use the CDN from Adobe After you publish your project?

    So maybe I'm stupid, but I can't really find any useful info on actually works this edition of CAN...

    It's White edge animated API adobe books (also just below him in the section on the HTML pages, I think they are missing from the header of a word in the first sentence... kinda funny - API JavaScript Adobe Edge animate CC)

    Accommodation CDN

    With the help of Adobe Content Distribution Network (CDN) is a great way to speed up the delivery of composition Animate. Compositions using the CDN from Adobe all share a unique URL for jQuery and the Runtime of edge. The cache of the browser execution, so that the user downloads only the library once no matter how can animate compositions they discovered, even the compositions are on different sites and produced by different authors. Does not use the CDN if your composition should work without an Internet connection or if you want to use your own hosting exclusively.

    The Runtime CDN animate using the following URL:

    <script type="text/javascript" charset="utf-8"    src="http://animate.adobe.com/runtime/4.0.0/edge.4.0.0.min.js"></script>

    I mean this all sounds good! So, how to use it? I don't see a place prominently in this URL to replace it with what would be the link to my project? Also, I have not all the numbers I could put in a URL to get the appropriate content unique identification. Shouldn't I have an ID unique? Measure out how what is mine? Maybe I don't really understand how it works...

    My goal is to have this nice little animation I did in the game of edge when someone visits the Web site and then blend in the homepage. Is this possible? It would be great if I could just put some script links in the header and let the adobe CA take care of all aspects of delivery and to keep my load on the server down rather than upload the files myself and have to use extra bandwidth.

    Thank you very much!

    Hey there,

    The CDN from Adobe hosts only animate them DURATION and jQuery Javascript files required (mentioned below), which means you do not have to include in your HTML directory on your server. You will still need to accommodate code HTML and other .js files that creates Animate on your server. Those that are specific to your project.

    When you publish to the web, by default you will be connect Adobe CDN, which hosts two files only:

    Edge.4.0.0.min.js

    jQuery - 2.0.3.min.js

    These files are not unique to your project - each publication Animate uses these files, and each contains the same exact data: they help make HTML files animate to "do what they do" with the movement and interactivity.

    If for any reason any you would bind to the runtimes files on Adobe CDN, you can uncheck "Host runtime files on Adobe CDN" and publish for the new website. A "edge_includes" folder will be created at the root of your web site publish the folder that contains the two files above.

    HTH,

    Joe

  • Stop the Parent plays

    I have a reference to a symbol that is nested inside another symbol

    var myvar = sym.getSymbol('symA').$('symB');

    This stop symbol:

    MyVar.Stop ();

    How can I stop playback of symA? I tried this:

    myvar.getParentSymbol () .stop ();

    But it does not work.

    (The nested symbol is dynamically passed into a function so I can't just directly reference).

    Thank you!!

    Since you're animating API (stop ()) instead of a jquery api, you need to get the symbol instance to get the symbol of the mother of this instance.

    If the code that you need to try is

    Symbol var = sym.getComposition () .getStage ().getSymbol("SymbolA").getSymbol ("SymbolB");

    symB.getParentSymbol () .stop ();

    or

    Symbol var = sym.getSymbol("SymbolA").getSymbol ("SymbolB");

    symB.getParentSymbol () .stop ();

  • Effect of slip through the mouse click

    Hello
    I'm new to animations and try to add little in my application.

    (1) whenever I am navigating to another page (by a click or a double-click of a node), I want to have an animation - old page to the left and removed altogether and new page will load on the right side.
    Something like a page in ios/android devices. But my request is not for touch devices enabled for now.

    Is it possible however javafx 2.x. If so, could you direct me to sample / api proper.

    (2) a click of a mouse can be mapped with gesture events. For example - I click on a link/button to the navigation and application takes as a drag event and therefore moves to a different page giving effect?

    Thank you

    (1) whenever I am navigating to another page (by a click or a double-click of a node), I want to have an animation - old page on the left path and get removed altogether and a new page will load on the right side.

    Yes, see:
    http://docs.Oracle.com/JavaFX/2/animations/basics.htm#CJAJJAGI (Transitions)
    http://docs.Oracle.com/JavaFX/2/API/JavaFX/animation/package-summary.html (Animation API)
    http://www.e-Zest.net/blog/sliding-in-JavaFX-its-all-about-clipping/ (sliding in JavaFX)
    http://fxexperience.com/2012/03/canned-animations/ (Animation Lib)
    http://gist.github.com/1437374 (effect of drag Panel)

    (2) a click of a mouse be mapped with gesture events

    I don't think it can be done with the public API. One way to do this would be to add a filter on your component layout that uses the mouse click event and generates a SwipeEvent, but SwipeEvent has no constructor - so it wouldn't work. Is there an existing Jira request to create constructors for classes of public events so that this kind of thing could be done. Perhaps you could use com.sun classes or private impl_ API to allow this happen with JavaFX 2.2, but I would not recommend this approach.

    Also, it is best to place the separate issues in separate positions for ease of search, etc.

  • Where can I find examples of api detailed animation

    I'm wanting to animations in code, but can not find much information on how to use the "animate" command

    Without indicators in the editor or a detailed guide to the api code, it is difficult to work out the correct sytanx.

    There is an api guide of base here:

    http://www.Adobe.com/devnet-docs/edgeanimate/API/current/index.html

    an example of how animate the opacity:

    kitten_sym . animate ({opacity: 0}, 500);

    but is there more info on the full range of functions and the animated properties?

    Hi, new2oop-

    The animate() API is actually jQuery animate() API.  You can find more information on it here:

    http://API.jQuery.com/animate/

    -Elaine

  • cannot package animation swf inside the AIR application with API-ad-hoc of the target

    I have included a small animation today in my AIR application using a clip from movie to swf as below

    private var myLoader:Loader = new Loader();  animation connection

    private var url: URLRequest = new URLRequest("..) /.. /.. (' / data / ConnectingAnim.swf ');

    ... code to add the loader and position

    It works fine when I deploy on my device via USB, but when I try to package for ad-hoc distribution, the ipa resulting isn't fair. The screen with the animation is broken.

    I'm guessing that the packaging for the app store is probably broken too.

    Am I missing something?

    Thank you!

    Post edited by: mu.a

    You must use a loader context, unless you use the interpreter mode. Read this article:

    http://help.Adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204 - 7de0.html

    You want the context.applicationDomain = ApplicationDomain.currentDomain;  variation.

  • animated GIF not showing do not adequately

    I have an animated gif image, and I used http://supportforums.blackberry.com/t5/Java-Development/Display-an-animated-GIF/ta-p/445014 this link to animate the noise towards the top of the screen and that did not work properly

    You can see the animation below

    public class UpdatePopScreen extends PopupScreen{
    
            public UpdatePopScreen(){
                 super(new VerticalFieldManager(), Screen.DEFAULT_CLOSE); 
    
                 GIFEncodedImage ourAnimation = (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("sunblackk.gif");
                AnimatedGIFField _ourAnimation = new AnimatedGIFField(ourAnimation, Field.FIELD_HCENTER);
    
                this.add(_ourAnimation);
               add(new LabelField("Loading..."));
    
        }         
    
        }
    

    and I have attached AnimatedGIFField.java

    I think something is wrong in your establishment or the way you use this code, because it works very well for me.  Sorry you'll have to do investigative work to identify the problem.

    I suspect there are two possibilities:

    (a) you have not configured your environment properly

    (b) you use something else keeps track of events

    I think that (b) is the most likely, but to test these two at the same time, you must proceed as follows:

    Create a new project and a new example application, then, in this application, test the screen.  Nothing else in this project - it should start just a screen, the screen should have a button, when you click the button the treatment should push the pop-up screen.

    I have included my code (which combines Animation and popup screen into one file - not recommended but useful source under test).  Use this code and the image as an attachment in your new project.

    Test it on your Simulator.

    Assuming that you can get this working, then we can investigate on what is actually wrong in your application.

    package mypackage;
    
    import net.rim.device.api.system.GIFEncodedImage;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Screen;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.BitmapField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.PopupScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class UpdatePopScreen extends PopupScreen {
        public UpdatePopScreen(){
    
             super(new VerticalFieldManager(), Screen.DEFAULT_CLOSE); 
    
             GIFEncodedImage ourAnimation = (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("animated.agif");
            AnimatedGIFField _ourAnimation = new AnimatedGIFField(ourAnimation, Field.FIELD_HCENTER);
    
            this.add(_ourAnimation);
            add(new LabelField("Loading..."));
    
        }
    }
    
    class AnimatedGIFField extends BitmapField
    {
        private GIFEncodedImage _image;     //The image to draw.
        private int _currentFrame;          //The current frame in the animation sequence.
        private AnimatorThread _animatorThread;
    
        public AnimatedGIFField(GIFEncodedImage image)
        {
            this(image, 0);
        }
    
        public AnimatedGIFField(GIFEncodedImage image, long style)
        {
            //Call super to setup the field with the specified style.
            //The image is passed in as well for the field to configure its required size.
            super(image.getBitmap(), style);
    
            //Store the image and it's dimensions.
            _image = image;
    
            //Start the animation thread.
            _animatorThread = new AnimatorThread(this);
            _animatorThread.start();
        }
    
        protected void paint(Graphics graphics)
        {
            //Call super.paint.  This will draw the first background frame and handle any required focus drawing.
            super.paint(graphics);
    
            //Don't redraw the background if this is the first frame.
            if (_currentFrame != 0)
            {
                //Draw the animation frame.
                graphics.drawImage(_image.getFrameLeft(_currentFrame), _image.getFrameTop(_currentFrame),  _image.getFrameWidth(_currentFrame)
                                    , _image.getFrameHeight(_currentFrame), _image, _currentFrame, 0, 0);
            }
        }
    
        //Stop the animation thread when the screen the field is on is
        //popped off of the display stack.
        protected void onUndisplay()
        {
            _animatorThread.stop();
            super.onUndisplay();
        }
    
        //A thread to handle the animation.
        private class AnimatorThread extends Thread
        {
            private AnimatedGIFField _theField;
            private boolean _keepGoing = true;
            private int _totalFrames;               //The total number of frames in the image.
            private int _loopCount;                 //The number of times the animation has looped (completed).
            private int _totalLoops;                //The number of times the animation should loop (set in the image).
    
            public AnimatorThread(AnimatedGIFField theField)
            {
                _theField = theField;
                _totalFrames = _image.getFrameCount();
                _totalLoops = _image.getIterations();
    
            }
    
            public synchronized void stop()
            {
                _keepGoing = false;
            }
    
            public void run()
            {
                while(_keepGoing)
                {
                    //Invalidate the field so that it is redrawn.
                    UiApplication.getUiApplication().invokeAndWait(new Runnable()
                    {
                        public void run()
                        {
                            _theField.invalidate();
                        }
                    });                
    
                   try
                    {
                        //Sleep for the current frame delay before the next frame is drawn.
                        sleep(_image.getFrameDelay(_currentFrame) * 10);
                    }
                    catch (InterruptedException iex)
                    {
    
                    } //Couldn't sleep.
    
                    //Increment the frame.
                    ++_currentFrame;      
    
                    if (_currentFrame == _totalFrames)
                    {
                        //Reset back to frame 0 if we have reached the end.
                        _currentFrame = 0;
    
                        ++_loopCount;
    
                        //Check if the animation should continue.
                        if (_loopCount == _totalLoops)
                        {
                            _keepGoing = false;
                        }
                    }
                }
            }
        }
    }
    
  • Creating Animation

    I know that there is a class docs
    to make an animation
    so my question is can I use to make an Animation like PopUp or side scrolling screen.
    When you move from one screen to the other
    Screen is cloudy and new screen comes out when a button is clicked
    Just as there are in Android?

    You can use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/TransitionContext.html for this

  • Animation in a manager need to

    Hi all

    I want to give the animation in a Manager. I have a list, while clicking on the first line of this list it will add more than 3 lines below that, and when I click again in the same line that will remove these lines. I do that by addind and removing the Manager but I want to give the animation while addind or removing the Manager!

    Please suggest!

    Hi shivam.

    I got this code somewhere and I managed to change the code for the handler.
    Hope that this code will be useful for you...

    TestScreen.java

    package com.animationtest;
    
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.NullField;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class TestScreen extends MainScreen {
        private AnimatedManager _manager1,_manager2;
    
        public TestScreen() {
    
            VerticalFieldManager vfm =new VerticalFieldManager();
            vfm.add(new LabelField("labelField 1"));
            vfm.add(new ButtonField("buttonField 1"));
            vfm.add(new LabelField("labelField 2"));
            vfm.add(new ButtonField("buttonField 2"));
    
            _manager1=new AnimatedManager(vfm,true);
            add(_manager1);
    
            VerticalFieldManager vfm2 =new VerticalFieldManager();
            vfm2.add(new LabelField("labelField 3"));
            vfm2.add(new ButtonField("buttonField 3"));
            vfm2.add(new LabelField("labelField 4"));
            vfm2.add(new ButtonField("buttonField 4"));
    
            _manager2=new AnimatedManager(vfm2,false);
            add(_manager2);
        }
    
        protected void onUiEngineAttached(boolean attached) {
            super.onUiEngineAttached(attached);
    
            if (attached) {
                _manager1.startAnimation();
                _manager2.startAnimation();
            }
        }
    }
    

    AnimatedManager.java

    package com.animationtest;
    
    import net.rim.device.api.system.Application;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Manager;
    
    import com.animationtest.Animation.AnimationListener;
    
    public class AnimatedManager extends Manager implements AnimationListener {
        private final Animation _animation;
        private final int _duration = 1000;
        private boolean isFromTop;
        private volatile boolean _isAnimating;
    
        private Manager _field = new Manager(FIELD_HCENTER) {
            protected void sublayout(int width, int height) {
                setExtent(getPreferredWidth(), getPreferredHeight());
            }
        };
    
        private AnimatedField leftToRightAnimationManager = new AnimatedField() {
    
            private final int _sx = - Display.getWidth();
            private final Point _pos = new Point(_sx, 0);
            private final Point _dest = new Point(0 , 0);
    
            public void setField(Manager _manager) {
                _field=_manager;
            }
    
            public Point getCurrentPosition() {
                return _pos;
            }
    
            public Field getField() {
                return _field;
            }
    
            public void updatePosition(int time, int duration) {
                _pos.x = _sx + (_dest.x - _sx) * time / duration;
            }
        };
    
        private AnimatedField topToBottomAnimationManager = new AnimatedField() {
    
            private final int _sy = - Display.getHeight();
            private final Point _pos = new Point(0,_sy);
            private final Point _dest = new Point(0, 0);
    
            public void setField(Manager _manager) {
                _field=_manager;
            }
    
            public Point getCurrentPosition() {
                return _pos;
            }
            public Field getField() {
                return _field;
            }
            public void updatePosition(int time, int duration) {
                _pos.y = _sy + (_dest.y - _sy)  * time / duration;
            }
        };
    
        public AnimatedManager(Manager _manage, boolean _isFromTop) {
            super(USE_ALL_HEIGHT | USE_ALL_WIDTH);
            isFromTop=_isFromTop;
            _animation = new Animation(_duration);
            _animation.setListener(this);
    
            if(isFromTop){
                topToBottomAnimationManager.setField(_manage);
                add(topToBottomAnimationManager.getField());
            }
            else{
                leftToRightAnimationManager.setField(_manage);
                add(leftToRightAnimationManager.getField());
            }
        }
    
        public void startAnimation() {
            _isAnimating = true;
            _animation.start();
        }
    
        protected void sublayout(int maxwidth, int maxheight) {
            final int width = _field.getPreferredWidth();
            final int height = _field.getPreferredHeight();
            if(isFromTop)
                updateAnimation(topToBottomAnimationManager);
            else
                updateAnimation(leftToRightAnimationManager);
    
            setExtent(width, height);
        }
    
        private void updateAnimation(AnimatedField af) {
            Field f = af.getField();
            final int width = f.getPreferredWidth();
            final int height = f.getPreferredHeight();
    
            if (!_isAnimating) layoutChild(f, width, height);
            setPositionChild(f, af.getCurrentPosition().x, af.getCurrentPosition().y);
        }
    
        public int getPreferredHeight() {
            return _field.getPreferredHeight();
        }
    
        public int getPreferredWidth() {
            return _field.getPreferredWidth();
        }
    
        public void onNewFrame(int time) {
            if(isFromTop)
                topToBottomAnimationManager.updatePosition(time, _duration);
            else
                leftToRightAnimationManager.updatePosition(time, _duration);
            synchronized(Application.getEventLock()) {
                updateLayout();
                _isAnimating = time == _duration;
            }
        }
    }
    

    Animation.Java

    package com.animationtest;
    
    public class Animation {
        public static interface AnimationListener {
            void onNewFrame(int time);
        }
    
        private static final int DEFAULT_FPS = 40;
    
        private int _duration;
        private int _time;
        private int _fps = DEFAULT_FPS;
        private Thread _thread;
        private volatile boolean _running;
    
        private AnimationListener _listener;
    
        public Animation(int duration) {
            _duration = duration;
        }
    
        public void setFPS(int fps) {
            _fps = fps;
        }
    
        public int getFPS() {
            return _fps;
        }
    
        public void setDuration(int duration) {
            _duration = duration;
        }
    
        public int getDuration() {
            return _duration;
        }
    
        public int getTimeElapsed() {
            return _time;
        }
    
        public void setListener(AnimationListener l) {
            _listener = l;
        }
    
        public synchronized void start() {
            if (_thread == null) {
                _running = true;
                _thread = new Thread(new Runnable() {
                    public void run() {
    
                        final int idleTime = (1000 / _fps * 10 + 10) / 10;
                        final int duration = _duration;
                        _time = 0;
    
                        try {
                            while(_running && _time <= duration) {
                                animate(_time);
                                _time += idleTime;
    
                                Thread.sleep(idleTime);
                            }
    
                            if (_time - idleTime < duration) animate(duration);
    
                        } catch (InterruptedException e) {}
    
                        stop();
                    }
                });
    
                _thread.start();
            }
        }
    
        public synchronized void stop() {
    
            _running = false;
    
            if (_thread != null && _thread.isAlive()) {
                _thread.interrupt();
                _thread = null;
            }
        }
    
        private void animate(int time) {
            AnimationListener listener = _listener;
            if (listener != null) {
                listener.onNewFrame(time);
            }
    
        }
    }
    

    AnimatedField.java

    package com.animationtest;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Manager;
    
    public interface AnimatedField {
    
        Field getField();
    
        void setField(Manager _manager);
    
        void updatePosition(int time, int duration);
    
        Point getCurrentPosition();
    }
    

    Point.Java

    package com.animationtest;
    
    public final class Point {
        public int x, y;
    
        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }
    
  • Display an animated activity indicator?

    Is there an API in WebWorks to show an animated activity indicator?

    Thank you.

    There is has nothing built in the WW API not. That said I think that widgets QNX (http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/QNX-UI-look-and-feel-in-WebWorks... have one that mimics the look of the one system. Most JS frameworks and classify mobile have a cooked in them as well, if you use one.

    If these options you just create your own and trigger via JS in a div overlay, or the div which contained load.

  • Screen animation

    Hello

    I need a floating animation with a few clickable image screen, the user can drag and click.

    But I have no idea to one! Is there some API animation to do this?

    Any advice will be useful.

    Thank you.

    The general idea is the following:

    (1) have a custom layout manager which positions its children to the desired position. Here's a decent example of the forums - take a look at the sublayout method:

    AbsoluteFieldManager on pre-5.0 OS

    Keep the coordinates (X and Y) of the field 'mobile' to some members of the class and taken over the sublayout members.

    (2) alter these coordinates field on every event that should cause the field to move, then call updateLayout(). These events may include navigationMovement and TouchEvent.MOVE (read getMovePoints - it is pretty well documented).

    Enjoy!

  • How to apply animations to field custom in blackberry?

    I have created a custom field and want to apply the animation to this field how this should be done? is there any api available to directly link animation to custom field? Please send the code.

    No, you must do it yourself

  • Animations and Image editing options

    Hi all

    I searched the Forum and could not find the following options for animations

    1. GIFs - some said GIF is not supported, but some were discussing workarounds. I asked if it worked for them. This option, I thought that if works, we can convert Flash files in gif and use.
    2. SME - I tried havn't. download the CDK. But saw a few entries on the forum, that we cannot modify the animation on the page.
    3. Flash - Flash did not support for the version earlier. But not safe for Storm taking in charge or not? Do we need to install Flash player separately. And I can integrate the flash file in the screen. Don't know what API should be used (if possible)
    4. SVG - Measurer of vector graphics. I could see some of the examples provided with the JDK.

    If I want to include an animated image on the screen which one of the above would be the best option.

    Also can I provide an API that can activate the edition image as cropping, adding effects and features like that. Editor of a pointer that will help me to image.

    Please provide your inputs.

    Thanks in advance,

    Sandeep

    The native mail application can't stand animated GIFs.  They can be seen in the BlackBerry browser or using the field of animated gif custom knoweldge base (link above).

    Mobile devices blackBerry do not support Flash.

  • Several animations on a single html page?

    Is it possible to load several animations of edge on a single html page? I was able to get a single animation to function, but adding a second fails. I am trying to build a web page with 3 separate animations. Is there a tutorial that addresses this?

    Thank you.

    The answer is in the API at the end. You can get to the API in the Help menu.

  • Animation LOOP when I use SPRITE?

    Hello world

    For some reason any, that I can't understand, my animation will not loop now that I'm testing with sprite images:

    example of

    Usually, when I put an animation loop I use this code at the end of my animated film: sym.play(1000) (0);

    This time, I also tried the parameter 'start' to frame 0 and have it jump to that via: sym.play(1000) ("begin");

    Is however not of the above, have no success...

    Anyone else have this experience? And someone even better at - it a solution for me?

    Thank you

    Eddie

    More details here: API JavaScript Adobe Edge animate CC

    playAll ==> all is a shortcut for "all symbols.

    sym.playAll (0) ==> he goes to the zero seconds and plays all the symbols.

    SYM. Play (aLabel) ==> he goes to the label and play the current timeline.

Maybe you are looking for

  • Why of opaque boxes appear in place of the entered text (Firefox ver. 34/Ubuntu 12.04) in the browser window?

    There was a similar question posted earlier, but this isn't exactly the same thing. When all 'text' has been reached and appears in the URL address box - it is characterized by rectangular, green, black, or gray boxes (instead of letters, numbers, et

  • C100mkii wifi

    I have problems connecting my mkii c100 to my wifi network. After putting in all the network settings, I go to network settings > select, then select my network, but nothing happens. It just look back to the previous menu without doing anything, and

  • Problem printing color MF8350Cdn

    All color prints had a tinge of pink, replaced the bars horozontal toner magenta & cyan, blue now Thank you

  • NMH410 kann kein playing m4a

    Hallo. Weiss someone, wieso ich mit dem MEdiaHub (NMH) 410 keine m4a (iTunes von) playing kann? Grüess

  • Is subclassing acceptable container?

    I was reading under the order reference: https://developer.BlackBerry.com/Cascades/reference/bb__cascades__control.html .. .that custom controls must be used instead of subclassing of existing controls.  This applies to containers? Are there examples