How to make a movie clip invisible depending on a value in another layer?

I am trying to make an "achievements" page for my game, where if the user has a high score greater than 100, then the achievement can be unlocked. I tried using a code like this, but it didn't seem to work!
function Check();
if(endscreen_mc.highscore_txt > 100)
medals.roachLock.visible = false;
else if(endscreen_mc.highscore_txt < 100)
medals.roachLock.visible = true;
else if(endscreen_mc.visible == 100)
medals.roachLock.visible = true;
The high score value is saved inside a shared object. What's wrong with my code, and what can I do to fix it?

I tried doing this, but it's still not working.. 
function Check():void
if(Number(endscreen_mc.highscore_txt.text) > 100)
medals_mc.roachLock.visible = false;
medals_mc.medal_mc.visible = true;
else if(Number(endscreen_mc.highscore_txt.text) <= 100)
    medals.roachLock.visible = true;
This is what's inside my endscreen layer
function showresults():void
          Rchannel.stop();
   // display current score
   endscreen_mc.scoreR_txt.text = String(score);
   // calculate, display and save (if necessary) a new highscore
   var so:SharedObject = SharedObject.getLocal("alltimeHighScore");
   if (!so.data.score || score > so.data.score)
       endscreen_mc.highscore_txt.text = String(score);
       so.data.score = score;
       so.flush();
             Check();
   else
       endscreen_mc.highscore_txt.text = String(so.data.score);
   if(so.data.score==score)
                    endscreen_mc.score_txt.text = String(score);
                    endscreen_mc.highscore_txt.text = String(score);

