Visible of sprite script trouble

hi list
I need to have a few sprites invisible on opening of my
program and have them appear when rolled over. I am using the
following script in the script channel above the play head:
on mouseLeave me
the visible of sprite 34 = 0
end mouseLeave me
Trouble is that when the program starts some or all of them
are visible. It works perfectly when I roll-over them subsequently
i.e. they all appear and disappear properly. All the sprites are
visible all the time when I create the projector.
I have re-booted several times to no avail. Any ideas?
Eoin

One of the effects of the visible of sprite property is that
this
property will make the sprite active or not. If a sprite is
not visible,
it is also not active and won't react to user events like a
rollover.
To have a sprite be not visible and still react to user
events use the
blend property of the sprite.
Be aware that the visible of sprite property belongs to the
sprite
channel and not to the sprite that may currently occupy that
channel. If
you turn off the visible property of a sprite channel, it
remains off
throughout the rest of the score unless it is turned on
again.
The blend property belongs to the sprite in the channel, so
setting a
particular sprite's blend to 0 will not effect any other
subsequent
sprite occupying the same channel later in the score.
If you want the sprites to be not visible initially, then set
the blend
property to 0 in the beginSprite function of a behavior
attached to each
sprite. Then you can change the blend property's value to 100
when you
want the sprite to be visible. For instance:
property thisSprite
on beginSprite me
thisSprite = me.spriteNum
sprite(thisSprite).blend = 0
end
on mouseEnter me
sprite(thisSprite).blend = 100
end
on mouseLeave me
sprite(thisSprite).blend = 0
end
Rob
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119
http://www.macromedia.com/software/trial/

