Variables in a function

I want to enhance a script I found as a tutorial on
http://www.lukamaras.com/tutorials/actionscript/load-jpg/loading-external-jpg-image.html
essentially, it's comprised of two parts. The first part
which can hopefully remain the same is
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
The second part consists of code specifying the button and
the action assigning the picture to be loaded
_root.menuclip.imgbtn1.onRelease = function() {
infoField._visible = true;
startLoading("picture1.jpg");
_root.menuclip.imgbtn2.onRelease = function() {
infoField._visible = true;
startLoading("picture2.jpg");
_root.menuclip.imgbtn3.onRelease = function() {
infoField._visible = true;
startLoading("picture3.jpg");
While I really love this tutorial, the flash file I am
working with has a minimum of 150 buttons to it, each loading its
own picture.
Technically, I could copy and paste the code 150 times I was
wondering if there was an alternate solution saving on code using
variables. Something like:
_root.menuclip.VARbuttonname.onRelease = function() {
infoField._visible = true;
startLoading(VARpicturename);
and just have each button assigned to set the VARbuttonname
and VARpicturename onRollover.
I have made attempts at it but I am very new to
actionscripting and still trying to get the syntax down.
Can anyone help me acheive this by this method or any other
alternative?
Please let me know
Thanks
Dustin

Hi
Sorry I wasn't at the office yesterday. So here it is.
In your code all was great. Just one thing. You forgot to
call the function. The code was there at the right place, but just
need to call it to execute. You can download the new .fla at this
adresse:
http://www.crimulti.com/picturesTest.zip
I have 2 things about the .fla. Nothing verry important, but
just great way to work.
1- Always keep the script layer at the top of the other
layers. The reason is simple. When Flash compile documents, you can
set the it to compile layers from the bottom to the top or from the
top to the buttom. By default, the value is bottom to top. I
explain it just for one reason. A script that execute before the
object (MC) exist, will not affect your object. In your case, the
function would execute, and after your button would appear. So the
function would not affect your MC.
2- If you have a script on the root that needs to affect
content inside an MC (that is your case), call the script on the
second frame. Don't forget to put a stop also. The reason, again,
is simple. When Flash compile if all your movie is on one frame, it
compress all layer, your code execute after the clip exist, cause
the script layer is on the top, right, but the content of the clip
may not all still exist. So if you call the function on the second
frame. All the layers at the first frame are compiled, it means
that all including Clip Content exist. Son when the code execute on
the second frame, you are shure that it will affect all inside your
MC. This is not really important with small content. But when you
have many Mc inside Mc and so on... This is a good way to work.
All that is done in the new FLA
Have a good day.

Similar Messages

  • Unable to use variables of a function module in am enhancement spot

    Hi All,
    I have created an implicit code enhancement spot at the end of a function module. In this enhancement I am unable to access the local variables and the import/export variables of the function module. Is this the expected behavior or I am doing something wrong.
    Thansk & Regards,
    Saurabh

    Hi Saurabh,
    Can you explain your scenario in detail with tcode and function module and all.
    Regards,
    kamalapriya

  • Substitution variable in the functions

    Can we call substitution variable in the functions in essbase calc scripts
    for example fix (@IRSIBLINGS(&mois_en_cours_reprev));

    Sould be just fine. Does it validate? If not, make sure the variable is spelled correctly in EAS (always start with the easy solution first :) ).

  • How can I transfer a variable to regexp_replace function

    Hi,
    In addition to my question from yesterday, I went up one (little) level for the next question.
    How can I transfer a variable to regexp_replace function?
    I am getting the value of the variables from from APEX Items.
    The value of item :P105_OLD_NAME should be replaced with the value from :P105_NAME APEX item.
    The projects in PROJECT_NAME field are separated by “:”
    select * from infoux_proj;
    HOSTNAME PROJECT_NAME
    host1 proj2:proj1
    host3 proj1
    host4 proj12:proj1
    host5 proj3
    host2 proj1:proj3:sunproj1
    this is my code:
    declare
    v_old_proj_list varchar(100);
    v_new_proj_list varchar(100);
    begin
    for host in (select a.hostname, project_name
    from infoux_proj a,
    (select hostname
    from PROJECT_NAMES_WITH_HOSTNAMES
    where name = :P105_OLD_NAME ) b
    where a.HOSTNAME=b.hostname)
    loop
    select project_name ,
    regexp_replace(project_name,'(^|:)(:P105_OLD_NAME)(:|$)','\1:P105_NAME \3') new_project
    into v_old_proj_list, v_new_proj_list
    from infoux_proj
    where hostname=host.hostname;
    update infoux_proj
    set project_name=v_new_proj_list
    where hostname=host.hostname;
    end loop;
    end;
    Thanks,
    Sheli

    Hi, Sheli
    Inside quotes, :p105_old_name will not be taken as a variable name. If you want to use the value of :p105_old_name in a string which its otherwise a literal, then you can concatenate the variable to the literal parts, using the || operator.
    You can do soemthing like this:
    REGEXP_REPLACE ( project_name
                , '(^|:)(' || :P105_OLD_NAME
                             || ')(:|$)'
                , '\1'       || :P105_NAME
                             || ' \3'
                )               AS new_projectI'll bet there's a much simpler way to do what you want. Instead of having two SELECTs, a cursor FOR loop and an UPDATE, you can probably do what you need to with just a single UPDATE or MERGE. It would be more efficient, too. If you'd like help, post CREATE TABLE and INSERT statements for all relevant tables and columns azs the exist before this code is run, a couple of sets of values for the bind variables, and the results you'd like to see (that is, the contents of the changed table) for each set, given the same sample data.
    Always say which version of Oracle you're using.

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • Using a global variable within a function

    Hi all,
    I'm trying to learn how to use global variables, but can't quite get it right:
    Im trying to use two buttons, named UpButton and DownButton to control one global variable, p1
    A text field, named "Value" displays p1.
    Here's my code:
    p1 = 0;
    ButtonClick("UpButton", p1, 100,"Value");
    ButtonClick("DownButton", p1,(-100),"Value");
    function ButtonClick(ButtonName,Var,Increment,TextToChange){
                        sym.$(ButtonName).click(function(){
                        Var = Var + Increment;
                        sym.$(TextToChange).html(Var);
    However, it seems to be treating p1 as two different variables.
    Here's a link to the page to show you what I mean, apologies but this link wont work in google chrome because I'm using dropbox as a server temporarily
    In other browsers you may need to click "Show all content" or similar to any security warnings...
    https://dl.dropboxusercontent.com/u/83693404/ButtonTest/buttons.html
    Here are the project files:
    https://app.box.com/s/0shocivto8fl295h62uq
    Any help greatly appreciated, sorry if this is a stupid question,
    Katherine

    Hi Katherine,
    However, it seems to be treating p1 as two different variables.
    Indeed, your code created two different variables in two different scopes (I guess it as to do with JavaScript closures, but do  not ask me more, I am still a bit foggy about that idiosyncrasy ).
    In JavaScript, a primitive parameter – this is the case here with p1, a Number value –, is passed by value. In other words, a copy of the value is made. Your code handles two copies of the value stored in p1.
    This contrasts with an object parameter, which is passed by reference (address in memory), without copy. Your code would work if Numbers were passed by reference : the two Var (p1) would then point to the same address.
    The intent behind your trial is a global variable.
    1) Let us be as simple as possible :
    Stage : document.compositionReady event handler
    p1 = 0;
    buttonClick = function( Increment)
      p1 += Increment;
      sym.$( "Value").html( p1);
    Stage : DownButton.click event handler
    buttonClick(-100);
    Stage : UpButton.click event handler
    buttonClick(100);
    Without being preceded by the var keyword the variables are global.
    So the Number variable p1 can be accessed inside function buttonClick.
    And the Function variable buttonClick as well, is accessible inside click event handlers, everything (function definition +function calls) being inside the same symbol (Stage).
    2) Now, suppose this is no longer the case : you want to access a variable from another symbol.
    We create a new GraySquare symbol, instantiated both in the DownButton symbol (instance name DownSquare) and in the UpButton symbol (instance name DownSquare).
    Stage : document.compositionReady event handler
    p1 = 0;
    sym.buttonClick = function( Increment)
      p1 += Increment;
      sym.$( "Value").html( p1);
    The sym. prefix is now necessary to make the variable (here a Function, but you would proceed exactly the same with a String, Number or Boolean) accessible in other symbols.
    DownButton symbol : DownSquare.click event handler
    sym.getComposition().getStage().buttonClick( -100);
    UpButton symbol : UpSquare.click event handler
    sym.getComposition().getStage().buttonClick( 100);
    From these other symbols, the sym.getComposition().getStage(). prefix is necessary to acces to our global variable (function).
    The two examples are downloadable here : https://app.box.com/s/6vkyiqk7i8zwlw0j1wk1
    Gil

  • Can't use bind variable in a function

    This is a repost from my earlier post at
    URGENT: Problem creating the report using Procedure
    The problem is when I bind a variable in a function, I get REP-0002. Please look at the following steps to reproduce
    ===
    set serveroutput on
    create or replace
    package Q_REP_test
    as
    type drec is record
    sdate date
    type dreccursor is ref cursor return drec;
    Procedure Get_sysdate(retdate out dreccursor);
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor);
    end q_rep_test;
    show errors
    create or replace
    package body q_rep_Test
    as
    procedure Get_sysdate(retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate retdate from dual;
    end;
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate+no_of_days retdate from dual;
    end;
    end q_rep_test;
    show errors
    ===
    Invoke the SP as follows:
    ===
    function QR_1RefCurDS return q_rep_test.dreccursor is
    tempc q_rep_test.dreccursor ;
    begin
    q_rep_test.add_days_tocurdate(:p_1,tempc);
    return tempc;
    end;
    ===
    1. Create a report
    2. create an user parameter(p_1)
    3. add a pl/sql as above
    4. run it(to verify the report works)
    5. save it.
    6. close the report
    7. Open it again, you get an as
    "REP-0002: Unable to retrieve a string from the Report Builder Message file". Now it is corrupted and can't be used at all.
    Please treat this as urgent and help me.
    Thanks

    Hi ,
    Though you have stated it as Oracle92iDS check whether it has the 9.0.2.2 patchset applied. If not please try applying the latest Patchset 9.0.2.2 for Oracle9i Reports.
    To download the patch goto Metalink &lt;http://metalink.oracle.com/metalink/plsql/ml2_gui.startup&gt; and search for Patch# 2842923.
    This Patchset is for iAS and iDS.
    In either case, please let me know the results.
    Thanks,
    Vinod.

  • How to find Unused variables in procedure,function or package

    Hi all,
    I want find out unused variables in procedure, function and package.
    I have written below script for doing this ,but i am not getting the expected result.
    Kindly help me to improve the below code ,so that it works as expected.
    {code}
    version details
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE    11.2.0.3.0    Production"
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    {code}
    {code}
    What i Have tried is This.
    DECLARE
      V_OBJECT_NAME VARCHAR2(30) :='PR_PRINT';
      V_OBJECT_TYPE VARCHAR2(30) :='PROCEDURE';
      CURSOR C1(CP_OBJECT_NAME VARCHAR2,CP_OBJECT_TYPE VARCHAR2)
      IS
        SELECT US.NAME,
          US.TYPE,
          US.LINE,
          REGEXP_SUBSTR(US.TEXT,'.* ') AS var_name
        FROM user_source US
        WHERE name=CP_OBJECT_NAME
        AND type  =CP_OBJECT_TYPE
        AND REGEXP_LIKE (TEXT,'(v_|g_|c_)','i')
        AND REGEXP_LIKE (TEXT,'^[^ ]')
        AND REGEXP_LIKE (TEXT,'^[^--]') ;
      v_count NUMBER ;
    BEGIN
      FOR i IN C1(V_OBJECT_NAME,V_OBJECT_TYPE)
      LOOP
        SELECT COUNT( *)
        INTO V_COUNT
        FROM USER_SOURCE US
        WHERE US.NAME=I.NAME
        AND REGEXP_LIKE(US.TEXT,i.var_name,'i' )
        AND US.LINE<>I.LINE;
        IF V_COUNT  =0 THEN
          DBMS_OUTPUT.PUT_LINE('variable '||I.VAR_NAME||'Is declared at line#'||I.LINE||' But no where used');
        END IF ;
      END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('p_err_code := '||SQLCODE||dbms_utility.format_Error_backtrace());
      DBMS_OUTPUT.PUT_LINE('p_err_msg := '||sqlerrm);
    END ;
    {code}
    Thanks,
    P Prakash

    Hello,
    as suggested by padders you can use PL/Scope, an example:
    ALTER SESSION SET PLSCOPE_SETTINGS='IDENTIFIERS:ALL';
    CREATE OR REPLACE PACKAGE ui_test1 AS
        global_number   NUMBER := 9;
    FUNCTION get_number
        RETURN NUMBER;
    END ui_test1;
    CREATE OR REPLACE PACKAGE BODY ui_test1 AS
    PROCEDURE setNull
         p_varchar          IN OUT VARCHAR2
    IS
    BEGIN
        p_varchar := NVL(p_varchar,'NULL');
    END setNull;
    FUNCTION get_number
        RETURN NUMBER
    IS
        FUNCTION setZero
             p_number       IN NUMBER
            RETURN NUMBER
        IS
        BEGIN
            RETURN NVL(p_number,0);
        END setZero;
    BEGIN
        RETURN global_number;
    END get_number;
    END ui_test1;
    SELECT  DISTINCT
            object_name
           ,object_type
           ,name
           ,type
           ,line
           ,col
    FROM    all_identifiers obj
    WHERE   obj.owner = USER
    AND     obj.usage = 'DECLARATION'
    AND     obj.object_name = 'UI_TEST1'
    AND     NOT EXISTS (
                SELECT  1
                FROM    all_identifiers with_rh
                WHERE   obj.signature = with_rh.signature
                AND     with_rh.usage IN ('REFERENCE','CALL','ASSIGNMENT')
    ORDER BY TYPE
            ,object_name
            ,object_type
            ,name;
    OBJECT_NAME  OBJECT_TYPE   NAME       TYPE       LINE COL
    UI_TEST1     PACKAGE       GET_NUMBER FUNCTION     11  10
    UI_TEST1     PACKAGE BODY  SETZERO    FUNCTION     35  14
    UI_TEST1     PACKAGE       UI_TEST1   PACKAGE       1   9
    UI_TEST1     PACKAGE BODY  SETNULL    PROCEDURE    12  11
    Regards
    Marcus

  • HOWTO: Declare a variable within a function.

    I'm having a hard time declaring a variable within a function. This is my code:
    CREATE OR REPLACE FUNCTION schemaName.functionName (inParam VARCHAR2(20))
    RETURN VARCHAR2 IS VARCHAR2(10)
    BEGIN
    DECLARE paramLength NUMBER; --This is not working. The docs do not state what the size of the number returned by LENGTH is.
    SELECT LENGTH(inParam) INTO paramLength FROM DUAL;
    IF paramLength < 10 THEN
    RETURN '';
    ELSE
    /* Clean up the value */
    RETURN inParam
    END IF;
    END;

    In relation to your own code...
    CREATE OR REPLACE FUNCTION schemaName.functionName (inParam VARCHAR2(20)) RETURN VARCHAR2 IS
    paramLength NUMBER;
    BEGIN
      /* Clean up the value */
      paramLength = LENGTH(inParam);
      IF paramLength < 10 THEN
        RETURN NULL;
      ELSE
        RETURN inParam
      END IF;
    END; You don't need to use SQL to determine the length of a string.

  • Losing variable values between functions...

    hi!
    I'm trying to do something simple in actionscript as simple as this:
    - Create a variable: var urlVideo:String;
    - Use that variable inside a function and give it a value: urlVideo = videoElemento.url.text();
    - Then create a new variable and give it the urlVideo value: var url:String = urlVideo;
    My problem is that urlVideo loses it's value
    Why is that happening?
    Here's my code:
    var idVideo:String = "12";
    var urlVideo:String;
    var xmlPath:String = "videos.xml";
    var xml:XML;
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(e:Event):void
    if ((e.target as URLLoader) != null )
    xml = new XML(e.target.data);
    xml.ignoreWhitespace = true;
    getVideo(xml);
    function getVideo(videosInput:XML):void
    var listaVideos:XMLList = videosInput.Video;
    for each (var videoElemento:XML in listaVideos)
    if(videoElemento.id.text() == idVideo)
    urlVideo = videoElemento.url.text();
    trace(urlVideo); //has a value
    break;
    var url:String = urlVideo; //the urlVideo values is null !!
    What am i doing wrong?
    Can anyone help me?

    The above post is correct providing the way you displayed the code in your original post is the same way you have it in your program
    function getVideo(videosInput:XML):void
    var listaVideos:XMLList = videosInput.Video;
    for each (var videoElemento:XML in listaVideos)
    if(videoElemento.id.text() == idVideo)
    urlVideo = videoElemento.url.text();
    trace(urlVideo); //has a value
    break;
    var url:String = urlVideo;  this line occurs outside the function which means that until getVideo is called urlVideo will always be null because its never set until getVideo actualy gives it a value.
    zeroskillz method will set the url to play right inside the function which is a good way to organize.. keep behaviors together.
    now if you placed url= urlvideo before the end of the function you would have seen a trace like thus:
    function getVideo(videosInput:XML):void
    var listaVideos:XMLList = videosInput.Video;
    for each (var videoElemento:XML in listaVideos)
    if(videoElemento.id.text() == idVideo)
    urlVideo = videoElemento.url.text();
    trace(urlVideo); //has a value
    break;
    var url:String = urlVideo  //has value

  • Can a Variable represent a Function?

    Is there a way I can assign this code
    "SimpleButton(event.target).mouseEnabled = false;" to a variable so
    I can disable all the buttons where n=1?
    Something like this (sorry, I'm not sure of the proper syntax
    which may be my problem):
    var n:Number = 0;
    if (n = 1)
    SimpleButton(event.target).mouseEnabled = false;
    else
    SimpleButton(event.target).mouseEnabled = true;
    OR
    Maybe a variable inside the function to represent the True or
    False?
    where n = 0 = True
    and n = 1 = False
    SimpleButton(event.target).mouseEnabled = ('n' instead of
    true or false);
    I have 10 buttons on the page and when one activates a movie
    I want all the buttons to be deactivated except the "close" button
    and I thought using a variable like "n" would allow me to do this.
    Currently with the above code I get "Access of undefined
    property event" error where this line of code is located.
    ks

    Very Sorry, but I can't make anything out from your code or
    how I'm suppose to use it. I've only been using CS3 for 4 weeks and
    it just doesn't make sense and nothing in my books or the searches
    or Flash Help explains it so I can understand it.
    var tl:MovieClip = this; (what is going on with this
    variable? It looks like its turning a button click target into a
    movie..?)
    var buttonNum:int = xxx; // <--define this (is this the
    total # of buttons I'm using? I'm guessing it is)
    (the below increments my coin buttons to their instance names
    of coin1, coin2, etc. but how does it relate to tl[coin"+i]?)
    for(var i:int=0;i<=buttonNum;i++){
    tl["coin"+i].addEventListener(MouseEvent.CLICK,f);
    ( is the below where I want to insert the code to disable the
    buttons like this code? SimpleButton(event.target).mouseEnabled =
    false;)
    (also, should it be event:MouseEvent not e:MouseEvent?)
    function f(e:MouseEvent){
    // now you can do whatever with your buttons
    // e.currentTarget is the clicked button
    Sorry for the head aches but thanks for the help you have
    given me so far!!
    Regards
    kevin

  • Using value variables throw public functions

    He all!!
    I'm trying to use value variables throw public functions in
    the same class.
    Is there any possible to do it?
    I'll explain:
    What i whant is in tha FLA file to get the songName of the
    mp3 like trace(musica.nomeMusica);
    quote:
    //AS Code
    package Mp3Player{
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundChannel;
    import flash.media.ID3Info;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class Mp3Player {
    private var sound:Sound;
    private var req:URLRequest;
    private var context:SoundLoaderContext;
    private var channel:SoundChannel;
    private var id3:ID3Info;
    private var nomeMusica:String;
    public function tocarMusica(file) {
    sound=new Sound ;
    req=new URLRequest(file);
    context=new SoundLoaderContext(8000,true);
    sound.load(req,context);
    channel=sound.play();
    trace("A tocar");
    sound.addEventListener(Event.ID3,id3Info);
    public function id3Info(event:Event):void {
    id3=event.target.id3;
    nomeMusica=id3.songName;
    public function get getNome():String {
    return nomeMusica;
    //FLA Code
    import Mp3Player.Mp3Player;
    var musica:Mp3Player = new Mp3Player();
    var nome:String = musica.getNome;
    musica.tocarMusica("Saia_Indiscreta.mp3");
    trace(nome);
    The trace of my code is:
    quote:
    A tocar
    Null
    What i'm doing wrong or is missing?

    Tnks all for the reply but none of them give me any answer :(
    Making the question in other way.
    Using the code above, how can i set a funcion to call the
    musicaNome value from FLA file?
    quote:
    //AS Code
    package Mp3Player{
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundChannel;
    import flash.media.ID3Info;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class Mp3Player {
    private var sound:Sound;
    private var req:URLRequest;
    private var context:SoundLoaderContext;
    private var channel:SoundChannel;
    private var id3:ID3Info;
    private var nomeMusica:String;
    public function tocarMusica(file) {
    sound=new Sound ;
    req=new URLRequest(file);
    context=new SoundLoaderContext(8000,true);
    sound.load(req,context);
    channel=sound.play();
    trace("A tocar");
    sound.addEventListener(Event.ID3,id3Info);
    public function id3Info(event:Event):void {
    id3=event.target.id3;
    nomeMusica=id3.songName;

  • How to modify global variable in a function?

    Hello,
    I want to modify a globalvariable in a function, at first I did it this way:
    class Global_output_class
    GlobalDim("Correlation_Status,fail_part,End_Exp")
    dim pouet
    Correlation_Status = 12
    Call Correlation()
    pouet = Correlation_Status
    Function Correlation()
    Dim Global_output_class_sub
    Set Global_output_class_sub = new Global_output_class
    Correlation_Status = 1
    fail_part = 2
    End_Exp = 3
    Global_output_class_sub.CorrelationStatus = Correlation_Status
    Global_output_class_sub.failpart = fail_part
    Global_output_class_sub.EndExp = End_Exp
    set Correlation = Global_output_class_sub
    End function
    In this case: correlation_status receive the value 12, then I go to my function correlationn() where it became 1
    Then it goes out of the subfunction and takes the previous value from the program(12) ( I dont want that)
    To solve the problem I made it this way:
    class Global_output_class
    public CorrelationStatus
    public failpart
    public EndExp
    end class
    GlobalDim("Correlation_Status,fail_part,End_Exp")
    Correlation_Status = 12
    Set Global_Output = Correlation()
    Correlation_Status = Global_Output.CorrelationStatus
    fail_part = Global_Output.failpart
    End_Exp = Global_Output.EndExp
    pouet = Correlation_Status
    Function Correlation()
    Dim Global_output_class_sub
    Set Global_output_class_sub = new Global_output_class
    Correlation_Status = 1
    fail_part = 2
    End_Exp = 3
    Global_output_class_sub.CorrelationStatus = Correlation_Status
    Global_output_class_sub.failpart = fail_part
    Global_output_class_sub.EndExp = End_Exp
    set Correlation = Global_output_class_sub
    End function
    This way my global value are recopied in themselves after leaving the subprogram
    I got a lot of variables, is there any easier way so the global variable modified in a function keep the value after leaving the function?
    Thanks for help,
    Fred
    Solved!
    Go to Solution.

    Hi Fred,
    it is possible to use a global defined variable but the better way is to use to use a funtion call (or procedure call) with parameters. Please find first the good solution for a funcion call with parameter and the sub-optimal way with an global valiable:
    dim oParameter
    set oParameter = new cGlobal_output_class
    oParameter.Correlation_Status = 12
    msgbox "Correlation_Status before Call Correlation: " & oParameter.Correlation_Status
    Call Correlation(oParameter)
    msgbox "Correlation_Status after Call Correlation: " & oParameter.Correlation_Status
    Function Correlation(oPara)
    msgbox "Correlation_Status in the FUNCTION before change: " & oPara.Correlation_Status
    oPara.Correlation_Status = 1
    oPara.fail_part = 2
    oPara.End_Exp = 3
    msgbox "Correlation_Status in the FUNCTION after change: " & oPara.Correlation_Status
    End function
    class cGlobal_output_class
    dim Correlation_Status,fail_part,End_Exp
    end class
    call GlobalDim("oPouet")
    dim oPouet
    set oPouet = new cGlobal_output_class
    oPouet.Correlation_Status = 12
    msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
    Call Correlation()
    msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
    Function Correlation()
    msgbox "Correlation_Status in the FUNCTION before change: " & oPouet.Correlation_Status
    oPouet.Correlation_Status = 1
    oPouet.fail_part = 2
    oPouet.End_Exp = 3
    msgbox "Correlation_Status in the FUNCTION after change: " & oPouet.Correlation_Status
    End function
    class cGlobal_output_class
    dim Correlation_Status,fail_part,End_Exp
    end class
    Greetings
    Walter

  • How to pass javascript variable to jsp function

    i want to check which table header (that is <th> in html )is clicked and based on that a jsp funtion do a query in database and should show records in sorted way according to which column head is clicked.
    Table is created in html.
    My function is
    Vector varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    <table border="1">
              <th ><label onClick="<%SelectedColumn="workcase_id";%>">Workcase Id</label></th>
              <th><label onClick="<%SelectedColumn="status_id";%>">Status</label></th>
    <tr><td>etc</td></tr>
    </table>

    im using bean for business login, following mvc model,and i think mvc is one of good design practice to use.
    <jsp:useBean id="workcaseid" scope="session"class="beanFiles.SearchWorkcaseId" />
    varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
    just tell me whether it is possible to pass javascript variable to jsp variable or not.i can do it by using hidden input type,using form and submit button.

  • [Oracle 8i] Need help with bind variable in add_months function

    I'm trying to put a variable within my add_months function:
    AND     t1.edatetime >= add_months(sysdate,:v1)
    AND     t1.edatetime <= add_months(sysdate,:v2)I have tried defining the variable both as 'integer' type and 'numeric' type, but in both cases, my query returns no results. If I hard code the values, it works just fine.
    Any suggestions?

    Hi,
    Sorry, I can't reproduce the problem.
    What do you mean by "I have tried defining the variable both as 'integer' type and 'numeric' type"?
    Like Max said, you should post a complete script that gets the incorrect results.
    Include your CREATE TABLE and INSERT statements, or use tables that are commonly available.
    For example:
    VARIABLE      v1     NUMBER
    VARIABLE      v2     NUMBER
    EXEC  :v1 := -28 * 12;
    EXEC  :v2 := -27 * 12;
    PROMPT       ===== Checking values of bind variables  =====
    SELECT       :v1
    ,       :v2
    FROM       dual;
    PROMPT       =====  Main query (expecting 1 row of output) =====
    SELECT       ename
    ,       hiredate
    FROM       scott.emp
    WHERE       hiredate     >= ADD_MONTHS (SYSDATE, :v1)
    AND       hiredate     <= ADD_MONTHS (SYSDATE, :v2)
    ;Output:
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    ===== Checking values of bind variables  =====
           :V1        :V2
          -336       -324
    =====  Main query (expecting 1 row of output) =====
    ENAME      HIREDATE
    MILLER     23-Jan-1982

  • Need help with passing a variable in a function

    Hello. I am working on a Flash app that needs to play videos. I have code using netstream that works great for one movie. The problem is I have 3 movies I want to play and I need to figure out how to replace the string variable with the correct path info depending on what button is pushed. I'm thinking this needs to be an array which I have coded but it is not working. Here is the code:
    var buttonArray:Array = [chamber.btnV01,chamber.btnV02];
    var strSource:Array = ["HiFlow_Conventional_4.mp4","Tool_Less_5.mp4"];
    trace (buttonArray)
    for (var i:int = 0; i < buttonArray.length; i++) {
    buttonArray[i].addEventListener(MouseEvent.CLICK, playClicked);
    function playClicked(e:MouseEvent):void {
    // check's, if the flv has already begun
    // to download. if so, resume playback, else
    // load the file
    if(!bolLoaded) {
    var clickedIndex:int = buttonArray.indexOf(event.currentTarget);
    nsStream.play(strSource[clickedIndex]);
    bolLoaded = true;
    trace (strSource)
    else{
    nsStream.resume();
    This is just set for two buttons for testing. I keep getting the "1120: Access of undefined property event." right at the "nsStream.play(strSource[clickedIndex]);" line. The variable strSource is what I am trying to pass different movie paths into, but I am having no luck. Am setting this up right or is there another way to do this? Any help would be much appreciated. Thanks.
    -Shawn

    use:
    var buttonArray:Array = [chamber.btnV01,chamber.btnV02];
    var strSource:Array = ["HiFlow_Conventional_4.mp4","Tool_Less_5.mp4"];
    trace (buttonArray)
    for (var i:int = 0; i < buttonArray.length; i++) {
    buttonArray[i].addEventListener(MouseEvent.CLICK, playClicked);
    function playClicked(e:MouseEvent):void {
    // check's, if the flv has already begun
    // to download. if so, resume playback, else
    // load the file
    if(!bolLoaded) {
    var clickedIndex:int = buttonArray.indexOf(e.currentTarget);
    nsStream.play(strSource[clickedIndex]);
    bolLoaded = true;
    trace (strSource)
    else{
    nsStream.resume();

Maybe you are looking for

  • Something's wrong with iPodService...

    After many days trying to get iTunes launched (It Actually did launch but with a delay of...3 minutes!!!)I found out that I needed to start iPodService before and just then iTunes would start. OK now it works, but it's kind of anoying... Could anyone

  • Two ALVs in the same component

    Hello, I need to develop a WDA ALV component with two ALVs, the first one display a list of documents and once the user select one document and press a custom function, it should call another ALV to display a list of all the itens linked to the selec

  • Mac to windows nt

    Hi, Newbie poster. I have a IMac connecting to a windows NT domain. All is well for 5-10 minutes then the NT account (used for drive mappings) is locked out from the NT side - any ideas? Other Mac Pro's accessing a windows 2000 domain have very few p

  • Image box with opacity gradients, and other parallax scrolling inhancements

    First i want to say great job Muse Team, this is starting to get really interesting: I've been playing around with parallax scrolling over gradients for effect,   but i'm dreaming about fading in full screen fields of texture.   without the weight of

  • Library module issues

    I've lost "Catalog and Folders" in the Lightroom 4's Library Module.  How do I get them back??