Similar Messages

  • How to make my movie clip move slowly towards right after a few seconds?

    Hi,
    I have the following code which will bring my Banner_mc onto the middle of my Introduction page with some effects. Now, I want this movie clip to wait for a while and then move to right until it disappear with the same effects. How can I do that?
    var BannerFadeTween:Tween=new Tween(Banner_mc, "alpha", Strong.easeOut, 0 , 1, 6, true);
    var BannerRotateTween:Tween=new Tween(Banner_mc, "rotation", Strong.easeOut, 360 , 0, 6, true);
    var BannerXTween:Tween=new Tween(Banner_mc, "x", Strong.easeOut, -300 , 500, 6, true);
    var BannerYTween:Tween=new Tween(Banner_mc, "y", Strong.easeOut, -125 , 300, 6, true);
    Thanks in advance for any help in this regard.

    Hi,
    Thanks for the reply. I wnat to make one thing clear that I am using my project SWF file on computer which doesn't have any internet connection. The other thing I can't find link for downloading the plug-ins.
    When I tried to download the file from the below link, I saw the following page:
    http://www.greensock.com/club/
    Please provide the download link for greensock TweenLite & TweenMax. Thanks.

  • How to make a movie clip button into a url link?

    Hello,
    I'm kinda new to using Flash and am trying to edit a template for a friend of mine, the problem is I'm trying to add a url link to the buttons. I tried adding this action to the button
    on(release){
    getURL(http://www.yoururl.com.);
    I saved as swf & got this error msg in the compiler errors: Symbol=but1,layer 4, frame=1 Mouse events are only for button instances
    In the library I checked the properties of the button and its a movies clip, I'm not sure if it will make any difference if I change to button or graphic?
    I would like to upload the fla and swf files but this forum doesn't seem to allow me to attach files to messages.
    Does anyone know how to do this? Any help is greatly appreciated.
    http://jaedenyoo.com

    Unfortunately that doesn't seem to be the problem, I checked and
    in my flash file its typed correctly.

  • How to make a movie clip follow the player

    Ok I want to make spawn able enemies and when they get in like 5 pixles in range they start to follow the player they are moving and if they switch directions it will go to another frame that will make it look like they are running in that direction. How can this be acheived?

    use Math.atan2() to find the angle between the player and enemy.

  • How to make a movie clip scroll with mouse position

    Hello again.  I asked a question about parallax scrolling and I think it was the wrong question.  I am looking to control a website with similar controls as this example:
    http://www.sectionseven.com/index2.html
    I want to use this but also with both  x and y axis.  Any ideas as to where to find a tutorial as to where to do this?  It should be fairly simple, but I am having trouble.  Any help or code is greatly appreciated.  Thanks!

    Yeah, I figured it out.  simply change 0.04 to -0.04
    addEventListener(Event.ENTER_FRAME,scrollmc1 );
    function scrollmc1(event:Event):void
         if(mc.x < 911  && (mouseX > 369)) {
            mc.x += (mouseX - mc.x) * -0.04;
         if(mc.x > 369  && (mouseX < 911)) {
            mc.x += (mouseX - mc.x) * -0.04
    Here is the actual code I used on my site:
    stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    stage.align = StageAlign.TOP_LEFT;
    function enterFrameHandler(e:Event):void
              if((sliderWorkspace.x < 911 && (mouseX > 1100)) || (sliderWorkspace.x > 369 && (mouseX < 90))) {
                  var newLocation:Number = sliderWorkspace.x + ((mouseX - sliderWorkspace.x) * -0.04);
                        newLocation = Math.min(910, newLocation);
            newLocation = Math.max(370, newLocation);
            sliderWorkspace.x = newLocation;
    Let me know if this works for you

  • How do you make a movie clip face the mouse

    How to you make a movie clip rotate so it's always facing the
    mouse?

    thanks a lot! I got the code to work, I just modified it a
    bit.

  • Can anyone tell me how to make a video clip in color transition?

    Can anyone tell me how to make a video clip in color transition like the opening of "Oh Brother where art though" ?
    You know the scene at the start where it starts off Black and White then as we move down the timeline it transitions to a rusty brown gradually.
    It's on the Apple site for FC Studio as a promo clip.

    how to do a keyframe trasition in the Color FX room
    I realize that you can "add" keyframes to the timeline in COLORFX, but I don't believe they are always observed, and then they usually disappear in retrieved projects, and aren't persistent if you leave the room. To remember where they are... you might mark in a keyframe on those frames in another room as a pathfinder. The behaviour is consistent with a creature of the six-legged variety.
    Method 1. If you are trying to taper the effect (any effect) in COLOR FX, the most linear approach is to render two versions of the clip; one "with", one "without" and do an opacity fade once you have returned them to Final Cut. This gives you the most control, flexibility, repeatability and consistency.
    Method 2. You may attempt to keyframe the bleach bypass settings within the node itself -- the preset that comes with COLOR doesn't have any controls, but the Nattress plugin does.
    Method 3. Set up a "blend" node with your bleach bypass feeding one of the inputs and leave the second input to default to the untreated video... keyframe a transition from "1.00000" to "0.00000" and that should work.
    Note: the keyframe timeline markers will disappear from the timeline if you exit the clip, but the effect is likely to persist. At least that was what was happening a couple of minutes ago... for me, the effect and blend performed the transition just like it was previewing when rendered. This strategy is subject to being created and rendered "on the spot right now", and I advise making sure you have your renderqueue settings ready to go... load the clip from the COLORFX room using the Mac command bar at the top of the screen and render it right away. Don't try to save it for later. Just Do It.
    An announcement went around about two weeks ago that Mr. Deakins' website was back up and running, so give him another try... poor guy has been swamped probably doing Dreamweaver maintenance... yeah, that must be it...
    jPo

  • How to make a short clip out of the original one ?

    Some days ago, I asked a question on editing a clip in this forum. The responder asked me to provide a few seconds of the clip for his examination. But I got stuck. I didn't know how to make a clip of a few seconds out of the original clip and that it had the exact same format and properties as the original clip.
    Neither Premier nor After Effect have an ouput option such as "same as original source" .
    So, my question is how to make a short clip out of the original one with everything the same properties as the original one.
    Thanks in advance.

    May be I haven't made myself clear
    Sorry, but I think that I am still not following you.
    I want to export and render the short clip to a new file which I want to have everything the same as the original clip. Just like I cut off a few seconds off it and that few seconds becomes an independent file.
    OK, you have your original source file. It is complete and is also unaltered. If you want a "Copy" of it, just use Windows Explorer, or similar to make that Copy. If you want a separate file of your edited version of that source file (as it appears in the Timeline), use the WAB (Work Area Bar) to include just that edited instance of the source footage, and Export just the WAB. This will give you a separate file with the edits in it.
    I still feel that neither is what you want. If you can step me through, maybe with screen-caps, what you have and what you wish to end up with, I can see the operation more clearly.
    Good luck,
    Hunt

  • How to make it move correctly?

    I made a simple Flex application. There is a helicopter which
    will move to points that user clicks in the canvas. For example, it
    is at A point. When I click at B point, the helicopter will move to
    B. Then it will move to C when I click at C.
    However, the problem arises when I click at B, C, D
    continuously. It moved from A to B. However, I don't think it moved
    from B to C. Maybe it moved from B' to C.
    Please tell me how to make it move correctly.
    [CODE]
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import flash.events.Event;
    import mx.controls.Alert;
    [Embed(source="library.swf", symbol="Helicopter")]
    public var MayBay:Class;
    [Bindable]
    public var xF:Number;
    [Bindable]
    public var xT:Number;
    [Bindable]
    public var yF:Number;
    [Bindable]
    public var yT:Number;
    public function onCanvasClick(event:Event):void
    var x:Number= myCanvas.mouseX;
    var y:Number= myCanvas.mouseY;
    var oX:Number=h1.x;
    var oY:Number=h1.y;
    xF=oX;
    yF=oY;
    xT=x;
    yT=y;
    MoveEffect.play();
    // Alert.show("x="+x+" y="+y+" xOld="+oX+" yOld="+oY);
    ]]>
    </mx:Script>
    <mx:Move id="MoveEffect" target="{h1}" xFrom="{xF}"
    yFrom="{yF}" xTo="{xT}" yTo="{yT}" duration="2000" >
    </mx:Move>
    <mx:states>
    <mx:State id="NewState">
    </mx:State>
    </mx:states>
    <mx:Panel width="70%" height="50%" title="Vi du">
    <mx:Canvas click="onCanvasClick(event)" id="myCanvas"
    width="100%" height="100%" color="White">
    <mx:Image id="h1" source="{MayBay}" width="80"
    height="50">
    </mx:Image>
    </mx:Canvas>
    </mx:Panel>
    </mx:Application>
    [/CODE]

    Make clicking disabled when the helicopter is moving. So
    right after a click, disable clicking.
    There are many coding possibilities for doing so. Make your
    own, then add the code below after it:
    MoveEffect.addEventListener("effectEnd",
    callHandlerFunctionOfSomeSort);
    private function callHandlerFunctionOfSomeSort(e:Event):void
    // In this section, re-enable it using your own method.
    Good luck!

  • How to make your movie from a template in AE CS6?

    Hello,
    Firstly, I'm new to this forum and Adobe After Effects. Hence, please excuse my beginner's language.
    I recently modified a slideshow template in AE CS6. After doing all the necessary modifications in the template project, I do not know how to make a movie out of it.
    I'll appreciate your help in guiding me by providing the necessary information to create the movie.
    Waiting for a reply.
    Thanks

    JMichael wrote:
    Actually, I have to create the movie urgently and send it to a colleague.
    Ouch. That's rather like saying your thesis committee needs your paper tomorrow and, say, while we're at it, can we help you with your research?
    After Effects is huge, unbelievably deep and stupidly complicated.
    It's not that we don't WANT to help you, it's that we cannot execute the rendering commands for you nor can we make all of the rendering and output decisions for you.

  • How do I transfer movie clips from iPhoto to iPad?

    How do I transfer movie clips from iphoto on my iMac, to my iPad?

    You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import.
     Cheers, Tom

  • How can I make an image appear partially in front and partially behind another layer in Adobe Illustrator?

    How can I make an image appear partially in front and partially behind another layer in Adobe Illustrator?

    Put the image behind the layer (at the back of it or on a layer below). With it still selected, Copy.
    Now Paste in Front (Ctrl+F). Depending on your Paste Remembers Layers setting, you may have to bring the newly pasted copy to the front, or to the upper layer.
    Draw a shape over the image to define the portion of it you want to appear "in front."
    With the shape and the image selected, clip the image using the shape. (Object > Clipping Mask > Make)

  • How to make the LV front panel controls the current value through the program is set as the default value when the next time you open?

    How to make the LV front panel controls the current value through the programis set as the default value when the next time you open?
    1110340051 

    Try this: Re: How to make a VI remember the latest control value?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Formula to populate one Person or Group column depending on the value of another Person Group column

    I am looking for a way to popluate the Account information of a Person based on another column where there name in another column.  I have Two Columns   "Name" which is a Person or Group information type and User Account which
    is also a Person or Group Information type.  When an Invidividuals name is entered into the Name column, I what the User Account column to prepolulate.

    Hi,
    For your issue, you can automatically populate User Information depending on the value of another Person or Group column by connectting with User Information List or  connectting with User Profile Web Service:
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=172
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How do you make a movie clip play in CS4

    Hello, I used Flash MX a long time ago (beginner level) then
    left it for years. I'm now using CS4 and am stuck. I have a stage
    with a movie clip placed onto it. I want to create a simple 'click
    to play' button so that the movie clip only plays on click of this
    button. Can someone please give me a step by step (idiot-proof)
    guide on how to do this please

    Cases that use to be _property in AS2 are now just property
    in AS3. So _x is x, _y is y, and _visible is visible. This should
    work:
    function showPlay(event:MouseEvent):void
    play_text.visible = true;
    pause_text.visible = false;

Maybe you are looking for

  • Purchase requisitions with item category "consigment" in transaction MD04.

    Hi, I need to configure the system in order to create purchase requisitions where every item category should be "consignment" when executing transaction MD04. What should I do? Thanks in advance, Luis.

  • Playback static on burned cd's

    HELP!! So far I have; Changed burn speed, purchased a brand new stack of CD-R media, re-downloaded and installed itunes 6, and AND Purchased a brand new CD BURNER!!!!! I have been on the phone with itunes support for over an hour just to be cut off w

  • Software Updates for Multiple iPhone Household

    Why is it necessary to download the software updates separately for each individual iPhone? These downloads take over an hour each time on our high-speed internet connection. Is there no way to download the installer once and use for all phones? Does

  • My Safari displays text in certains spots on a web page as mixed characters

    My Safari displays text in certains spots on a web page as mixed characters. Is there a fix for this or does anyone have an idea what may be going on? I have looked at my fonts and everything seems to be working just fine. I can't quite figure out wh

  • Crash (SIGSEGV, SIGILL) of 32bit Hotspot under Linux x86_64 in VMware

    Hello! A reproducible crash of these 1.6 32 bit Java VMs is hinderung my application from starting when I want to start it under a x86_64 Linux kernel in VMware (Workstation and ESX): - java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1