Using variables in paths to objects

Hi
I'm wondering how I can use a string in a declared variable
for a path to an object. Here's an example:
On the press of a button a variable is declared:
_root.nextsection = "news";
And later on I want to use the string "news" in a path, like
this (on a frame action):
if (_root.nextsection == "news") {
this.nextsection.gotoAndPlay(1);
As you can see in the second line I'm using the variable name
as a path... but this doesn't work.
Any suggestions?
Thanks

Depending of where your if statement is, if your
this.nextsection is the
same as _root.nextsection, since this is a string and not an
mc, what it
does is:
"news".gotoAndPlay(1).
If you had a movieclip named news in the _root, then you
could do:
_root[_root.nextsection].gotoAndPlay(1) // EQUIVALENT TO
_root["news"] or
_root.news
Other option is:
var mynextsection_mc = eval("_root." + _root.nextsection) ;
mynextsection_mc.gotoAndPlay(1);
Flash will evaluate your constructed string "_root.news" to
an object and
return it, if it doesn't match anything, then you will get an
undefined.
JG
"Cetrez" <[email protected]> wrote in
message
news:ejqacs$q6r$[email protected]..
> Hi
>
> I'm wondering how I can use a string in a declared
variable for a path to
> an
> object. Here's an example:
>
> On the press of a button a variable is declared:
>
> _root.nextsection = "news";
>
>
>
> And later on I want to use the string "news" in a path,
like this (on a
> frame
> action):
>
> if (_root.nextsection == "news") {
> this.nextsection.gotoAndPlay(1);
>
> }
>
> As you can see in the second line I'm using the variable
name as a path...
> but
> this doesn't work.
>
> Any suggestions?
> Thanks
>

Similar Messages

  • Using Variable Replacement Path with Hierarchies

    Hi,
    I have a requirement where I have two product hierarchies.
    In my report I want the user to be able to select which hierarchy they view at run time.
    I want them to be able to see this hierarchy as a tree,in order for me to do this I first must inlcude one variable to specify which hierarchy i am going to use, then the next Variable2 is populated by Variable1 and allows the users to expand on that hierarchy tree.
    E.g
    At Run Time
    Selection 1: User selects Product Hierarchy1
    Selection 2: Gets automatically populated based on selection 1 to show the product hierarchy tree for this variable.
    I have tried using replacement paths to do this but it does not allow this.
    Any ideaS?
    Thanks

    It finally worked, looks like the reason it was not working was a Query Designer exception issue whihc went with a re-start of Query Designer.
    All good

  • Need to use variable Local Paths

    Hello,
    I have a the following snippit, how can I add a variable to the bolded UNC path C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml
    Those paths will change a lot in my scenerio. Thank you.
    $file_server = Read-Host "Enter the file server IP address"
    (Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\gpreport.xml"
    (Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\Backup.xml") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\Backup.xml"
    (Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini") | ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini"
    (Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\Drives\drives.xml") | ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\Drives\drives.xml"
    (Get-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\files\files.xml") | ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } | Set-Content "C:\TEMP\GPO\source\5\{231A178D-DC6C-4186-9575-9C64F07DA5B5}\DomainSysvol\GPO\User\Preferences\files\files.xml"

    I'm not sure I understand the question. Are you saying you want the bold part of your path (currently hard-coded) to be in a variable instead? That would look something like this:
    $file_server = Read-Host "Enter the file server IP address"
    $guid = '{231A178D-DC6C-4186-9575-9C64F07DA5B5}'
    (Get-Content "C:\TEMP\GPO\source\5\$guid\gpreport.xml") |
    ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
    Set-Content "C:\TEMP\GPO\source\5\$guid\gpreport.xml"
    (Get-Content "C:\TEMP\GPO\source\5\$guid\Backup.xml") |
    ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
    Set-Content "C:\TEMP\GPO\source\5\$guid\Backup.xml"
    (Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini") |
    ForEach-Object { $_ -replace "99.999.999.999", "$file_server" } |
    Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Documents & Settings\fdeploy1.ini"
    (Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\Drives\drives.xml") |
    ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } |
    Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\Drives\drives.xml"
    (Get-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\files\files.xml") |
    ForEach-Object { $_ -replace "\\99.999.999.999", "\\$file_server" } |
    Set-Content "C:\TEMP\GPO\source\5\$guid\DomainSysvol\GPO\User\Preferences\files\files.xml"

  • MM_openBrWindow - using variable in path

    Hello,
    If I have done this:
    <script language="javascript">
    var large="/graphics/00000001/main.jpg";
    </script>
    How would I write the MM_openBrWindow to use that variable?
    So normally it is like this:
    <a href="javascript:;" onClick="MM_openBrWindow
    ('imagepath','large','scrollbars=yes,resizable=yes,width=540,height=540')">
    View Large Image</a>
    Where 'imagepath' is a hardcoded path. How can I write it to
    interpret and
    use the variable "large" I defined above? Thank you

    <script type="text/javascript">document.write('<a
    href="javascript:;"
    onClick="window.open('imagepath'," + large
    +"','scrollbars=yes,resizable=yes,width=540,height=540')\">View
    Large
    Image</"+ 'a>'
    </script>
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Cortney" <[email protected]> wrote in message
    news:[email protected]..
    > Hello,
    >
    > If I have done this:
    >
    > <script language="javascript">
    > var large="/graphics/00000001/main.jpg";
    > </script>
    >
    > How would I write the MM_openBrWindow to use that
    variable?
    >
    > So normally it is like this:
    >
    > <a href="javascript:;" onClick="MM_openBrWindow
    >
    ('imagepath','large','scrollbars=yes,resizable=yes,width=540,height=540')">
    > View Large Image</a>
    >
    > Where 'imagepath' is a hardcoded path. How can I write
    it to interpret
    > and
    > use the variable "large" I defined above? Thank you

  • How to use @variable(bouser) in Universe to get BOE userid in Xcelsius

    Dear Expert,
    I have request that need to display BOE userid to displayed in Dashboard using Xcelsius,
    after searching in Internet, i found that it can be done by using @variable(bouser) in an object in the Universe, and use the object in Qaaws, but i don't how to use it.
    already tried insert /* @variable('BOUSER') */ in END_SQL universe parameter, but still no luck.
    my question is :
    how to use @variable(bouser) in universe? and then my Xcelsius can display the BOE userid?
    thanks in advance for any answer.
    I Using SAP Integration KIT to create universe from Query BEX
    Luqman
    Edited by: luqman hakim on Jun 29, 2010 4:03 PM

    >
    Didier Mazoue wrote:
    > Hi,
    >
    > You are mentioning that you are using SAP Integration Kit.
    > Does it mean that the source you are targeting is SAP BW?
    >
    > If it is the case, this is unfortunately not supported.
    > SAP BW MDX does not support calculated expressions that return string or date: this is a limitation of SAP BW engine.
    > This is one of the reason why a lot of user exit are used to address these needs.
    >
    > Regards
    > Didier
    Didier Mazoue 
    yes, my Data source is SAP BW, and connected to BOE via SAP INT KIT.
    It's too bad that SAP doesn't support so simple requirement.
    you said : user exit 
    are used to address these needs.
    so there are possibility to solve my problem.
    would you give me the logic of user exit?  which part I should create the user exit
    I'm quiet familiar with user exit in BW
    thanks

  • FTPs connection error:When using Variable substitution for Directory path

    Hi
    I am transferring data from BI to xml file via PI: Here a Client proxy from BI sends the data to PI and the PI FTPs the XML file to a remote location. For FTP I am using FTPs SSL connection.
    It was working fine untill I used Variable susbstitution to determine Directory path dynamically. I am using this because different xml files are intended to goto the different locations.
    I did the variable substitution like this:
    Target Message Structure:
    ---> Target Directory: %var1%
    <?xml version="1.0" encoding="UTF-8" ?>
    <MT_BI_EXTRACT_FILE>
      <Header>
         <Directory>/Customer</Directory>
    </Header>
    <Detail>
    </Detail>
       </MT_BI_EXTRACT_FILE>
    And in the variable substitution I am doing it this way
    payload:MT_BI_EXTRACT_FILE,1,Header,1,Directory,1
    And the error I am getting is:
    Attempt to process file failed with Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Exception caught by adapter framework: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure.
    Does anybody have some Idea of this ??
    Regards
    Naina

    Hi,
    I guess the problem is not with Variable Substitution..
    Error when getting an FTP connection from connection pool:
    So its a connection problem..
    Also check the option Disable Security check and try again...
    Try to check again if the interface is executing properly without Variable substitution and let us know..
    Babu
    Edited by: hlbabu123 on Jan 7, 2011 2:46 PM

  • Using variable names for object names

    Is there any way you can use a String variable to name an object? I.e., something like:
    String name = "objectName";
    \\ create an Image object named objectName
    Image (name.valueOf()) = new Image();
    This code obviously does not work, but I'm working on a map applet which uses a map composed of thousands of tiles, and then shows only a portion of the map by drawing the appropriate tiles into the window using the x/y coordinates and a nested for loop to determine which tiles to draw. However, unless I want to manually declare and then call each of these Image objects, I need to have a way to have the actual name of each image object be a reference to a variable, which I will then initalize according to the name of the tile I'm using. Does that make sense at all? Anyway, I was just wondering if anyone knows of any way to do this. Thanks.
    -Ari

    Typically this is done using a Collection, for example:
    Image[] img = new Image[100];
    for (int i=0; i<img.length;i++)
      img[i] = new Image();... Sort of thing.

  • How to use variable in source path of an image  in flex

    hello
    i just want to know that how to use variable in source path
    of an image in flex

    I am doing exactly that with data binding at the moment. This
    is my Image element
    <mx:Image width="50" minHeight="50" height="76"
    source="{Application.application.parameters.api}/rest/entity/{data.Slug}/Image"
    />
    Note the curly brackets
    HTH
    Pat

  • Help creating a path using variables.

    HI
    I;m trying to create a path to a movievclip created with
    attachMovie. I need tio create the path using variable:
    _root.var1.var2.gotoAndPlay("something");
    How can I tell flash that var1, var2, etc are variables and
    not a relative path?
    Tks,

    Hello Tks,
    depending where the movieclip is that you are trying
    communicate with you need to use either other movieclips or you
    will need to use _parent.
    var gong:MovieClip;
    var bong:MovieClip;
    var song:MovieClip;
    this.attachMovie("gong".....
    gong.attachMovie("bong"....
    bong.attachMovie("song"...
    to access song from the timeline in which all these movie
    clips were attached
    this.gong.bong.song.variable
    from song to the timeline in which all movie clips were
    attached
    song._parent._parent._parent.variable
    Hope this helps..
    moozungu

  • The selected objects cannot be joined as they are invalid objects,( Compound paths, closed paths, Text Objects, Graphs, Live Paint group). You can use Join command to connect two or more paths, paths in groups; ot to close an open path.

    Hi I was trying to join two Ractangle Tool objects but getting this type of Error in illustrator cs6 :-
    The selected objects cannot be joined as they are invalid objects,( Compound paths, closed paths, Text Objects, Graphs, Live Paint group).
    You can use Join command to connect two or more paths, paths in groups; ot to close an open path.
    Please assist me asap.

    Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?
    This sound like a firewall issue. I would start by disabling the firewall and seeing if you can connect. If this works then you know where the problem is,
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How can I use variable for a package filename and target file inODIFileMove

    I want to use a variable for paths so that when I migrate from Dev to QA to Prod I don't have to do a lot of editing.
    Specifically, I want a variable to be the first part of the path for the filename (\\sundev1\fnd1-hypd1) and join this with the rest (\update\log\*.log or specific filename) using several different objects like the ODIFileMove, ODI OS Command, OS Command, etc.
    Thank you!

    Hi,
    you could set up a database table holding processing parameters (i.e. Column1 - ParamName, Column2 - ParamValue).
    One row could then be ParamName = FilePath, ParamValue = \\<server>\folder\
    So, the refreshing query (attached to a logical schema) would be something like SELECT ParamValue FROM <your table> WHERE ParamName ='FilePath'
    Then, create a variable which can refresh from the database and in the package, drop the variable onto the flow and set it's type to 'Refresh Variable' in the properties.
    Hope this helps.
    geeo

  • How to use independent replacement paths for same KF over several months?

    Dear Experts,
    I have a query requirement to show KF values for items that meet a condition on another KF for a five month period.  I know that I can accomplish this using a replacement path variable on item for one month at a time, however I am not sure how to do this for multiple months in one query.
    This is an example:
    Month 1
    KF 1 > 0 for Items A & B.........so show KF 2 for for Items A & B
    Month 2
    KF 1 > 0 for Items B & C.........so show KF 2 for for Items B & C
    Month 3
    KF 1 > 0 for Items A & C.........so show KF 2 for for Items A & C
    Thanks in advance for your help!
    Kathryn

    Ok, Nancy, code copy/ paste did work fine.
    what does this mean:
    "Change the image in the properties panel to display your new image."
    (the image is displaying ok)
    NEverthesless, I think I got Murrays old notes.
    Here is my new version of Murrays writing, easiest way I think:
    You open up a pre-existing html, say Chicago. Then drag over with pointer to the new jpeg you want (Buffalo). It replaces Chicago with the buffalo jpeg, all links work perfectly. Then do a save as called Buffalo.

  • Exception color with formula variable(replacement path)

    Hello,
    I tried to define exceptions in a query which "from" and "to" values
    are determined by formula variables with replacement path. I checked
    the values of the formula variables and they are right. <b>But <b>the cells
    are not colored</b></b>. When I set the same values in the field "from" and "to" without variables : the colors appear.
    Could help me to resolve this problem please ?
    Catherine Bellec

    Hi Alec,
    You are right, the user exit permits to color the lines.
    But the value of my variable needs to change for each line of the infocube so I can't do this with the user exit RSR00001 because it concerns global variables.
    That's why I used a replacement path on a virtual characteristic.

  • How can I use a progress bar in objective c mac

    How can I use a progress bar in objective c mac? I have a code that downloads a file and I want to be able to let the progress bar increase by 1. A bit further on the code (to download the file) it needs to increase again. And so on...
    My code
    -(IBAction) downloadButtonPressed:(id)sender;{
        //get the path to the image that we're going to download
        NSURL *url = [NSURL URLWithString:@"https://www.dropbox.com/s/l6o07m48npxknt4/Cluedo.zip?dl=1"];
        //get the path to documents folder where we're going to save our image
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *DocumentsDirectory = [paths objectAtIndex:0];
        NSString *filePath = [DocumentsDirectory stringByAppendingPathComponent:@"Cluedo.zip"];
        //Download the file to memory
        NSData *data = [NSData dataWithContentsOfURL:url];
        NSError *error = nil;
        //Save it on the Documents directory
        [data writeToFile:filePath options:NSDataWritingAtomic error:&error];
        NSFileManager* fm = [NSFileManager defaultManager];
        NSString* zipPath = filePath;
        NSString* targetFolder = @"/Applications"; //this it the parent folder
        //where your zip's content
        //goes to (must exist)
        //create a new empty folder (unzipping will fail if any
        //of the payload files already exist at the target location)
        [fm createDirectoryAtPath:targetFolder withIntermediateDirectories:NO
                       attributes:nil error:NULL];
        //now create a unzip-task
        NSArray *arguments = [NSArray arrayWithObject:zipPath];
        NSTask *unzipTask = [[NSTask alloc] init];
        [unzipTask setLaunchPath:@"/usr/bin/unzip"];
        [unzipTask setCurrentDirectoryPath:targetFolder];
        [unzipTask setArguments:arguments];
        [unzipTask launch];
        //[unzipTask waitUntilExit]; //remove this to start the task concurrently

    Your code really isn't suitable for a progress bar, not a real one anyway. Your code will spend about 99.9% of its time in the method "dataWithContentsOfURL:url". That is not a method you want to use in the real world. It is only for demos or proof of concept exercises. All network operations should be asynchronous. That gives you the ability to gracefully recover when there is a failure and also to do fancy things like display a progress bar and tell the user when the download is complete.
    Once you get the asynchronous download logic working, then you can worry about the progress bar. The first thing you will need is the size of the file. Without that, all you can ever do is an indeterminate progress bar or spinner. If you have the size of the file, then you can keep track of how much of the file you have downloaded and update your progress bar with the percentage complete. Make sure to throttle it to no more than incrementing by 1% at a time. Otherwise, a large file or a file transferred in many small chunks, would waste too much time updating the progress bar for no change.

  • Using variable of one  class in another class

    what are the different ways in which we can access a variable defined in one class in some other class ,i am aware of making object of that class and using variable ,inheritance polymorphisms,is there any other way

    learnerpuneet wrote:
    i don't want to use objects of the respective class to access methods and variablesSo you've given up on OO already?
    Well okay, then declare everything static and you can use class names to access methods and variables.

Maybe you are looking for

  • Machine no longer boots off cd

    Just upgraded to 10.6.8 and can't boot off dvd anymore holding down "c". Is there something wrong with Superdrive, or iMac? Thanks,

  • Function Module to update Characteristic Value (AUSP table entry)

    Looking for a function module/BAPI to update a characteristic value (AUSP table entry). This is for a material master Material classification value, not a Variant Config value that I need to update. Anybody have one?  I have one that will find the va

  • Brother printer app for macbook air

    For some reason i can get the app for my printer (brother) on the app store on my iphone but not on my macbooks app store

  • Nvidia only or Integrated/Nvidia combo?

    I am setting up a new computer and came across an interesting topic on another site - I like to run a 2-up computer display with PrP, Project, Effects, Media Browser and drop down menus etc on left and Source, Program, Timeline on right. My broadcast

  • How to name commands (SQL codes)

    Hi Guys, I use sql queries in crystal. They are inserted in commands (database expert --add command). But I dont know hoe to name these so they are meaningful data sets? System always provide me with names command_1 command_2 etc but these are meanin