Tracking the visible property of a movie clip

Hello,
I am trying to track the visible property of a movie clip as
I need to perform a function when visible = true and another when
visible =false
I have tried to use a listener object but I can’t get
it to work. Can you attach a listener object to listen for the
visible property?
I have also tried an IF statement inside the move clip but
this only knows the state of the ._visible when it first runs.
I have got it to work with an onEnterFrame function on a
movie clip inside the one I want to know the property of but I
don’t like using the onEnterFrame as it uses a lot or
processor speed
Is there an easy way to track the visible property of a
movieclip???
Thanks
Sam.

> thanks for the help but the watch() method doesn't work
for getter/setter
> properties. is ._visible a getter/setter property?
I was afraid of that. Yes, _visible is a getter/setter, most
properties are. Basically watch() only works on read-only
properties and custom variables, which is a shame.
So I don't know of any more elegant way than constantly
checking to see if the value changed. Centralize it and maybe
package it in a nice class and you might feel a little better about
it...

Similar Messages

  • Using Flach CS4 and action script 2.0 how do I advance to a specific frame of the main timeline when a movie clip instance come to the end of its timeline?

    Using Flach CS4 and action script 2.0 how do I advance to a specific frame of the main timeline when a movie clip instance come to the end of its timeline?

    code on the last frame of your movieclip instance:
    _root.gotoAndStop('whatever_frame');  // will work unless this swf is loaded into another swf.  in that situation, you should use a relative path to the main timeline (eg,  _parent or _parent._parent etc).

  • Quick question: what is the difference between graphic and movie clips?

    What is the difference between the two symbols: graphic and movie clips? They both contain frames..?

    movie clips can have
    instance names : so they can be controlled via actionscript
    filters applied : drop shadow, glow, blur, color adjust etc
    blend modes applied : difference, screen, lighten, darken, etc.
    3d transformations
    graphics:
    none of the above
    the only real practical reason to use a graphic is the reason jdehaan stated. a graphics internal animation can be scrubbed via the main timeline. graphics will only advance when the main timeline advances. when the main timeline stops.. graphics stops.
    movieclips on the otherhand are said to run independent of the main timeline. so you can have a MAIN timeline with one frame only and the movieclip's interior animation will run constantly.
    also via the properties panel you can tell a graphic to stay stuck on a certain frame or loop a set number of times.
    always use movieclips unless you have a reason not too. as kglad said it will save you and others a lot of hurt in the future.

  • Quiz drag and drop, do the pictures need to be movie clips?

    I just worked my way through a Flash MX quiz template
    tutorial. The drag and drop uses movie clips, but they don't say
    this is required. Can I use png files from my library? I tried and
    it doesn't appear to work.
    I am very new at all this, so please bear with me. If I have
    to make the pictures into a movie clip, how do I do this, and how
    do I get them into my library?
    Any help would be greatly appreciated.
    JudyD

    I don't have a Recently Added playlist.  However, I discovered that the file I had named Eating Healthy was given the name You Can Enjoy Eating Healthy when it copied to iTunes.  I'm guessing iTunes pulled the full name of the piece from the internet.  Upshot--the mp3 did transfer to iTunes on all 3 tries, but I was looking in my alphabetized list under E, not Y, so I didn't see it there.  Thanks for your help. 

  • Disable visibility of group of movie clips?

    Very simple question... How do I set up an array (or other method), to disable the visibility of a group of movie clips all at once?
    I've tried this...
    var invisibleMCs:Array = new Array ("MC1", "MC2", "MC3");
    invisibleMCs._visible = false;
    ...and it does not work. I know this is a very basic problem, but one I'm not getting my tiny brain around. Any help would be appreciated.

    you need to loop through your array:
    mcVisibleF(false);
    function mcVisibleF(b:Boolean){
    for(var i:Number=0;i<invisibleMCs.length;i++){
    invisibleMCs[i]._visible=b;

  • Reaching a movie on the stage from inside another movie clip

    I'm trying to reach a body of text which i turned into a movie clip which is on the main stage, and have it scroll up/down whenever it rolls over the designated hot spots. Here's what i have.
    stage.addEventListener(MouseEvent.MOUSE_MOVE,down1,false,0,true);
    function down1(e:MouseEvent):void {
         if (mouseX>=0 && mouseX<=42 && mouseY>111.1 && mouseY<146.1) {
              stage.addEventListener(Event.ENTER_FRAME,scrolldown1);
         } else {
              stage.removeEventListener(Event.ENTER_FRAME, scrolldown1);
    function scrolldown1(e:Event):void {
         if(MovieClip(this.root).resume_txt.y > 219) {
              MovieClip(this.root).resume_txt.y += 5;
         } else {
              this.removeEventListener(Event.ENTER_FRAME, scrolldown1);

    Can you explain the purpose bhind these lines...
         if(MovieClip(this.root).resume_txt.y > 219) {
              MovieClip(this.root).resume_txt.y += 5;
    It seems as though if it is >219, it will move until the mouse moves out of the region.  Is there any specific aspect of it that you can pinpoint as not woking?.

  • How to remove a function on the main timeline within a movie clip

    How do you remove a function that is coded on a frame in the main timeline from within a movie clip?  I tried this, but no dice:
    infoGraphicDisparity.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
    function fl_ClickToGoToScene(event:MouseEvent):void
        parent.removeEventListener (Event.ENTER_FRAME, parent["enterFrameHandler"]);
        MovieClip(this.root).gotoAndPlay("disparity");
    this is the event I am trying to remove:
    stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    any help would be appreciated as always.
    Thanks!

    from any frame (that executes after enterFrameHandler is defined) in any display object in the display list
    stage.removeEventListener(Event.ENTER_FRAME, MovieClip(root).enterFrameHandler);

  • Can I change the registration point of a movie clip?

    I'm loading a movie clip dynamically and its registration
    point defaults to top-left corner. I need to change it to the
    center, is this possible? if so, how?
    Thank you

    Thank you. I tried that and it didn't work too. Please check
    this code:
    loader.loadClip(_global.image_url+this["image1"], image1);
    DynamicRegistration.initialize(image1);
    image1.setRegistration( 20, 20);
    What is wrong with it?

  • The ' VISIBLE' property of hierarchical tree

    Hi, all,
    I'm a new user of Forms6. When I buitld my first app for Oracle, I got one problem on hierarchical tree. The nodes all 'disappeared' if I changed the property 'VISIBLE'. For example, if I change the 'VISIBLE' from TRUE to FALSE and TRUE again, nothing there but a blank tree. Does any one can help me? Or is there any Build-in program unit like "Refresh"?
    Thank you.
    hao
    null

    unfortunately there is no "Refresh" built-in for Hierarchial trees
    Candace Stover
    Forms Product Management

  • How to play the main timeline after a movie clip is finished playing.

    Ok so here is the problem, I have the main time line with three layers: My actions layer, a music layer, and the movie clip layer.
    The movie clip is an actionscript movie which calls images from an external XML file and shows them as a slideshow. What i need to do is after the last image plays, stop the movie and move the main timeline to the next scene of the main movie. Everything logical in my brain is not working, and it may be that I have been staring at this project for too long but for the life of me i can't make this work.
    Any help or input would be greatly appreciated!
    Thanks in advance.
    Meghan

    better yet, here is the whole code. With your suggestion entered...
    import flash.display.BitmapData;
    import gs.*;
    import gs.easing.*;
    import gs.plugins.*;
    TweenPlugin.activate([BlurFilterPlugin]);
    OverwriteManager.init();
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    _root.xmlPath == undefined ? xml.load("jake.xml") : xml.load(_root.xmlPath);
    //when xml is loaded
    xml.onLoad = function(succes:Boolean) {
        if (succes) {
            //position the slideshow. remember size.
            __width = Number(xml.firstChild.attributes.width);
            __height = Number(xml.firstChild.attributes.height);
            mcMask._width = mcBlack._width=mcHyper._width=__width;
            mcMask._height = mcBlack._height=mcHyper._height=__height;
            //preloader
            mcPreloader._x = __width/2;
            mcPreloader._y = __height/2;
            (new Color(mcPreloader).setRGB(Number(xml.firstChild.attributes.preloaderColor)));
            //buttons
            var buttonLoader:MovieClipLoader = new MovieClipLoader();
            var buttonListener:Object = new Object();
            buttonListener.onLoadInit = function(cButton:MovieClip) {
                if (cButton._parent == btnNext) {
                    cButton._parent._x = __width-cButton._width;
                } else if (cButton._parent == btnPrev) {
                    cButton._parent._x = 0;
                } else {
                    cButton._parent._x = (__width-cButton._width)/2;
                cButton._parent._y = (__height-cButton._height)/2;
            buttonLoader.addListener(buttonListener);
            buttonLoader.loadClip(xml.firstChild.attributes.prevButton,btnPrev.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.nextButton,btnNext.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.playButton,btnPlay.holder);
            buttonLoader.loadClip(xml.firstChild.attributes.pauseButton,btnPause.holder);
            xml.firstChild.attributes.slideshowOn == "true" ? [_slideshow=true, btnPlay._visible=false] : [_slideshow=false, btnPause._visible=false];
            for (var i:Number = 0; i<xml.firstChild.childNodes.length; i++) {
                //create empty movieclip for each picture. create mask movieclip for each picture. save transition and ken burns settings for each picture. save other properties for each picture.
                mcTemp.createEmptyMovieClip("mcPhoto"+i,mcTemp.getNextHighestDepth());
                mcHolder.createEmptyMovieClip("mcPhoto"+i,mcHolder.getNextHighestDepth());
                mcHolder["mcPhoto"+i].createEmptyMovieClip("photo",mcHolder["mcPhoto"+i].getNextHighestDe pth());
                //attach text clip and set it up
                mcHolder.attachMovie("square2","mcBack",mcHolder.getNextHighestDepth());
                mcText.attachMovie("text","text"+i,mcText.getNextHighestDepth());
                mcText["text"+i].mcText._alpha = mcBack._alpha=0;
                mcBack._width = mcText["text"+i].mcText._width=__width;
                mcText["text"+i].mcText.autoSize = true;
                mcBack._height = 0;
                mcBack._y = __height;
                (new Color(mcBack).setRGB(Number(xml.firstChild.attributes.textBackColor)));
                mcHolder["mcPhoto"+i].transition = Number(xml.firstChild.childNodes[i].attributes.transition);
                var burns:Array = String(xml.firstChild.childNodes[i].attributes.kenBurns).split(";");
                mcHolder["mcPhoto"+i].burns = burns;
                mcHolder["mcPhoto"+i].time = Number(xml.firstChild.childNodes[i].attributes.time);
                mcHolder["mcPhoto"+i].src = String(xml.firstChild.childNodes[i].attributes.src);
                mcHolder["mcPhoto"+i].txt = String(xml.firstChild.childNodes[i].firstChild.nodeValue);
                mcHolder["mcPhoto"+i].url = String(xml.firstChild.childNodes[i].attributes.url);
                mcHolder["mcPhoto"+i].target = String(xml.firstChild.childNodes[i].attributes.target);
                //handle loading process. create loader objects. start "intelligent loading". set methods and actions for new newly loaded pictures.
                var photoLoader:MovieClipLoader = new MovieClipLoader();
                var photoListener:Object = new Object();
                photoListener.onLoadInit = function(cPhoto:MovieClip) {
                    //transform image to bitmap
                    cPhoto._visible = false;
                    var tempBitmap:BitmapData = new BitmapData(cPhoto._width, cPhoto._height);
                    tempBitmap.draw(cPhoto);
                    var cPhoto2:Object = mcHolder["mcPhoto"+_loaded].photo;
                    cPhoto2.attachBitmap(tempBitmap,1,"auto",true);
                    photoLoader.unloadClip(cPhoto);
                    removeMovieClip(cPhoto);
                    cPhoto2._parent._visible = false;
                    //remember original size
                    cPhoto2._parent.width2 = cPhoto2._parent._width;
                    cPhoto2._parent.height2 = cPhoto2._parent._height;
                    cPhoto2._alpha = 0;
                    _loaded++;
                    cPhoto2._parent.loaded = true;
                    if (_loaded<xml.firstChild.childNodes.length) {
                        //load next picture
                        photoLoader.loadClip(mcHolder["mcPhoto"+_loaded].src,mcTemp["mcPhoto"+_loaded]);
                    if (_loaded == _index+1) {
                        //show this picture
                        showPicture(cPhoto2._parent);
                photoLoader.addListener(photoListener);
            photoLoader.loadClip(mcHolder.mcPhoto0.src,mcTemp.mcPhoto0);
    //function that changes to the next photo(slideshow feature)
    function nextPhoto() {
        _index++;
        if (_index == xml.firstChild.childNodes.length) {
        //if picture is loaded, just show it. if not, wait until it loads                                                                           
        if (mcHolder["mcPhoto"+_index].loaded) {
            showPicture(mcHolder["mcPhoto"+_index]);
        } else {
            TweenLite.to(mcPreloader,.5,{_alpha:0});
            TweenLite.to(mcBlack,.5,{_alpha:100,onComplete:completeF});
    function completeF(){
    _root.gotoAndPlay("frame1_scene2");
    //function that changes to the previous photo
    function prevPhoto() {
        _index--;
        if (_index == -1) {
            _index = xml.firstChild.childNodes.length-1;
        //if picture is loaded, just show it. if not, wait until it loads                                                                           
        if (mcHolder["mcPhoto"+_index].loaded) {
            showPicture(mcHolder["mcPhoto"+_index]);
        } else {
            TweenLite.to(mcPreloader,.5,{_alpha:100});
            TweenLite.to(mcBlack,.5,{_alpha:80});
    //buttons - roll overs
    btnNext.onRollOver = btnPrev.onRollOver=btnPause.onRollOver=btnPlay.onRollOver=function () {
        TweenLite.to(this,1,{_alpha:70});
    btnNext.onRollOut = btnPrev.onRollOut=btnPause.onRollOut=btnPlay.onRollOut=btnNext.onReleaseOutside=btnPrev.o nReleaseOutside=btnPause.onReleaseOutside=btnPlay.onReleaseOutside=function () {
        TweenLite.to(this,1,{_alpha:100});
    //buttons - next
    btnNext.onPress = function() {
        if (!_transition) {
            clearTimeout(nextT);
            nextPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(nextPhoto, 500);
    //buttons - previous
    btnPrev.onPress = function() {
        if (!_transition) {
            clearTimeout(nextT);
            prevPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(prevPhoto, 500);
    //buttons - play
    btnPlay.onPress = function() {
        switchVisible(btnPlay);
        switchVisible(btnPause);
        _slideshow = true;
        if (!_transition) {
            clearTimeout(nextT);
            nextPhoto();
        } else {
            clearTimeout(nextT);
            nextT = setTimeout(nextPhoto, 500);
    //buttons - pause
    btnPause.onPress = function() {
        switchVisible(btnPlay);
        switchVisible(btnPause);
        _slideshow = false;
        clearTimeout(nextT);
    //function that animates text(html for each picture)
    function inText(cPhoto:Object) {
        if (cPhoto.txt != "undefined") {
            mcText["text"+_index].mcText.htmlText = cPhoto.txt;
            mcText["text"+_index].mcText._y = mcBack._y-mcText["text"+_index].mcText._height-4;
            TweenMax.to(mcText["text"+_index].mcText,0,{blurFilter:{blurX:15, blurY:15, quality:1}});
            TweenMax.to(mcText["text"+_index].mcText,Number(xml.firstChild.attributes.textSpeed),{blu rFilter:{blurX:0, blurY:0}, _alpha:100});
            TweenLite.to(mcBack,Number(xml.firstChild.attributes.textSpeed),{_alpha:Number(xml.firstC hild.attributes.textBackOpacity), _height:mcText["text"+_index].mcText._height+7});
        } else {
            mcText["text"+_index].mcText.htmlText = "";
            TweenLite.to(mcBack,Number(xml.firstChild.attributes.textSpeed),{_alpha:Number(xml.firstC hild.attributes.textBackOpacity), _height:0});
    function outText(cPhoto:Object) {
        TweenLite.to(mcBack,.5,{_alpha:0});
        TweenLite.to(mcText["text"+_index2].mcText,.5,{_alpha:0});
    //function that applies the ken burns effect to a specific photo
    function kenBurns(cPhoto:Object) {
        //reset size and position
        cPhoto.photo._xscale = cPhoto.photo._yscale=Number(cPhoto.burns[0]);
        cPhoto.photo._x = returnPosition(cPhoto.burns[2], cPhoto.photo._width, cPhoto.photo._height, mcMask._width, mcMask._height).__x;
        cPhoto.photo._y = returnPosition(cPhoto.burns[2], cPhoto.photo._width, cPhoto.photo._height, mcMask._width, mcMask._height).__y;
        //start effect
        TweenLite.to(cPhoto.photo,cPhoto.transition+Number(cPhoto.time)+1,{_xscale:Number(cPhoto. burns[1]), _yscale:Number(cPhoto.burns[1]), _x:returnPosition(cPhoto.burns[3], cPhoto.width2, cPhoto.height2, mcMask._width, mcMask._height).__x, _y:returnPosition(cPhoto.burns[3], cPhoto.width2, cPhoto.height2, mcMask._width, mcMask._height).__y, ease:Linear.easeNone});
    //function that shows a picture(transition function)
    function showPicture(cPhoto:Object) {
        for (var i:Number = 0; i<xml.firstChild.childNodes.length; i++) {
            if (i == _index || i == _index2) {
                mcHolder["mcPhoto"+i]._visible = true;
            }else{
                mcHolder["mcPhoto"+i]._visible = false;
        cPhoto.swapDepths(mcHolder.getNextHighestDepth());
        setTimeout(hideOld,cPhoto.transition*1000,mcHolder["mcPhoto"+_index2]);
        //text
        outText(mcHolder["mcPhoto"+_index2]);
        _index2 = _index;
        inText(cPhoto);
        kenBurns(cPhoto);
        TweenLite.to(mcPreloader,.5,{_alpha:0});
        TweenLite.to(mcBlack,.5,{_alpha:0});
        //transition variable
        _transition = true;
        clearTimeout(transT);
        transT = setTimeout(switchTransition, cPhoto.transition*1000);
        cPhoto.photo._alpha = 0;
        TweenLite.to(cPhoto.photo,cPhoto.transition,{_alpha:100});
        if (_slideshow) {
            //if slideshow is on
            nextT = setTimeout(nextPhoto, (cPhoto.transition+cPhoto.time)*1000);
    function hideOld(what:Object){
    //hyperlinks
    mcHyper.useHandCursor = true;
    mcHyper.onPress = function() {
        if (mcHolder["mcPhoto"+_index].url != "undefined") {
            getURL(mcHolder["mcPhoto"+_index].url, mcHolder["mcPhoto"+_index].target);
    //function that returns a number position from a given "compass position"(for the ken burns effect)
    function returnPosition(pos:String, __width:Number, __height:Number, __width2:Number, __height2:Number):Object {
        var returnObj:Object = new Object();
        switch (pos) {
            case "TL" :
                returnObj.__x = 0;
                returnObj.__y = 0;
                break;
            case "TC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = 0;
                break;
            case "TR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = 0;
                break;
            case "ML" :
                returnObj.__x = 0;
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "MC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "MR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = -(__height-__height2)/2;
                break;
            case "BL" :
                returnObj.__x = 0;
                returnObj.__y = -(__height-__height2);
                break;
            case "BC" :
                returnObj.__x = -(__width-__width2)/2;
                returnObj.__y = -(__height-__height2);
                break;
            case "BR" :
                returnObj.__x = -(__width-__width2);
                returnObj.__y = -(__height-__height2);
                break;
        return returnObj;
    function switchTransition() {
        _transition == true ? _transition=false : _transition=true;
    function switchVisible(obj:Object) {
        obj._visible == true ? obj._visible=false : obj._visible=true;
    mcTemp._x = -10000;
    //mouse testing
    var mouse_dx:Number = _xmouse;
    var mouse_dy:Number = _ymouse;
    var mouseSpeed:Number = 1;
    function checkPosition(Void):Void {
        if (_xmouse<mouseSpeed || _xmouse>(Stage.width-mouseSpeed) || _ymouse<mouseSpeed || _ymouse>(Stage.height-mouseSpeed)) {
            //mouse outside - hide buttons
            TweenLite.to(btnPrev,.5,{_alpha:0});
            TweenLite.to(btnNext,.5,{_alpha:0});
            TweenLite.to(btnPlay,.5,{_alpha:0});
            TweenLite.to(btnPause,.5,{_alpha:0});
        } else {
            //mouse inside
            TweenLite.to(btnPrev,.5,{_alpha:100});
            TweenLite.to(btnNext,.5,{_alpha:100});
            TweenLite.to(btnPlay,.5,{_alpha:100});
            TweenLite.to(btnPause,.5,{_alpha:100});
    checkPosition(Void);
    var mouseListener:Object = new Object();
    mouseListener.onMouseMove = function():Void  {
        mouse_dx = Math.abs(mouse_dx-_xmouse);
        mouse_dy = Math.abs(mouse_dy-_ymouse);
        mouseSpeed = mouse_dx>mouse_dy ? mouse_dx : mouse_dy;
        mouseSpeed += 1;
        checkPosition(Void);
        mouse_dx = _xmouse;
        mouse_dy = _ymouse;
    Mouse.addListener(mouseListener);
    //global variables
    var this2:Object = this;
    var __width:Number;
    var __height:Number;
    var _index:Number = 0;
    var _index2:Number = -1;
    var _loaded:Number = 0;
    var nextT:Number;
    var transT:Number;
    var _slideshow:Boolean = true;
    var _transition:Boolean = false;
    Stage.scaleMode = "noScale";
    Stage.showMenu = false;
    Stage.align = "TL";

  • Using the transition manager on a movie clip prevents me from physically moving it after that

    Hi,
    I'm using the transitions manager to animate certain objects
    in my movie. let's say I'm using it on a ball - using the following
    code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    function zoomIn(_mc) {
    new Tween(_mc, "_xScale", Bounce.easeOut, 0, 100, .3, true);
    new Tween(_mc, "_yScale", Bounce.easeOut, 0, 100, .3, true);
    function zoomOut(_mc) {
    new Tween(_mc, "_xScale", None.easeIn, this._xscale, 0, .05,
    true);
    new Tween(_mc, "_yScale", None.easeIn, this._xscale, 0, .05,
    true);
    and then calling it later with this:
    zoomIn(ball_mc);
    That works fine. But at a later stage of the movie I then try
    to move the location of the ball - not with code but by adding a
    key frame and physically moving it's location. When I play the
    movie back it does not show that it moves.
    I'd really just like to know why this is!
    Thanks,
    Ray

    I think that once the Tween plays, the ball_mc, now resides
    in it's final resting place, it might do this with all instances of
    the mc, interesting though. I would have thought the same, maybe if
    you move it and give it a different instance name it will not
    effect the position on the new keyframe.

  • How to use the visible property

    Hi all,
    Im trying to implement the page(view)which has 3 trays.
    Once the page is loaded ,I want to make only the first tray visible and other 2 trays should be invisible.
    Based on the users input on the 1 st tray, the 2nd or 3rd tray shud get enabled and visible to the user.
    Please let me know how to make the tray visibl after the user input.
    Regards,
    Nithya K

    Hi Nithya,
    Please create the context attribute for the visibilty type.  Once context attribute created,
    Select type <...> button >> Dictonary Simple Type >> Dictonary >> Local Dictonary >> type com.sap.ide.webdynpro.uielementdefinitions >> Visibility OR directly put type     com.sap.ide.webdynpro.uielementdefinitions.Visibility
    Then try to implement you logic for showing the 2nd or 3rd tray in the if loop. like
    if (<condition true>)
       wdContext.currentContextElement().set<your Attribute name>(WDVisibility.VISIBLE);
    else
       wdContext.currentContextElement().set<your Attribute name>(WDVisibility.NONE);  
    Then bind the visible properties in the Tray.
    Hope it helps
    Regards
    Arun

  • Why error when looping a sheets collection and setting the visible property?

    I get an error on line 5 when running the following code:
    1Sub ShowSheets(vSheets() As Variant)
    2
    3 Dim i As Long
    4 For i = LBound(vSheets, 1) To UBound(vSheets, 1)
    5 ThisWorkbook.Sheets(vSheets(i, 1)).Visible = xlSheetVisible
    6 Next i
    7
    8End Sub
    The error code I get is:
    Run-time error '-2147417848 (80010108)':
    Method 'Visible' of object '_Worksheet' failed
    I only get the error when at least one of the sheets is a chart. But the error does not occur when the chart object is looping. Instead it occurs when the first worksheet object after the chart object is looping.
    What is the cause of this error?

    Hi JP3O,
    >> only get the error when at least one of the sheets is a chart. But the error does not occur when the chart object is looping<<
    I am trying to reproduce this issue however failed. From the error message, it seems that the visible couldn't set when you call the sub.
    How the code was executed? Would you mind sharing more detail about this secnario?
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I can't set the visible property of a CWAnnotation Object

    I'm working in a W2000 with Visual Basic 6.0.
    When I try to set this property (Visible in CWAnnotation), Visual Basic generates a run time error. Is there any kind of patch?

    This is a known issue with Measurement Studio 6.0. There is not currently a patch for this problem. The workaround is to move the annotation outside the plot area when you do not want to display it.
    David Rohacek
    National Instruments

  • How to Change the Visible property of Adobe Form Dynamically - URGENT

    Hi,
        I am woking on a scenario where when I click a button in Adobe Form,
    another Adobe Form should be displayed. This is using Web Dynpro Java.
    For this I have made the second form invisible and I want to make this VISIBLE when the button is Clicked. I am unable to get a method where this property of interactive form can be changed.
    Also, If there is any other way this can be done please let me know.
    I am using NWDS 7.0.09 with Adobe Live cycle designer 7.1.
    Thanks in Advance,
    Vasu

    You need to get the handler to the adobe form in your webdynpro program. If you are using webdynpro for java the following code snipped could be useful...
    IWDPDFDocumentInteractiveFormHandler iFormHandler = WDPDFDocumentFactory.getDocumentHandler(wdThis.wdGetAPI(),"YourAdobeForm");
         // Get appearance setter. 
         IWDPDFDocumentAppearance appearance =
              iFormHandler.getDocumentContext().getAppearance();
         //appearance.
         // Set page layout option
         appearance.setPageLayout(pageLayoutOption);
         // Set show option.
         appearance.setShowOption(showOption);    
         // Hide menu bar.
         appearance.hideMenuBar(true); 
         // Hide tool bars.
         appearance.hideToolBars(true);
         // Hide window controls.
         appearance.hideWindowControl(true); 
         // Show full screen.   
         appearance.showFullScreen(true);
    Reward points if the post is helpful
    Thanks!
    Surya.

Maybe you are looking for