Restriction with multiple variables for a characteristic present in Row

Hi all,
I am facing a problem when I am restricting a characteristic in the 'defaut value' section of the filter tab.
Details of the problem is given below:
Characteristic is restricted by 3 variables. When I execute the query for the first time there are no problems. I can enter value for all the three varaibles.
But when I want to change the variable value, the variable screen does not list the variables and the system displays the following message.
'variables could not be processed'.
Diagnosis
In the query definition, the default values of characteristic are stored as variables. The system tires to fill these variables again from the last restrictions so that it can use them as default values. In this case, however, the restriction is so complex, that the variable values cannot be reconstructed from it.
System Response
Procedure
Change the restrictions in the query result if necessary.
Kindly help to resolve this issue.
Thanks in advance.
Meera

Hi All,
Even I faced the same issue, and the issue is resolved with above solution.
Now the second time I'm able to see the variable in Analyser, but now the output is not getting refreshed as per the variable entry for the second time.
Thanks,
Gaurav

Similar Messages

  • Execute scenario with multiple variables through ODIInvoke webservice

    I am looking to execute scenario with multiple variables through ODIInvoke webservice but can't seem to get the SOAP request formatted correctly. Here is what I have tried but I get a parsing error.
    <invokeScenarioRequest>
    <invokeScenarioRequest>
    <RepositoryConnection>
    <JdbcDriver>org.hsqldb.jdbcDriver</JdbcDriver>
    <JdbcUrl>jdbc:hsqldb:hsql://localhost</JdbcUrl>
    <JdbcUser>sa</JdbcUser>
    <OdiUser>SUPERVISOR</OdiUser>
    <OdiPassword>SUNOPSIS</OdiPassword>
    <WorkRepository>DEVELOPMENT</WorkRepository>
    </RepositoryConnection>
    <Command>
    <ScenName>I_TEST_WS</ScenName>
    <ScenVersion>001</ScenVersion>
    <Context>DEVELOPMENT</Context>
    <LogLevel>5</LogLevel>
    <SyncMode>1</SyncMode>
    <Variables>
    <Name>SNI.DMN_CD</Name>
    <Value>DTA</Value>
    </Variables>
    <Variables>
    <Name>SNI.ADPT_CD</Name>
    <Value>RAT_CD</Value>
    </Variables>
    </Command>
    <Agent>
    <Host>S119SNIP045166</Host>
    <Port>20910</Port>
    </Agent>
    </invokeScenarioRequest>
    </invokeScenarioRequest>
    Here is the error I am getting
    com.sunopsis.wsinvocation.SnpsWSInvocationException: java.lang.RuntimeException: Unexpected subelement Name
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.RuntimeException: Unexpected subelement Name
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1515)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         ... 8 more
    Caused by:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
    faultSubcode:
    faultString: java.lang.RuntimeException: Unexpected subelement Name
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace:java.lang.RuntimeException: Unexpected subelement Name
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1515)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:595)
         {http://xml.apache.org/axis/}hostname:S119SNIP045166
    java.lang.RuntimeException: Unexpected subelement Name
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1515)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
         at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:1792)
         at com.sunopsis.wsinvocation.client.a.a.d.a(d.java)
         at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
         at com.sunopsis.graphical.wsclient.f.b(f.java)
         at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
         at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
         at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:595)
    If I change it from
    <Variables>
    <Name>SNI.DMN_CD</Name>
    <Value>DTA</Value>
    </Variables>
    <Variables>
    <Name>SNI.ADPT_CD</Name>
    <Value>RAT_CD</Value>
    </Variables>
    to
    <Variables>
    <Name>SNI.DMN_CD</Name>
    <Value>DTA</Value>
    </Variables>
    the session runs. Does anyone know the syntax for multiple variables being passed?
    Thank you,
    Troy

    Hi,
    The xml should be like this
    <variables>
    <name>SNI.DMN_CD</name>
    <value>DTA</value>
    <name>SNI.ADPT_CD</name>
    <value>RAT_CD</value>
    </variables>
    Hope this helpful.
    Regards

  • Create a flat file with multiple characters for enclosures

    Hello,
    we use OWB 11g2 (11.2.02).
    Now we try to create a flat file with multiple characters for enclosures. The manual wrote:
    "Enclosures (Left and Right): Some delimited files contain enclosures that denote text strings within a field. If the file contains enclosures, enter an enclosure character in the text box or select one from the list. The list displays commonenclosures. However, you may enter any character. The default for both the left and right enclosure is the double quotation mark ("). You can specify multiple characters and hexadecimal characters as field enclosures."
    But it will not work. The OWB use the first character from the left enclosure definition as left enclosure and the second one as right enclosure !?!
    Did anyone know this behavior? Is there a solution for this problem?
    Thanks and regards
    Norbert

    HI Raghu,
               Use the function module 'GUI_UPLOAD'.
               In that you have to specify the field_separator value = 'X' in export section.
    Regards,
    S.C.K

  • Creating a range with Substitution Variables for Report Script

    Is it possible to create a range with substituion varables for use in a report script. For example instead of listing "Jan" "Feb" "Mar" "Apr" in the report script can I use a sub varaible like Jan:Apr that will list them all out?

    while I have not had luck with ranges in report scripts, others have. You could have a substitution variable the is "Jun" "Jul " "Aug" or whatever you want the members to be. and it will replace jusr fine

  • Create URL with multiple values for one parameter

    Post Author: cbamberg
    CA Forum: General
    While I have no problems to create the URL to open a report with a single value for a parameter from my Java application, I don't know how to format multiple values for a parameter when I want to pass the "&prompt0=" value. The values I want to pass are numbers, not strings.
    Anyone can help?

    Hi gayatri,
    you need to select both the product id and custname.put a count on the prodid column and write a condition of count>1 and apply it.
    Thanks
    Hari

  • Help with using variable for name of table in PLSQL block...

    I am trying to use a variable for the name of a table but getting errors ...i am sure I am close to the correct form here but something is wrong. I sure would appreciate some help!
    DECLARE
    ln_month Number;
    ln_day Number;
    ln_year Number;
    ls_year VarChar2(4);
    ls_prev_table VarChar2(30);
    ls_cur_table VarChar2(30);
    ln_prev_year Number;
    ls_prev_year VarChar2(4);
    ln_prev_month Number;
    BEGIN
    Select To_Number(To_Char(sysdate, 'MM')) into ln_month from dual;
    Select To_Number(To_Char(sysdate, 'DD')) into ln_day from dual;
    Select To_Number(To_Char(sysdate, 'YYYY')) into ln_year from dual;
    If ln_month = 01 Then
    ls_cur_table := "T_CPRS_FDW_CUR_JAN_ACTUALS";
    ls_prev_table := "T_CPRS_FDW_PREV_DEC_ACTUALS";
    ln_prev_year := ln_year - 1;
    /***above is where I am trying to use variables for assignement to years and months tables***//// ln_prev_month := 12;
    End If;
    /*------MORE IF STATEMENTS FOR EACH MONTH ---OF --THE YEAR ...AND its the following 2 variable statements that the compiler doesnt like! */
    If ln_day < 20 Then
    Delete from :ls_prev_table;
    INSERT INTO :ls_prev_table /*(STUFF TO BE INSERTED GOES HERE)*/
    HELP PLEASE!
    null

    Hi,
    The parser does not under variables directly in dml statements.u need to form a statement and the parse and execute the same...
    so the soln is
    Declare
    lv_stmt varchar2(250);
    Begin
    lv_stmt := 'Delete from '&#0124; &#0124;ls_prev_table;
    execute immediate lv_stmt;
    -- Same is the case with the insert stmt--
    End;
    This should solve ur problem.
    u could also give a direct call like
    execute immediate 'Delete from '&#0124; &#0124;ls_prev_table ;
    Note: This statement "execute immediate" holds good for oracle versions 8.x and above which makes the stmt very simple. For lower version u need to use the dbms_sql package to parse and execute the statement which has a series of statements for the same.
    Kiran

  • Display multiple values for a characteristic for Equipment.

    Hi is there any way to display multiple values for characteristics of an equipment. Ex. An equipment (Presss) produces multiple ROH Parts. The class VN_TOOl with charactersistic "Part Produced" . When I run IH08 and execute the query, >Show , hide classification I can only get just one part instead of multiple parts. How do I get multiple values for the characteristic

    Yes Chandra,
    You are not getting it in IH08, but you are getting it in IE07. See this.
    IH08
    IE07
    If you want the report in the ALV layout, then you need to go for a development using FMs in Classification areas such as:
    'BAPI_OBJCL_GETCLASSES'     'ALM_ME_CLASS_CHAR_GETDETAIL'
    Jogeswara Rao K

  • How can I create a hashmap() with multiple values for the same key?

    I am trying to write an application that will us something like a Map() with multiple values but some have the same key. Is this possible?

    i had the same question. just create a List, add all the values u want to it, and then put the List into the map like u would a normal single value. e.g.
    List list = new ArrayList();
    list.add(value1);
    list.add(value2);
    map.put(key, list);
    i bet u r doing the same course as i am =)

  • Issue with Multiple LTS for a fact table and filters

    Hello,
    I am facing an issue with obiee 10g.
    In my model, I have a huge FACT table F1 (partitioned and indexed). The average response time for the queries, which targeted it, was ~30-60 seconds, which was not really convincing our end user.
    So, we decided to create a materialized view, which removes some dimensions that are not used by default, but might be used if the end user adds some filters. I added the Materialized view in the Physical Layer and in the corresponding Logical Table Source.
    I then tried to see if it works, but I was a bit surprised by the result. Indeed,
    -> If the report does not reference a truncated dimension, it targets the materialized view. -> Perfect
    -> If the report does reference a truncated dimension in the columns, it targets the Fact Table. -> Perfect
    -> If the report does reference a truncated dimension in the Filters, it targets the materialized view. For this reason, the filter is never resolved and no join on the dimension table is applied, whereas it exists in logical SQL generated. -> Ko.
    A suggestion could be to add the filters into the columns, but I am not satisfied by this response because it will never use the materialized view in that case.
    An other suggestion could be to use query rewrite, but I 'd like to have the full control on the generation of the queries.
    Does someone know if the filters are not evaluated to determine which LTS to use? How can I force this evaluation?
    Regards,

    Hi,
    If I understand your description correctly, then your materialized view skips some dimensions (infrequent ones). However, when you reference these skipped dimensions in filters, the queries are hitting the materialized view and failing as these values do not exist. In this case, you could resolve it as follows
    1. Create dimensional hierarchies for all dimensions.
    2. In the fact table's logical sources set the content tabs properly. (Yes, I think this is it).
    When you skipped some dimensions, the grain of the new fact source (the materialized view in this case) is changed. For example:
    Say a fact is available with the keys for Product, Customer, Promotion dimensions. The grain for this is Product * Customer * Promotion
    Say another fact is available with the keys for Product, Customer. The grain for this is Product * Customer (In fact, I would say it is Product * Customer * Promotion Total).
    So in the second case, the grain of the table is changed. So setting appropriate content levels for these sources would automatically switch the sources.
    So, I request you to try these settings and let me know if it works.
    Thank you,
    Dhar

  • Is it possibe to define a badi with multiple filters for single implementation ?

    is it possible to have a badi with multiple filters in one implmentation?

    Hello Siva,
             There is no hierarchical concept in filter values. You can have multiple filter values and at any time you can pass only one filter value while invoking Badi.
    The concept of hierarchy can be implemented by combination of filter and methods.
    1. You can have filter as the first level and have multiple filters.
    2. Then you can define methods in Badi and this now  becomes 2 level.
    Thanks and Regards,
    Veera

  • 2 variables for same characteristic in planning level in BPS

    Hello,
    I would appreciate your help implementing this scenario: a user has access to certain versions and should be a able to copy data between 2 of those versions.
    We have 4 versions on our master data: 001, 002, 003 and 004.
    A certain user should be able to access versions 001, 002 and 003, and should not be able to access version 004.
    So we have an authorization object applied to that user with:
      -> 0TCAACTVT EQ 03
      -> 0TCAIPROV EQ <real time infocube>
      -> 0TCAVALID CP *
      -> 0VERSION EQ 001, 002 and 003
    Then, users should be able to copy data between versions.
    We created 2 variables on planning area, named ZVERSOLD and ZVERSNEW, with these characteristics:
      -> Characteristic: 0VERSION
      -> Replacement Type: USERVALUE User-defined values
      -> Restriction of Values Required by User: enabled
      -> Input Allowed by User: enabled
    So this particular user should only see those 3 versions when pressing F4 when filing both variables.
    After that, we created the planning level with the u201Ccopyu201D planning function.
    But now, on planning level, we need to restrict 0VERSION, but we have a problem because we are not able to restrict it using 2 variables (ZVERSOLD and  ZVERSNEW). Only one.
    If we donu2019t use any variable, user gets an authorization error because he is not able to access to all data due to authorizations.
    Does anyone have a way to avoid this issue? Should authorizations be defined in a different way? Should variables be defined in a different way?
    Hopefully I exposed all required details to get help, and that my question wasnu2019t too much confused.
    Again, thank you very much in advance for your support.
    Rui

    Hello,
    If you restrict the VERSION with variable ZVERSNEW for target version then the function should work. But if you get any error related to reading reference data for the source version then you can create a new variable of type exit and populate it with the values selected by the user in two variables ZVERSOLD and ZVERSNEW using the two APIs :
    API_SEMBPS_VARIABLE_GETDETAIL  - to get the current value of the two Variables
    API_SEMBPS_VARIABLE_SET - to set the Variable Values for the Exit type variable
    Regards,
    Deepti

  • BW 3.5 works with multiple nodes for authorizations

    Hi,
    Does BW 3.5 allow to do authorizations on mutiple nodes? It seems that from the How to wotk with hierarchy authorizations paper, the variable can only allow filtering 1 node. for 2.0B. We have requirements to allow viweing multiple nodes in a hierarchy.
    Thanks
    Will

    Hi Will,
    creat a hierarchy-node variable fill by authorizations in the frontend. The type has to be multiple entries (not single value). In RSSM at the hierarchy authorization creation you have to use the F4 for selecting nodes. The F4 allows to drag more nodes into the right frame.
    Cheers
    Peter

  • Help with multiple variable

    I'm trying to write a query which pulls shipment information
    from an access database. Then it grabs the weight of each shipments
    and multiplies it by the corresponding rate depending on its weight
    class.
    I'm using the CFIF, CFELSEIF and CFSET tags to try to
    accopmlisht this, making it look something like this
    <CFIF "Shipments.weight" LT 500 >
    <cfset Shipments.rate = 7.5 >
    <CFELSEIF "Shipments.weight" GT 499 LT 1000 >
    <cfset Shipments.rate = 7 >
    <CFELSEIF "Shipments.weight" GT 999 LT 2000 >
    <cfset Shipments.rate = 6.5 >
    <CFELSEIF "Shipments.weight" GT 1999 LT 5000 >
    <cfset Shipments.rate = 5 >
    <CFELSEIF "Shipments.weight" GT 4999 >
    <cfset Shipments.rate = 3.65 >
    </CFIF>
    then in the Output tag I use this CFSCRIPT
    <cfscript>
    WriteOutput(#ACC_Report.weight#/100*#Shipments.rate#);
    </cfscript>
    It runs fine but it only seems to grab either the first or
    the second set rate variables and multiplies all the weights in the
    output query by it, inetead of logically choosing its weight class.
    Any help, perhaps I'm using the wrong logic.
    Thanks in advance

    "There's no such thing as "greater-than-ness" on string data"
    Adam, everything you said is basically true and relevant to
    the original
    poster's issue. But this line is wrong is it not? Isn't
    comparing one
    string to another and determining which is greater or lesser
    the essence
    of sorting a set of strings into an alphabetical order?
    Now, I am not sure I can remember the last time I had to
    write my own
    sort routine. But I am pretty sure when I did for sorting
    string data,
    I communally compared one to another to see which was greater
    and|or
    lesser then the other.
    To reiterate in the original post, the person is comparing
    the string
    constants "Shipments.weight" to the numbers do to the
    improper quotes,
    not the value in the Shipments.weight variable.
    Also, if one cares, the logic could be greatly simplified
    with some
    basic boolean logic. The lower range comparisons are
    unnecessary.
    <CFIF Shipments.weight LT 500 >
    <!--- weight is less then 500 --->
    <cfset Shipments.rate = 7.5 >
    <CFELSEIF Shipments.weight LT 1000 >
    <!--- weight is greater then equal to 500 it was not
    caught in first
    branch, but it is also less then 1000 --->
    <cfset Shipments.rate = 7 >
    <CFELSEIF Shipments.weight LT 2000 >
    <!--- weight is greater then equal to 1000 it was not
    caught in any
    previous branch, but it is also less then 2000--->
    <cfset Shipments.rate = 6.5 >
    <CFELSEIF Shipments.weight LT 5000 >
    <!--- weight is greater then equal to 2000 it was not
    caught in any
    previous branch, but it is also less then 5000--->
    <cfset Shipments.rate = 5 >
    <CFELSE>
    <!--- weight is greater then equal to 5000 it was not
    caught in any
    previous branch--->
    <cfset Shipments.rate = 3.65 >
    </CFIF>

  • Reading text file with multiple variables

    When I open a text document containing 1 string of a Base64 Encoded Image, it works fine:
    import flash.display.Loader;
    import flash.utils.ByteArray;
    import formatter.Base64;
    var imgB64Str:String="";
    var ld:Loader=new Loader();
    var my_req:URLRequest = new URLRequest("horses.img");
    var my_loader:URLLoader = new URLLoader();
    my_loader.addEventListener(Event.COMPLETE, loadText);
    my_loader.load(my_req);
    function loadText(e:Event):void{
        // set string variable to loaded text
        imgB64Str = my_loader.data;
        // position, decode & display
        ld.x = ld.y = 50;
        ld.loadBytes(Base64.Decode(imgB64Str));
        addChild(ld);
    The image displays and that's great, but I need to display multiple images; therefore, I used the standard format: var1=value1&var2=value2&...
    (In reality, the values are the huge base64 strings.)
    Then I just needed to add "my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;" since the format of my source changed.
    The thing that bugs me is that I'm tracing the imgB64Str after I set it and it traces fine (just like the other version). And from then on I'm not doing anything different!
    See my comments for things I did different...
    import flash.display.Loader;
    import flash.utils.ByteArray;
    import formatter.Base64;
    var imgB64Str:String="";
    var ld:Loader=new Loader();
    var my_req:URLRequest = new URLRequest("images.img"); // CHANGED: source file, due to new format
    var my_loader:URLLoader = new URLLoader();
    my_loader.dataFormat = URLLoaderDataFormat.VARIABLES; // CHANGED: formatting input from text to variables
    my_loader.addEventListener(Event.COMPLETE, loadText);
    my_loader.load(my_req);
    function loadText(e:Event):void{
        imgB64Str = my_loader.data.image1; // CHANGED: instead of grabbing whole data, grabbing the image1 variable
        trace(imgB64Str); // CHANGED: traces fine!
        // same as other from here down!
        ld.x = ld.y = 50;
        ld.loadBytes(Base64.Decode(imgB64Str));
        addChild(ld);
    It runs with no errors, but the image no longer displays.
    What's the deal?!? :/
    Any help is greatly appreciated.

    See this site: AN EASY REFERENCE FOR OLE AUTOMATION by Serder Simsekler.
    Best!
    Jim

  • Actionscript 3 - Multiple variables for event listener.

    Ok, I have a question (of course that is the reason why I am here).  I have been focusing on PHP a lot lately and just had a client that requires an MP3 player playing multiple songs so I had to whip out my rusty actionscript skills.  I have the player completed and it is working as desired.  The down side is it has multiple songs.  I am using separate functions for each song and separate event listeners.  My main question is there a way to combine these funtions into one and just use the event listener to pass another variable to the functions?  Below is a sample of one of the code for Song1.  I would like to make it so anywhere there is Song1 in the code, I can make it a variable so I can put in for example (Song2, Song3, Song4, etc.)  This way, I can have one or two functions handle all the songs instead of having to copy, paste and then find and replace.
    Thanks for the help!
    // Song 1
    var Song1:Sound = new Sound();
    pbSong1.source = Song1;
    //pbSong1.visible = false;
    var Song1Loaded:Boolean = false;
    pbSong1.addEventListener(Event.COMPLETE, Song1LoadComplete);
    btnSong1Play.addEventListener(MouseEvent.CLICK, Song1Play);
    btnSong1Stop.addEventListener(MouseEvent.CLICK, Stop);
    function Song1Play(event:MouseEvent) {
         if (Song1Loaded == true) {
              sndchnlMain.stop();
              sndchnlMain = Song1.play();
         } else {
              pbSong1.visible = true;
              Song1.load(new URLRequest("media/music/Song1.mp3"));
    function Song1LoadComplete(event:Event) {
         trace("Size of file: " + Song1.bytesTotal);
         Song1.close();
         Song1Loaded = true;
         if(sndchnlMain) {
              sndchnlMain.stop();
         sndchnlMain = Song1.play();
         pbSong1.visible = false;

    But if I reset the bolean to false, if the visitor goes to replay that song, it will try to load the song again.  I did find away around having to the use the boolean value though and accomplish the same thing (I am loving this).  I am using:
    this["Song"+SongNum].bytesTotal
    If there are bytes, then the song is loaded OR loading.  In order to check if the song is completely loaded before it plays, I am using this:
    this["Song"+SongNum].bytesTotal == this["Song"+SongNum].bytesLoaded
    This elimates the need for the Boolean I was using.  Also instead of for each song defining:
    pbSong1.source = Song1;
    I am using the main function to do it for me:
    this["pbSong"+SongNum].source = this["Song"+SongNum];
    The reason why I asked about the Sound variable, I was currious if I could do the same with it as I did with the Progress Bar Source as shown above?  Instead of defining this first:
    var Song1:Sound = new Sound();
    Can I do this in the function:
    var this["Song"+SongNum]:Sound = new Sound();
    I tried it once but I got an error.
    Here is the new FULL updated code:
    import fl.controls.ProgressBar;
    import flash.events.ProgressEvent;
    import flash.events.IOErrorEvent;
    import flash.net.URLRequest;
    import flash.media.SoundChannel;
    import flash.media.Sound;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.display.MovieClip;
    var sndchnlMain:SoundChannel;
    ClearNowPlaying();
      Song 1 Definitions
    var Song1:Sound = new Sound();
    pbSong1.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong1Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong1Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 2 Definitions
    var Song2:Sound = new Sound();
    pbSong2.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong2Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong2Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 3 Definitions
    var Song3:Sound = new Sound();
    pbSong3.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong3Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong3Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 4 Definitions
    var Song4:Sound = new Sound();
    pbSong4.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong4Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong4Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 5 Definitions
    var Song5:Sound = new Sound();
    pbSong5.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong5Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong5Stop.addEventListener(MouseEvent.CLICK, Stop);
      Universal Functions
    function Stop(event:MouseEvent) {
         sndchnlMain.stop();
         ClearNowPlaying();
    function PlaySong(event:MouseEvent) {
         var SongNum:int = Number(event.currentTarget.name.split("btnSong").join("").split("Play").join(""));
         if (this["Song"+SongNum].bytesTotal) {
              if (this["Song"+SongNum].bytesTotal == this["Song"+SongNum].bytesLoaded) {
                   sndchnlMain.stop();
                   ClearNowPlaying();
                   this["NowPlayingSong"+SongNum].visible = true;
                   sndchnlMain = this["Song"+SongNum].play();
         } else {
              this["pbSong"+SongNum].source = this["Song"+SongNum];
              this["pbSong"+SongNum].visible = true;
              this["Song"+SongNum].load(new URLRequest("media/music/Song"+SongNum+".mp3"));
    function LoadComplete(event:Event) {
         var SongNum:int = Number(event.currentTarget.name.split("pbSong").join(""));
         trace("Size of file: " + this["Song"+SongNum].bytesTotal);
         this["Song"+SongNum].close();
         this["Song"+SongNum+"Loaded"] = true;
         if(sndchnlMain) {
              sndchnlMain.stop();
         ClearNowPlaying();
         this["NowPlayingSong"+SongNum].visible = true;
         sndchnlMain = this["Song"+SongNum].play();
         this["pbSong"+SongNum].visible = false;
    function ClearNowPlaying() {
         NowPlayingSong1.visible = false;
         NowPlayingSong2.visible = false;
         NowPlayingSong3.visible = false;
         NowPlayingSong4.visible = false;
         NowPlayingSong5.visible = false;

Maybe you are looking for