To resize a clip using AS3 (in my game, it's the life bar)

S O L V E D thanks.

In addition to my document class I created classes for the objects in my game.

One of them is a class of a rectangle that has to reduce during the execution of the timer of my document class.

So far I managed to change the following (on the other mc) when the timer is in place: alpha value and the position of the clip.

My code for this class so far:

{

import flash.display.MovieClip;

SerializableAttribute public class TimerMiddle extends MovieClip

{

public void TimerMiddle()

{

x = 1242;

y = 300;

}

}

}

I think that the next step in this class file would make a new public function to manipulate the scalebar timer called TimerMiddle. I want the width remains the same, but the height to decrease as the TimerEvent runs. I made sure that the referance point is at the bottom of the rectangle.

How can I change the scale of the rectangle to indicate that the life of the player goes down as the time runs? I don't know if I change the height of the vertical bar, scale or it I use interpolation (and how to implement one of the three.)

What should import into my document class once the best option is chosen?

Thanks for the help

Thanks it works now.

This added to the code

public function scaleLifeBar (): void

{

height = height - 10;

}

I think that my timer went to fast to see work before LOL. Coding brings out my stupid inside sometimes.

Try all three and see which works best.  If something happens too fast, slow down either take smaller steps.

Tags: Adobe Animate

Similar Questions

  • How to create a play button to the video clip using AS3

    Hello.

    This new bit and searched the forums adobe and google. I am trying to create a button that will play an any MovieClip.

    I have a clip that I imported into its own layer of rebar (layer1) 1.  I gave the MovieClip an instance name of foundationMovie.

    I created a button and that on its own layer (Layer2) above layer1, is also in the picture 1.

    I added a

    Stop (); action of layer2

    The video is not set to AutoPlay.

    I want the video to start playing when the viewer clicks the button.  I know I have to put some sort of event using AS3 listener in my calendar somewhere.

    I found a code and I tried to work with her.  I'm sure I've mutilated it beyond usability, but it's what I have.

    Stop ();

    player.addEventListener (MouseEvent.CLICK, play);

    function play(event:MouseEvent)

    {

    gotoAndPlay ("foundationMovie");

    }

    If someone could point me in the right direction or help me with my code I would really appreciate it.  Thank you.

    If you use the FLVPlayback instance it should be on your scene, or you should have the code added to the scene. If you use the FLVPlayback instance, you don't need to import the video file, you have to have the component dynamically load by assigning the file to its source property.

    That said, the code that I showed earlier would continue to operate if the component FLVPlayback instance name of the instance 'foundationMovie '.  It's because the component has a play() and stop() supporting method.  What you need to do probably, is looking for the FLVPlayback class in the help documentation of Flash to see all that is avialable for her regarding the properties, methods and events.  You will probably find there examples as well to help you configure things.

  • Cannot use Windows + space and unable to see the language bar.

    Yesterday, I just did a full system recovery (at the original factory image). on my new laptop Dell which has windows 8.
    I had two languages in my preferences of Arabic and English
    Basically, the problem is that I can't use the shortcut Windows + space to change the language. everything works just Alt + Shift
    Also, this is not the language next to the clock bar! The taskbar looks like this

    and when I activate the indicator of "entry" system icons:
     
    It appears only as an empty space between the clock and the sound!

    also when I press Windows + I
    There is no language next to the power icon icon!

    Everything worked perfectly after recovery, but just after the execution of windows updates, he disappeared.
    I tried to remove Arabic and leaving only English alone and then add it back. but did not work
    also tried to change the settings here:

    also here

    but nothing has worked.
    so I restored all default settings and they don't currently exist in the two photos above.

    I already reinstalled the operating system!
    in any case, I did what you mentioned and did not work.
    Thank you.

  • I want to create new sequence from a clip using script.

    I want to create new sequence from a clip using script.

    You can pop the dialog box new sequence (which requires interaction from the user to confirm the name of sequence), or create a new sequence from a .sqpreset file (and specify the name); There is no API around the feature 'make a sequence corresponding to this project item', available in the project Panel.

  • is it possible to know what browser in which flash is played using AS3?

    Hi all, I need to get the information from broswer dynamically

    is it possible to know what browser in which flash is played using AS3?

    JavaScript can detect the browser and flash can communicate with javascript using the externalinterface class.

  • Problem of external variable using AS3 in FlashCS3

    I'm moving the values of database in Flash (using AS3) thanks to a release of the simple PHP script! The problem is... I have not been able to get Flash/AS3 to recognize that she has received the allegedly externally loaded data, let alone prove that it is ready to work with the values passed into it somehow. So, OK...

    .. the is my PHP (phpCode.php) code:

    Moreover, the code I posted in this thread works!

    In other words, if the first line of the AS3 code is as shown above, instead of containing a single period (.) in the path of the file, like my local code.

  • AS3: ScrollPane component position and the scroll bar


    Hello:

    I use AS3 to import, add and fill a scroll bar with textfields. I want to position the vertical scroll bar on the left side rather than on the right side. How can I go about using AS3?

    I looked in these and other forums, not to mention the Flash help, nothing helps. If I'm missing something obvious, everyone is welcome to point out.. :)

    Thank you!

    Patrick

    Oh OK. If you want to adjust the position of the scrollbar in a ScrollPane component, it may be possible with a bit of work. only from some experiments, then, I found that you can refer to the vertical scroll bar in a ScrollPane with the verticalScrollBar property and this allows to move, with something like:
    scroller.verticalScrollBar.x =-20;

    However, you must wait to make content and scrollbars to become active before trying to move the scroll bar. I used the event 'added' as follows: (see attached the code below)

    the only problem is that the background of the scroll bar still exists, but you should be able to remove it with skins or fudge a chart on top of it to hide.

  • use a search engine in the address bar

    Hello

    for one or two years, firefox has had an update to change the search parameters.
    Before that happened, we used to use the address bar of google-search and use of the search bar for individual searches like imdb or in some cases use of keywoards for individual research via the address bar. The 'new' - versions of firefox (I guess it was the update 23 FF and all the following versions) replaces the browser.search.defaultsearchengine whenever you change the engine in the search bar. In this way, the two bars of Act quite the same when it comes down to research. It took some time for the (German) supportpages update to this new behavior, but now that this has happened, there is still no clue how to change it back to the old settings, where the search bar is the search and address bar only led to a search via google, when it was necessary.
    So how can pick us up with a search engine in the adressbar again without going through the embarrassment of having to choose the search bar engine?
    I couldn't find useful information or plugins and 'Smart search' and 'Keywords' are no option for us.

    I would really appreciate help with this.

    Thanks in advance
    -Subsessor

    (I'm sorry for any missspelling, English is not my mother tongue.)

    Edit: fault of typing/syntax

    Found a solution in this related Post:
    https://support.Mozilla.org/en-us/questions/1029070

    The recommended addon "keyword" solved my problem.

    https://addons.Mozilla.org/firefox/addon/keyword-search/

  • URL bar do not use keyword.url to search, rather than use any engine is active in the search bar.

    Earlier, when I used to get a few words into the address bar and press ENTER, firefox would use the innovation of google by searching for the name and redirect to what I want. For example if I wrote fb, it took me to facebook, and if I wrote something ambiguous it would open a google search for the query.
    Recenly, it's somehow changed. I keyword.enabled set to true and the keyword.url is http://www.google.com/search?ie=UTF-8 & oe = UTF - 8 & sourceid = navclient & gfns = 1 & q = but when I enter something in the address bar, it uses the active engine in the search box. If I have active wikipedia in the search box and I type in google in the address bar, it takes me to the page from wikipedia to google.

    You can also try to use http://ready.to/search/en/ to create your own custom search engine...

  • From numerous references to sub - VI you use clusters returns an incorrect reference to the nodes property

    Hello

    I'm moving in the data from the controls on the main gui (also information using indicators) in my Subvi. For the life of me I can't figure out what the problem, I tried dang near everything so any help is very appreciated. Also, I suspect that my cluster may contain too much information. Finally, yes I know there are a lot of posts about it, but none seem to alieviate my problem.

    (Just a warning, if you try and you run the code, you will first need to change where the data file is stored, it only takes all the sensors and calculations information and stores it in a file)

    I couldn't reach all the Subvi, so I joined him relavent those. The main problem is the LangmuirTroughStepperMotorCodePlusSubVi in DataGatheringSubVi

    # You can not use 'create a control '.  I have no idea which wire or terminal you think that using on.

    You must:

    Remove one of the constant pink cluster.

    Move the static checking references and functions of Bundle for out of the loop.

    In each group, take the wire coming from the output of the beam, he wire through the wall of the loop like a tunnel.  Connect it to the appropriate entry of the Subvi.

    I recommend you watch the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

  • DON'T KNOW: How to resize a clip created during execution

    I don't know how to resize a clip created when running...



    Thank you. This works. I used _xscale and _yscale.

    var listener: Object = new Object();
    my_mcl. AddListener (Listener);
    listener.onLoadComplete = function() {}
    my_mc._xscale = 25;
    my_mc._yscale = 25;

    };

  • I'm trying to resize the length of the address bar and the search bar. I could before using a 'line' between them to drag to resize. But now this is not s

    I'm trying to resize the length of the address bar and the search bar. I could before using a 'line' between them to drag to resize. But now it's not showing. Any ideas?

    What I have done this; I added a new toolbar, and moved to the research
    window and other things for her. Now I have a LOT OF ROOM

  • I am importing video clips using my Canon XL1s in final cut pro.  See the video, I hear the audio until it is imported.  any suggestions

    I am importing video clips using my Canon XL1s in final cut pro.  See the video, I hear the audio until it is imported.  any suggestions?

    danobtwo wrote:

    See the video, I hear the audio until it is imported.  any suggestions?

    Do you mean during the import process?

    There is no FCP X parameter to change the way THAT DV is imported.

    I used to hear the audio import with Sony cameras but Canon may be a different story.

    If the imported files are OK, then it can be a thing of Protocol firewire Canon.

    Al

  • How to make a dvd of clips using windows dvd creation

    How to make a dvd of clips using windows dvd create?

    Depends on what format they're in. If theyre not in a creation of dvd format can load, you will first need to convert them with something

  • app iOS using AS3 don't fit the screen dimensions

    I am building an iOS application using as3 and air to package the app on my iPhone 6. My problem is that I get a black bar above and below the app, the app itself is not full screen. Step screen is set to the dimensions of 6 iPhone screen.

    I tried adding the following images of launch in the app folder. [email protected], [email protected] and [email protected]. But it is not displayed correctly.

    Does anyone have fixes for this?

    Hi messarimohamed

    iPhone 6 & iPhone6 + require different Images of launch of older phones:

    For example,.

    The iPhone 6: Default-375w-667h@2x~iphone.png

    And iPhone6 +: Default-414w-736h@3x~iphone.png

    For more details in this regard, read the article below:

    http://blogs.Adobe.com/airodynamics/2015/03/09/launch-images-on-iOS-with-Adobe-Air/

    -Tushar,

    Adobe AIR Team

Maybe you are looking for