Similar Messages

  • Script troubles

    Hello!
    Learning scripting and I am running into a wall, I have gathered some stuff from the interwebs and put it together.  My main goal is to run a script that gathers my Application, Security (with Event Ids) and System logs with Error, Critical and warning
    levels.  When the log is ran it will export everything to a excel file in my directory of choice.  it seem I am unable to gather more than one even level and more than one log at a time.  I would like all three exported to the excel document.
    $opt3 = Read-Host "Would you like to export the details to csv file (Y/N)?"
    $server14 = Read-Host "Enter the server name"
    [int]$n = Read-Host "Last how many hours events need to be grabbed?"
    $event = Read-host "Application / Security / System / Others (Specify the name)?"
    $start1 = (Get-Date).addHours(-[int]$n)
    $start2 = (Get-Date)
    $strdat = (get-date).ToString()
    if ($opt3 -eq 'Y') {
    If ($event -eq 'Security') {
    $entry2 = Read-Host "FailureAudit / SuccessAudit ?"
    $location1 = Read-Host "Enter a drive location for the report"
    get-eventlog -logname $event -EntryType $entry2 -after $start1 -before $start2 -ComputerName $server14 | Export-csv -Force -Path "$location1\$(Get-Date -Format 'dd_MM_yyyy')-$Event Log-$entry2-$server14.csv"
    Invoke-Item "$location1\$(Get-Date -Format 'dd_MM_yyyy')-$Event Log-$entry2-$server14.csv"
    else {
    $entry0 = Read-Host "Information / Warning / Error ?"
    $location2 = Read-Host "Enter a drive location for the report"
    get-eventlog -logname $event -EntryType $entry0 -after $start1 -before $start2 -ComputerName $server14 | Export-csv -Force -Path "$location2\$(Get-Date -Format 'dd_MM_yyyy')-$Event Log-$entry0-$server14.csv"
    Invoke-Item "$location2\$(Get-Date -Format 'dd_MM_yyyy')-$Event Log-$entry0-$server14.csv"
    else {
    If ($event -eq 'Security') {
    $entry3 = Read-Host "FailureAudit / SuccessAudit ?"
    get-eventlog -logname $event -EntryType $entry3 -after $start1 -before $start2 -ComputerName $server14 | Out-GridView
    else {
    $entry1 = Read-Host "Information / Warning / Error ?"
    get-eventlog -logname $event -EntryType $entry1 -after $start1 -before $start2 -ComputerName $server14 | Out-GridView
    any help would be appreciated!

    Use the new and better event log utility.  Get-EventLog is for pre Vista systems.
    $filter=@{
    Logname=@('System','Security')
    ID=@(20,1014,3095)
    Level=@(2,3)
    Get-WinEvent -FilterHashTable $filter
    \_(ツ)_/

  • Creating script trouble

    Hi,
    gray text area where one is supposed to type script (home>sql>sql scrpts>script editor) just does't except any input. Or it's not text area at all? What am I missing?
    Also when I upload a text file with script and when I try to edit it, it can't be edited there's nothing in script editor.
    thanx
    alek_mil

    Here's the link to the previous thread: Firefox 1.5 problem with script editor
    Regards,
    ~Dietmar.

  • Archlinux Installer Script Trouble

    I've burned an FTP install disc, and after setting everything up, after I choose my server, and right before I install the packages, I always get the error "Error expected 7 tokens". I cannot install ArchLinux at all. Any ideas?
    Last edited by KunlunKhan (2008-12-11 12:10:32)

    sounds like this: http://bbs.archlinux.org/viewtopic.php?id=52584

  • Sprite Visible

    I have a script that checks for the visibility of checkboxes
    -- then it goes to the next marker
    go "Plan1"
    cursor -1
    Now it sets the visibility of certain pictures based on which
    checkboxes were selected.
    Problem: it sets the visibility of sprites on the original
    screen also.
    Shouldn't it only set the visibility of the sprites on the
    new screen - since I have used go "plan1" to get to the new
    screen

    The visible property belongs to the sprite channel, not the
    item that
    currently occupies the sprite channel. So, if you set a
    sprite channel
    to be not visible, it will stay not visible until you tell it
    to be
    visible again.
    You may want to use the blend property instead, this property
    belongs to
    the individual element in the sprite channel, not the channel
    itself.
    Be aware that if a sprite's blend value is set to 0, it is
    still an
    active sprite and any code attached to it will work. So a
    cursor change
    will still show if the user slides the cursor over that
    hidden sprite.
    This will not happen if you use the visible property.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • Visibility problem

    I'm currently using Director MX 2004, basically I'm wanting
    the mouse pointer to click on an object, and when the object has
    been clicked, for it to disappear. The problem comes when the
    sprite doesnt return at the start of a new game. What code could I
    use to make it re-appear at the start of a new game? I'm currently
    using
    on mouseUp
    sprite(2).visible = FALSE
    end
    to get the objects to dissappear. Any help would be greatly
    appreciated.

    When the new game starts, make it always set all of the
    parts'
    visibility back to true. If there are only a few things, then
    it may be
    easiest to put a script like this on the "reset button" (or
    whatever is
    used to start the game over)
    sprite(2).visible=true
    sprite(3).visible=true
    ..etc...
    If there are a lot of them, then put a handler like this in
    the script
    for those objects
    on resetVisibility me
    sprite(me.spriteNum).visible=true
    end
    and on your rest button, put this command to do all of them
    at once:
    sendAllSprites(#resetVisibility)

  • How can I affect multiple sprites?

    Hi:
    I am trying to affect multiple sprites when I roll over a
    button. Basically it says:
    on mouseEnter me
    sprite(3).visibility = 1
    sprite(4).visibility = 1
    sprite(5).visibility = 1
    end
    on mouseLeave me
    sprite(3).visibility = 0
    sprite(4).visibility = 0
    sprite(5).visibility = 0
    end
    How can I tell it to affect the 3 of them in one line? I
    tried:
    on mouseEnter me
    sprite(3,4,5).visibility = 1
    end
    but this didn't work.
    It is not an issue when its is only a few sprites...but I
    might need to affect 10-15.
    Any help would be great...
    Thanks!
    Rafael.

    You could use a repeat loop where you make a list of the
    sprite numbers
    then go through that list
    on mouseEnter me
    repeat with i in [3,4,5]
    sprite(i).visibility = 1
    end repeat
    end
    OR
    on mouseEnter me
    mySprites=[3,4,5]
    repeat with i in mySprites
    sprite(i).visibility = 1
    end repeat
    end
    That would be how to affect them directoly. You may not want
    to use a
    lot of tight repeat loops if there are large amounts of
    these, since
    that will tend to lock up Director until the repeat loop is
    finished.
    An easier way is to use sendAllSprites.
    In the script that is on the sprites that you want to control
    the
    visibility of, add a custom handler like this:
    on setVisible me, vVis
    sprite(me.spriteNum).visible=vVis
    end
    Then, on your button, you would have code like this:
    on mouseEnter me
    sendAllSprites(#setVisible,1)
    end
    on mouseLeave me
    sendAllSprites(#setVisible,0)
    end
    Now, when the mouse is over (or leaves) that sprite, any
    sprite which
    has that custom handler will turn its visibility on or off

  • How can I pass information from jsp script to javascript

    Hi, there,
    in my project, after the user login successfully, I want to pop up a window using javascript to show some information retrieving from the database, for example, what's the user's firstname, lastname, visittimes, etc. these information is just visible in jsp script, so I don't know if there is a way to pass these information to javascript, for example, alert window to show these information to the user.
    any hint will be great appreciated!!
    thank you very much for your great help!!

    One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.

  • I need to write a Java script to make my Art board bigger by 1 (one) inch on the Width and Length, Regardless of the Content?

    Hi,
    I am currently using "Visible bounds" (java script)to add 1 inch to the width and to the Length of my Art board, but when i make a clipping mask it actually reads the hidden content from the Clipping mask and makes conforms my art board to that particular shape. Am using Adobe illustrator cs6 Here is My Code:
    var myDocs = app.documents;
    var i = 0;
    for (i = myDocs.length-1 ; i >= 0; i--)
        var doc = myDocs[i];
        app.activeDocument= doc;
        var myVisibleBounds = doc.visibleBounds; //Rect, which is an array;
        myVisibleBounds[0] -= 36;
        myVisibleBounds[1] += 36;
        myVisibleBounds[2] += 36;
        myVisibleBounds[3] -= 36;
        doc.artboards[0].artboardRect = myVisibleBounds;
    All i Want is to add 1 inch to my width and length and this does it but if i have a clipping mask it will pick up the bounding box i guess? and it will conform it to the shape... any help please... Try my code and you will see that it does add 1 inch but now make you artboard lest say 12" x 12" and make a shape bigger than the art board and you will see how it adds 1 inch to the art board based on that shape...  now if you make a clipping mask to fit that shape in the 12" x 12" art board you will still get 1 inch bigger than the shape thats being clipped ... 

    yes, visible bounds is reading the non-visible masked objects too.
    you're going to have to do it the hard way, loop through all your objects to get your bounds manually, and while you're at it, test for clipping masks and use the masking path instead.

  • Problem with simple script tutorial

    In comparing and trying to replicate visibility functionality via scripting, I downloaded ChangingVisualObjectProperties.pdf to work on while going through the Scripting Basics PDF from Adobe. However, what should be a simple task has proved vexing.
    In a word, I can't get a button to change the visibility of a textfield object. I even went to the extreme of setting my file up to be identical in structure and naming convention to the tutorial file. Next, I did screen grabs of all the important property settings for the tutorial file and replicated that in my file. And finally, copied and pasted the actual bit of JS from the tutorial to my example. All to no avail.
    Attached are two files. The first is the sample script tutorial from Adobe's site entitled ChangingVisualObjectProperties.pdf. I've included it simply to make it easy for anyone who wants to compare the tutorial to my sample file. The button in question is CheckBox7.
    My file is called MyChangingVisProps.pdf and contains only two objects, CheckBox7 and TextField.
    If someone could tell me what I'm missing, I will be very grateful!
    Graham

    Well, I just found the answer in another post.... File-> Save As and choose Dynamic XML Form!
    Is there some reason this doesn't take effect when setting options in the Properties dialog?? Talk about a GOTCHA moment!
    Graham

  • How come the same script only works in one form?

    I made a checkbox that when checked it makes another subform visible. The script works perfect in one pdf. When I used the same script in another pdf (except I changed the variables of course) it doesn't work??????
    It's set the same in both scripts. The subform name is exactly "CR" in uppercase. In the Events its set to click*, javascript at the client. Here is the script. Please let me know what's wrong????
    if (this.rawValue == 1)
    CR.presence = "visible";
    else
    CR.presence = "hidden";

    You have to have the object referenced correctly and that can include subform and section information.

  • Bridge - Voluntary Scripting Guidelines

    I made a first post on this at ps-scripts:
    http://www.ps-scripts.com/bb/viewtopic.php?t=176
    It seems to me we would benefit from developing 'good practice' guidelines for Bridge scripting. Here are some intial issues that occur to me:
    1. Function namespaces:
    Given the use of start-up scripts and the loading of script libraries at start-up it is important we keep function names unique. I am going to use ah_myfunction() for all my own function names. It is also sensible that scripts should use libraries where one already contains a function, rather than duplicating the library function within another script - giving rise to a potential namespace conflict between different versions later.
    2. Bridge menus:
    Given how central scripting is to Bridge I feel there should be a top-line scripts menu (which I wish could be accessed via an FKey). We could call it 'Scripts' (lol). All non-startup scripts could be listed within that menu - perhaps some guidelines as to order would be useful - maybe alphabetical. It would then be optional to group those further as to application target (in many cases this would be unnecessary). If they are to be grouped by application it may be better to simply organise them with separators rather then put them in further submenus - I resent every extra click I have to make when accessing menus, especially when I am using automation to start with.
    To add some background to this point - while the menu customization potential of Bridge is attractive I believe it will mainly be used by scripters rather than by the broader user community. If scripters start creating individual menus as part of scripts they then distribute to a wider audience without consideration of what other scripters are doing things are going to get very messy very quickly. I could start off making an Andrew Hall Scripts menu and why not put next to that a link to my website and maybe to my artsite too etc.etc.
    3. Start-up versus one-off scripts.
    In many cases it is possible to create a script that does a particular task either as a startup script (the openshut.jsx script is an example of this) or as something that only gets run when required but which is not loaded at startup. I would say that where-ever possible scripts should be created as one-offs (ie not within the startup folder).
    4. A Non-Startup Scripts folder and a ScriptData folder
    With people writing and releasing non-startup scripts for Bridge, we (and especially the users) would benefit from having them generally put in the same place. My suggestion is to follow the organisation of Photoshop ie Bridge/Presets/Scripts.
    Then, some scripts generate data files, access help files, etc, these need to go somewhere. Xbytor and I discussed this a while back in relation to Photoshop and agreed to use subfolders (I use the subfolder AndrewHallScriptData) within a new folder ScriptsData within the Presets folder. I suggest the same would work for Bridge ie Bridge/Presets/ScriptsData/YourFolder/
    I am an absolute beginner to Bridge scripting so don't take the above as indicating I think I know better about this stuff than anyone else, I don't. Maybe some of these issues are misguided due to a lack of thorough understanding - if so I am happy to learn more. My issue is that I am about to release some Bridge / Photoshop scripts and I would like to organise them sensibly along the sorts of lines outlined above.
    Andrew

    I agree that, in the long run, things will get to be a real mess with global variables and function names conflicting right and left and anarchy in the menus if there aren't some guidelines. It probably won't happen soon because there won't be a flood of add-in scripts for awhile, so Adobe probably has some time to figure this out.
    Along the lines that Andrew started, here's what I would suggest:
    1) To solve the conflicting name problem, use the "#script script_name" directive (or invent a new #namespace directive) to automatically scope all global variables/function names to a single namespace under that directive. Since some functions need to be public, make a new way to declare just those as public. Perhaps use the #export directive to explicitly declare variables/functions that should be visible outside your #script namespace. Allow all script files with the same #script name to automatically be in the same namespace.
    This would give you the best of both worlds. You'd have easy sharing between your own scripts by just using the same #script name on all of them, all variables would be private by default and you'd have a simple way to list the few functions/variables that you wanted to be public.
    2) Menus. I like the menu flexibility we have now. It needs to be expanded to include other user interface elements like the filter's drop-down menu and other interface elements like toolbars. What I think is missing (or I haven't found) is the ability to have non-startup-loaded scripts that just automatically appear in a generic "scripts" menu. This would be just like actions automatically appear in the actions UI in Photoshop or filters automaticaly appear in the filters menu. Bridge should have a "scripts" menu for scripts that don't need to be loaded at startup and only need to run when invoked. This would also contribute to the namespace collision problem because scripts loaded in this manner would run, do their thing, and then be unloaded and wouldn't have a chance to conflict with other scripts that were run the same way.
    --John

  • Flex list iteamRenderer - making elements of iteamRenderer visible on mouseOver

    I have a list containing an IteamRenderer.  I want a button inside of the iteamRenderer to become visible when that element in the list is selected or being hovered over(mouseOver).  At the moment I'm able to accomplish changing the buttons visibility by using mouseOver and mouseOut on the Canvas of the custom component.
         <mx:List
                 width="100%" height="100%"
                 dataProvider="{ArrayCollection}" 
                 itemRenderer="List"
          </mx:List>
    List.mxml
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" mouseOver="showButtons()" mouseOut="hideButtons()">
        <mx:Script>
        <![CDATA[ 
            public function hideButtons():void{
                submitButton.visible = false;
            public function showButtons():void{
                submitButton.visible = true;
        ]]>
        </mx:Script>
         <mx:Button id="submitButton"  label="submit" visible="false"/>
    </mx:Canvas>
    Any help would be much appreciated
    Tanks!

    You can call owner.isItemSelected(data) to determine whether the item is selected or not
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Global Scripts?

    It would seem obvious that you would define global javascript functions in form1.initialize.  Is there a better event to define form-level/global javascript functions?
    When you save or execute livecycle, you get errors/warnings about such and such not being defined when referenced from field-level event scripts, yet at runtime it seems to work ok.  In fact, the same form1.initialize functions may be recognized in one field-level script, but not another one, even when they are for the same event.  And the error window seems not to be trustable, and neither the whole runtime system.
    Certainly, the -merge- process is faulty when it comes to scripts.
    Also, if you define a function using the conventional "function blah(x)", it's often not recognized by field-level event scripts, but if you define it as
    blah = function(x) it seems to have a greater chance of being recognized.  It's all pretty flakey.
    So, is there a way to deem javascript functions visible to other scripts?  Hierarchy just doesn't seem to do it.
    Also, I noticed bugs where livecycle didn't recognize legal javascript syntax, such as the ternary:  condition ? truevalue : falsevalue, if you use "true" for the true value, it gets confused and is broken.
    It's horrid that Adobe should try to muck with javascript, when they just should have stuck with javascript in the first place; just proves ignorance is not bliss, especially when mixed with arrogance.

    Global Javascript functions need to be defined in a scripting object. In the hierarchy view click on the root object, then right mouse click and choose the Insert Scripting Object option. This will create a new node (at the level) called variables and under that will be your new scripting object. Give it a name (click on it and hit F2) then you can write your code in the script editor. This will give all pof you r functions the scope they require.
    Regarding the true/false conditions I use those all of the time and have not seen issues. I have used both the keywords true/false as well as the 1/0 representation.
    Paul

  • Flash 8 sprites stop the stage updating

    Posted about this issue before but now it really is causing
    me hassel. It's the fact that I have two main Flash 8 sprites on my
    stage, one is an animated accordian style menu system which when
    the user clicks of a menu Director jumps to the relevant frame with
    both Flash sprites staying on the stage. I have also used, a couple
    of times, a Flash add banner animation on the main page and found
    these did not remove themselves from the stage. Answer on here was
    to do the following when jumping to another frame:
    sprite(1).visible=FALSE
    updateStage
    sprite(1).visible=TRUE
    Sprite 1 is a large QuickDraw rectangle covering the whole
    stage.
    Problem with this is it's causing the contents of the main
    area of the screen to flash on and off very quickly. As a lot of
    the frames jumped too also have QuickTime video playing Direct To
    Stage you get a multiple flicker as first QT loads, then the
    background is turned on and off. So I tried to modify the routine
    to only do this when jumping from a screen that had the flash ad
    banners on but know when I jump from a page with regular text and
    bitmap sprites and then the flash menu animates, it's not allowing
    the screen to update when arriving at the new frame with text and
    bitmaps on!
    This has been a bug for many years in Director and I am
    really annoyed that MM and now Adobe have never bothered to fix
    this. I am producing a large corporate catalogue on DVD-ROM and the
    client has complained about the flashing. So what do I do? Say, "Oh
    sorry, the guys at MM & Adobe couldn't fix this bug and have
    left it for years without even bothering, I know they have millions
    of dollars but they couldn't spare one programmer to fix this one.
    Yeah I know it says on the box that it works seamlesly with Flash
    but hey that obviously isn't true!"
    Any elgant solutions to this one???
    Kevin

    > sprite(1).visible=FALSE
    > updateStage
    > sprite(1).visible=TRUE
    I don't know who suggested this, but more reliable is setting
    the
    backgroung color of the stage to itself forcing a complete
    redraw of the
    entire stage area (although maybe the above does much the
    same thing):
    the stageColor = the stageColor
    As for QT flashing, this too has a simple enough work-around:
    move the
    sprite offstage for a frame while the QT engine initialises,
    then move
    it back for display - something like:
    -- behavior attached to QT sprite
    property spriteNum
    property my
    property myLoc
    property _initialised
    on beginSprite me
    my = sprite(spriteNum)
    myLoc = my.loc
    my.loc = myLoc + 10000
    _initialised = 0
    end
    on exitFrame me
    if _initialised then exit
    _initialised = initialised + 1
    my.loc = myLoc
    end

Maybe you are looking for

  • Question on Animated GIF Timing

    I have a weather-type animated GIF, and believe me, it is not my choice or idea, but anyway I need to get this working. Here it is: http://www.sendto.org/temp/weather-cvia.gif. In this animation, all the frames are set to 100 but the timing is not sm

  • Is it possible for a theme to 'not work'

    Hi all, Twice I've made a movie in iMovie, saved it with chapters, opened up a new theme in iDVD, droped the iMovie file in the iDVD window and saved as a disk image. It works fine, but when I burn to disc it just won't play on my stand-alone player.

  • Import a Class of Package in the Same Subdirectory of the Classpath

    Hi. I compiled the following "Package" program code without problem: package ch09Fig6; public class Point { protected int x, y; // coordinates of the Point // no-argument constructor public Point() { setPoint( 0, 0 ); } // constructor public Point( i

  • SWFloader loads SWF movie within Flex but not when compiled

    When I run my app in Flex, SWFLoader loads the SWF okay as a movie clip but as soon as I Export/Release Build, the new app SWF that is generated won't show the movie clip anymore.  If I take another SWF that is an app (not a movie clip) and give it t

  • Draging tabs to a new position in firefox 14 not working

    Today I noticed I could not drag tabs to a new position (the feature where you can click and hold on a tab, and drag it to a different position on the tab bar, new window, etc.) I have started in safe mode and the issue continued, so it seems unlikel