Problems using addchild method to dynamically load buttons

Hello,
I have researched the internet for about a week now losing sleep trying to figure this out.  Can someone help me?  I have an fla file with Quiz question.  For example:
on frame 50 I have images and radio buttons, a submit button with an instance name of submit_btn with the question The first capital of the United States
was New York City as a static text.  The action for this frame is:
stop();
import fl.controls.RadioButtonGroup;
var radioGroup1:RadioButtonGroup = new RadioButtonGroup("TriviaQuestion 1");
rb3.textField.autoSize = TextFieldAutoSize.LEFT;
rb1.label="True";
rb2.label="False";
rb3.label="NY is not in the US";
rb4.label="NY is a City";
rb1.group=radioGroup1;
rb2.group=radioGroup1;
rb3.group=radioGroup1;
rb4.group=radioGroup1;
submit_btn.addEventListener(MouseEvent.CLICK, submitClick);
function submitClick(event:MouseEvent):void {
if(radioGroup1.selection == null) {
return;
if(radioGroup1.selection.label == "True") {
status_txt.text=radioGroup1.selection.label+ " is correct! Well done.  The first capital of the United States was New York City in 1789.";
}else {status_txt.text=radioGroup1.selection.label+ " is incorrect! Try Again.";
next_btn.addEventListener(MouseEvent.CLICK, nextOnClick);
function nextOnClick(event:MouseEvent):void
gotoAndPlay(55);
Now my movie works fine this way.  What I want to do is practice adding the navigations (prevButton, nextButton and finishButton) with the addchild button in an AS file (linking it in the document properties).  I have done this if I add the questions as well but a little confused on how to make the navigation work if the questions are already on a time line.  So far this is what my ClassButton.as file looks like  (can't figure out how to import the questions);  If I get the prevhandler correct, the rest will be easy.
package
import flash.display.MovieClip;
//import flash.display.Sprite;  <<fla file went crazy when I used Sprite verses MovieClip
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import fl.controls.RadioButtonGroup;
public class ClassButton extends MovieClip {
//handling questions: --this is the big problem..don't know how to import RadioButtonGroups
private var quizQuestions:RadioButtonGroup;
//private var currentQuestion:QuizQuestions;
//private var radioGroup:RadioButtonGroup;
private var currentIndex:int = 0;
//buttons:
private var prevButton:Button;
private var nextButton:Button;
private var finishButton:Button;
//scoring and messages:
private var score:int = 0;
private var status:TextField;
public function ClassButton() {
createButtons();
//createQuestions();
/* little confused on what function to create to add questions
private function createQuestions() {
radioGroup = new RadioButtonGroup;
//create previous, next and finish button
private function createButtons() {
var yPosition:Number = 505;
prevButton = new Button();
prevButton.label = "Previous";
prevButton.x = 50.35;
prevButton.y = yPosition;
prevButton.addEventListener(MouseEvent.CLICK, prevHandler);
addChild(prevButton);
nextButton = new Button();
nextButton.label = "Next";
nextButton.x = prevButton.x + prevButton.width + 40;
nextButton.y = yPosition;
//nextButton.addEventListener(MouseEvent.CLICK, nextHandler);
addChild(nextButton);
finishButton = new Button();
finishButton.label = "Finish";
finishButton.x = nextButton.x + nextButton.width + 40;
finishButton.y = yPosition;
//finishButton.addEventListener(MouseEvent.CLICK, finishHandler);
addChild(finishButton);
private function showMessage(theMessage:String) {
status.text = theMessage;
status.x = finishButton.x + finishButton.width + 40;
status.y = 505;
/* blocked this out because it's incorrect.  the problem is the property (currentQuestion and quizQuestion)
private function prevHandler(event:MouseEvent) {
showMessage("");
if(currentIndex > 0) {
currentQuestion.visible = false;
currentIndex--;
currentQuestion = quizQuestions[currentIndex];
currentQuestion.visible = true;
else {
showMessage("There are no previous quesions. This is the first question.");
How do I make these buttons - next, prev and finish -  work for the questions using the addchild method in a separate AS file linked to the FLA file?  Is there a way to import the RadioButtons?  Is this possible.

Check out this Nugget.
It contains code that should help you get started.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Problems using GET method in JSP

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET method in JSP?
    If anyone have solutions, please let me know.
    thanks.

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in
    windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is
    good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET
    method in JSP?
    If anyone have solutions, please let me know.
    thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
    If so there are two solutions:
    1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
    encode Korean symbols with "&1234;" kind of escapes - though it
    may not work
    2) Absolute: get my piece of code, which I have managed to write
    just a month ago resolving absolutely similar problem with UTF-16
    in code using Chinese/Russian/English encodings
    But I wouldn't say that it's costs 10 DDs :) - it's much more
    expensive... So try 1st variant if it wouldn't help - let me know.
    I'll figure :)
    Paul

  • Problem using repaint() method from another class

    I am trying to make tower of hanoi...but unable to transfer rings from a tower to another...i had made three classes....layout21 where all componentents of frame assembled and provided suitable actionlistener.....second is mainPanel which is used to draw the rods n rings in paintComponent.....and third is tower in which code for hanoi is available...i had made an object of mainPanel at layoout21 n tower but i m not able to call repaint from tower..gives an error : cannot find the symbol....method repaint in tower.
    code fragments od three classes are:
    LAYOUT21
    class layout21 extends JFrame implements ActionListener
    { private Vector rod1 = new Vector();
    private Vector rod2 = new Vector();
    private Vector rod3 = new Vector();
    private String elem; //comment
    public String r22;
    public boolean in=false;
    public int count=0; //no of times the transfer to other rods performed
    private int r3,rings; // current no of rings
    private JComboBox nor,col;
    private JLabel no;
    private JLabel moved;
    private JLabel no1;
    private JButton start;
    private JButton ref;
    private AboutDialog dialog;
    private JMenuItem aboutItem;
    private JMenuItem exitItem;
    private tower t;
    final mainPanel2 p =new mainPanel2();
    public layout21()
    { t = new tower();
         Toolkit kit =Toolkit.getDefaultToolkit();
    Image img = kit.getImage("java.gif");
    setIconImage(img);
    setTitle("Tower Of Hanoi");
    setSize(615,615);
    setResizable(false);
    setBackground(Color.CYAN);
         JMenuBar mbar = new JMenuBar();
    setJMenuBar(mbar);
    JMenu fileMenu = new JMenu("File");
    mbar.add(fileMenu);
    aboutItem = new JMenuItem("About");
    aboutItem.addActionListener(this);
    fileMenu.add(aboutItem);
    exitItem = new JMenuItem("Exit");
    exitItem.addActionListener(this);
    fileMenu.add(exitItem);
    Container contentPane =getContentPane();
    JPanel bspanel = new JPanel();
    JPanel bnpanel = new JPanel();
    setBackground(Color.CYAN);
         //JComboBox
    nor = new JComboBox();
    nor.setEditable(false);
    nor.addItem("3");
    nor.addItem("4");
    nor.addItem("5");
    nor.addItem("6");
    nor.addItem("7");
    nor.addItem("8");
    nor.addItem("9");
    bspanel.add(nor);
    col = new JComboBox();
    col.setEditable(false);
    col.addItem("BLACK");
    col.addItem("GREEN");
    col.addItem("CYAN");
    bspanel.add(col);
    JLabel tl = new JLabel("Time");
    tl.setFont(new Font("Serif",Font.BOLD,12));
    bspanel.add(tl);
    JTextField tlag = new JTextField("0",4);
    bspanel.add(tlag);
    start =new JButton("Start");
    bspanel.add(start);
    ref =new JButton("Refresh");
    bspanel.add(ref);
    JButton end =new JButton("End");
    bspanel.add(end);
    start.addActionListener(this);
    nor.addActionListener(this);
    col.addActionListener(this);
    ref.addActionListener(this);
    end.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    dispose(); // Closes the dialog
    contentPane.add(bspanel,BorderLayout.SOUTH);
    JLabel count = new JLabel("No of Transfer reguired:");
    count.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(count);
    no = new JLabel("7");
    no.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(no);
    JLabel moved = new JLabel("Moved:");
    moved.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(moved);
    no1 = new JLabel("0");
    no1.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(no1);
    contentPane.add(bnpanel,BorderLayout.NORTH);
    contentPane.add(p,BorderLayout.CENTER);
         String r = (String)nor.getSelectedItem();
    rings = Integer.valueOf(r).intValue();
    p.draw(rings,1) ;
    public void actionPerformed(ActionEvent evt)
    {  Object source = evt.getSource();
    if(source == start)
    r3 = Integer.valueOf((String)nor.getSelectedItem()).intValue();
    p.transfer(false);
    t.initialise(rod1,rod2,rod3,0);
    t.towerOfHanoi(r3);
         //repaint();
         if(source == ref)
    { rod1.removeAllElements() ;
    rod2.removeAllElements() ;
    rod3.removeAllElements() ;
    count=0;
              r3 = Integer.valueOf((String)nor.getSelectedItem()).intValue();
              p.draw(r3,1);
    p.transfer(true);
    no1.setText(""+0);
    p.trans_vec(rod1,rod2,rod3);
    t.initialise(rod1,rod2,rod3,0);
              System.out.println("");
              repaint();
    if(source == nor)
    { JComboBox j = (JComboBox)source;
    String item = (String)j.getSelectedItem();
    int ring1 = Integer.valueOf(item).intValue();
    int a=1;
    for(int i=1;i<=ring1;i++)
    { a = a*2;
    a=a-1;
    no.setText(""+a);
    p.draw(ring1,1);
    repaint();
    if(source == aboutItem)
    {  if (dialog == null) // first time
    dialog = new AboutDialog(this);
    dialog.setVisible(true);
    if(source == exitItem)
    {  System.exit(0);
         if (source==col)
         { JComboBox j = (JComboBox)source;
    String item = (String)j.getSelectedItem();
              repaint();
    TOWER
    class tower extends Thread
    { private Vector rod1 = new Vector();
    private Vector rod2 = new Vector();
    private Vector rod3 = new Vector();
    private int count ;
    private String elem;
    final mainPanel2 z =new mainPanel2();
    public void initialise(Vector r1,Vector r2,Vector r3,int c)
    { rod1 = r1;
    rod2 = r2;
         rod3 = r3;
         count =c;
    public void towerOfHanoi(int rings)
    for(int i=0;i<rings;i++)
    rod1.add(" "+(i+1));
    System.out.println("rod1:"+rod1.toString());
    hanoi(rings,1,2);
    public void hanoi(int m,int i, int j)
    if(m>0)
    { hanoi(m-1,i,6-i-j);
    if(i==1 && j==2 && rod1.isEmpty()==false)
    { count++;
    //no1.setText(""+count);
    elem = (String)rod1.remove(0);
    rod2.add(0,elem);
         //z.trans_vec(rod1,rod2,rod3);
    repaint(); //NOT ABLE TO USE METHOD HERE...WHY??
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 2:"+rod2.toString());
    if(i==1 && j==3 && rod1.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
         elem = (String)rod1.remove(0);
    rod3.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();//
    // z.hanoi_paint();
                   try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 3:"+rod3.toString());
    if(i==2 && j==1 && rod2.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
         elem = (String)rod2.remove(0);
    rod1.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 1:"+rod1.toString());
    if(i==2 && j==3 && rod2.isEmpty()==false)
    { count++;     
         //no1.setText(""+count);
         elem = (String)rod2.remove(0);
    rod3.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 3:"+rod3.toString());
    if(i==3 && j==1 && rod3.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
    elem = (String)rod3.remove(0);
    rod1.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
         try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 1:"+rod1.toString());
    if(i==3 && j==2 && rod3.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
    elem = (String)rod3.remove(0);
    rod2.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 2:"+rod2.toString());
    hanoi(m-1,6-i-j,j);
    MAINPANEL
    class mainPanel2 extends JPanel //throws IOException
    public Vector line = new Vector();
    public Vector rod11= new Vector();
    public Vector rod22= new Vector();
    public Vector rod33= new Vector();
    public int no_ring;
    public int rod_no;
    String pixel;
    StringTokenizer st,st1;
    int x,y;
    public boolean initial =true;
    public void paintComponent(Graphics g)
    { System.out.println("repaint test");
    bresenham(100,60,100,360);
         bresenham(101,60,101,360);
    bresenham(102,60,102,360);
    bresenham(103,60,103,360);
    bresenham(104,60,104,360);     
    g.setColor(Color.BLUE);
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(300,60,300,360);
    bresenham(301,60,301,360);
    bresenham(302,60,302,360);
    bresenham(303,60,303,360);
    bresenham(304,60,304,360);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(500,60,500,360);
    bresenham(501,60,501,360);
    bresenham(502,60,502,360);
    bresenham(503,60,503,360);
    bresenham(504,60,504,360);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(0,361,615,361);//used to get a pixel according to algo.. . func not provided
    bresenham(0,362,615,362);
    bresenham(0,363,615,363);
    bresenham(0,364,615,364);
    bresenham(0,365,615,365);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    if(initial==true)
    g.setColor(Color.RED);
    for(int i = no_ring;i>0;i--)
    { g.drawLine(100-(i*8),360-(no_ring - i)*10,100+(i*8)+5,360-(no_ring - i)*10);
    g.drawLine(100-(i*8),359-(no_ring - i)*10,100+(i*8)+5,359-(no_ring - i)*10);
    g.drawLine(100-(i*8),358-(no_ring - i)*10,100+(i*8)+5,358-(no_ring - i)*10);
    g.drawLine(100-(i*8),357-(no_ring - i)*10,100+(i*8)+5,357-(no_ring - i)*10);
    g.drawLine(100-(i*8),356-(no_ring - i)*10,100+(i*8)+5,356-(no_ring - i)*10);
    // draw for each rod
    //System.out.println("rod11:"+rod11);
    //System.out.println("rod22:"+rod22);
    //System.out.println("rod33:"+rod33);
         int r1 = rod11.size();
         int r2 = rod22.size();
         int r3 = rod33.size();
    String rd1,rd2,rd3;
    int r11,r12,r21,r22,r31,r32;
    if(initial == false)
         { g.setColor(Color.RED);
         while(rod11.size()>0)
    { r12 = rod11.size()-1;
              rd1 = (String)rod11.remove(r12);
    r11 = Integer.valueOf(rd1).intValue();
    g.drawLine(100-((r11+1)*8),360-(r1 - (r11+1))*10,100+((r11+1)*8)+5,360-(r1 - (r11+1))*10);
    g.drawLine(100-((r11+1)*8),359-(r1 - (r11+1))*10,100+((r11+1)*8)+5,359-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),358-(r1 - (r11+1))*10,100+((r11+1)*8)+5,358-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),357-(r1 - (r11+1))*10,100+((r11+1)*8)+5,357-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),356-(r1 - (r11+1))*10,100+((r11+1)*8)+5,356-(r1 - (r11+1))*10);
         while(rod22.size()>0)
    { g.setColor(Color.RED);
              r22 = rod22.size()-1;
         System.out.println("TEST *************************:"+r22);
              try
         // e.printStackTrace();      
              InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr)      ;
         br.readLine() ;
         }catch(Exception f) {}
              rd2 = ((String)rod22.remove(r22)).trim();
    r21 = Integer.valueOf(rd2).intValue();
    g.drawLine(300-((r22+1)*8),360-(r2 - (r22+1))*10,300+((r22+1)*8)+5,360-(r2 - (r22+1))*10);
    g.drawLine(300-((r22+1)*8),359-(r2 - (r22+1))*10,300+((r22+1)*8)+5,359-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),358-(r2 - (r22+1))*10,300+((r22+1)*8)+5,358-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),357-(r2 - (r22+1))*10,300+((r22+1)*8)+5,357-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),356-(r2 - (r22+1))*10,300+((r22+1)*8)+5,356-(r2 - (r22+1))*10);
         while(rod33.size()>0)
    { g.setColor(Color.RED);
              r32 = rod33.size()-1;
              rd3 = (String)rod33.remove(r32);
    r31 = Integer.valueOf(rd3).intValue();
    g.drawLine(500-((r32+1)*8),360-(r3 - (r32+1))*10,500+((r32+1)*8)+5,360-(r3 - (r32+1))*10);
    g.drawLine(500-((r32+1)*8),359-(r3 - (r32+1))*10,500+((r32+1)*8)+5,359-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),358-(r3 - (r32+1))*10,500+((r32+1)*8)+5,358-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),357-(r3 - (r32+1))*10,500+((r32+1)*8)+5,357-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),356-(r3 - (r32+1))*10,500+((r32+1)*8)+5,356-(r3 - (r32+1))*10);
    why i m not able to use repaint() method in tower class? from where i can use repaint() method

    i can't read your code - not formatted with code tags
    I have no chance of getting it to compile (AboutDialog class?? p.draw() ??)
    here's a basic routine - add a couple of things to this to demonstrate what is not
    being redrawn
    (compare the readability of below code (using tags) to yours)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setSize(400,300);
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final DrawPanel dp = new DrawPanel();
        JButton btn = new JButton("Change Text Location/Repaint");
        getContentPane().add(dp,BorderLayout.CENTER);
        getContentPane().add(btn,BorderLayout.SOUTH);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            dp.x = (int)(Math.random()*300);
            dp.y = (int)(Math.random()*150)+50;
            repaint();}});
      public static void main(String[] args){new Testing().setVisible(true);}
    class DrawPanel extends JPanel
      int x = 50, y = 50;
      public void paintComponent(Graphics g)
        super.paintComponent(g);
        g.drawString("Hello World",x,y);
    }

  • Problems using IMPORT method

    Hello,
    We have just upgraded from 4.6c to ECC6.
    In several programs we used Import method with the following syntax in 4.6c:
    import (tname) to &1 from database zzhilan(zz) id zkey1(16) .
    However in ECC6 , since it didn't compile we changed it to :
      import tname to &1 from database zzhilan(zz) id zkey1(16) .
    However now it doesnt read the data from the database.
    How should the Import method be used in ECC6 ?
    Please your advise.
    Mazal

    Hi Mazal,
    While importing source variable and destination variable should same.
    try below
    IMPORT it_itab = it_itab from database zzhilan(zz) id zkey1(16).
    hope it works.
    Thanks!!

  • Problem using webservice method consumer proxy with rawdata from abap

    Hello Gurus,
    I am struggling with an error using a proxy consumer service from ABAP. The proxy was generated using the WSDL from the web service provider. For a specific method we need to send a rawstring as seen bellow:
    The file to be sent on this call is a ZIP file XAdES-BES signed and on BASE64. I’ve implemented the proper code to get the original file from local PC, and convert it to BASE64 before moving the content to the webservice structure and call the service proxy. At SOAMANAGER I also configured the webservice and the proper port with the WSDL:
    The communication is working properly but my problem is with the binary content. When calling the webservice the response is that the structure of the file is wrong. I found it very strange since I used a tiny SOAPUI project with the same WSDL and it worked with no problem.
    After debugging I could see that the content moved to the rawdata string before calling the proxy does not match the content that I can see from the call payload on web services util (srt_util)!
    So the sample code for my method:
    * get the file from the specified folder
    call function 'GUI_UPLOAD'
    exporting
    filename                = ld_zipfilename
    filetype                = 'BIN'
    importing
    filelength              = zip_size
    tables
    data_tab                = t_zip_data[]
    exceptions
    file_open_error         = 1
    file_read_error         = 2
    no_batch                = 3
    gui_refuse_filetransfer = 4
    invalid_type            = 5
    no_authority            = 6
    unknown_error           = 7
    bad_data_format         = 8
    header_not_allowed      = 9
    separator_not_allowed   = 10
    header_too_long         = 11
    unknown_dp_error        = 12
    access_denied           = 13
    dp_out_of_memory        = 14
    disk_full               = 15
    dp_timeout              = 16
    others                  = 17.
    * convert to string
    clear buffer_zip.
    call function 'SCMS_BINARY_TO_STRING'
    exporting
    input_length = zip_size
    importing
    text_buffer  = buffer_string
    tables
    binary_tab   = t_zip_data[]
    exceptions
    failed       = 1
    others       = 2.
    * encode base 64
    perform encode_base64 using buffer_string
    buffer_zip. 
    form encode_base64 using in_string type string
    out_string type xstring.
    data: l_sbuff     type string.
    * convert the file to BASE64
    call method cl_http_utility=>encode_base64
    exporting
    unencoded = in_string
    receiving
    encoded   = l_sbuff.
    call function 'SCMS_STRING_TO_XSTRING'
    exporting
    text   = l_sbuff
    importing
    buffer = out_string
    exceptions
    failed = 1
    others = 2.
    endform.                    "encode_base64
    calling the webservice:
    l_input-xxxx-dokument = buffer_zip.
    try.
    call method l_proxy_test->webservice
    exporting
    input  = l_input
    importing
    output = l_output.
    catch cx_ai_soap_fault into lr_exc_soap_fault.
        endtry.
    From my understanding rawstring should be the same as ABAP xstring. If I debug the program and check the content of the  l_input-dokument before calling the proxy I get binary content: “Izw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi04Ij8…” that is in fact correct
    If I check the payload after call I can see that the binary content sent on the XML is not the same, in fact it is totally different: ”SXp3L2VHMXNJSFpsY25OcGIyNDlJakV1TUNJZ1pXNWpiMlJw…” !!
    I’ve tried a lot of different conversions, changed configuration on the communication, port, etc and nothing seems to work. I really can’t figure out why the binary content on the call is not the same as I move to the webservice structure.
    If I use the project from SOAP UI and send the proper binary content, that is “Izw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi04Ij8…” it works perfectly and the response is successfully.
    Anyone has a clue what could be causing this?
    Appreciate any kind of input.
    Regards,
    João Silva Pinto.

    Anyone? Any clue would be appreciated.

  • Problem Using toString method from a different class

    Hi,
    I can not get the toString method to work from another class.
    // First Class Separate file MyClass1.java
    public class MyClass1 {
         private long num1;
         private double num2;
       public MyClass1 (long num1, double num2) throws OneException, AnotherException {
            // Some Code Here...
        // Override the toString() method
       public String toString() {
            return "Number 1: " + num1+ " Number 2:" + num2 + ".";
    // Second Class Separate file MyClass2.java
    public class MyClass2 {
        public static void main(String[] args) {
            try {
               MyClass1 myobject = new MyClass1(3456789, 150000);
               System.out.println(myobject);
             } catch (OneException e) {
                  System.out.println(e.getMessage());
             } catch (AnotherException e) {
                  System.out.println(e.getMessage());
    }My problem is with the System.out.println(myobject);
    If I leave it this way it displays. Number 1: 0 Number 2: 0
    If I change the toSting method to accept the parameters like so..
    public String toString(long num1, double num2) {
          return "Number 1: " + num1 + " Number 2:" + num2 + ".";
       }Then the program will print out the name of the class with some garbage after it MyClass1@fabe9. What am I doing wrong?
    The desired output is:
    "Number 1: 3456789 Number 2: 150000."
    Thanks a lot in advance for any advice.

    Well here is the entire code. All that MyClass1 did was check the numbers and then throw an error if one was too high or too low.
    // First Class Separate file MyClass1.java public class MyClass1 {
         private long num1;
         private double num2;
         public MyClass1 (long num1, double num2) throws OneException, AnotherException {              
         // Check num2 to see if it is greater than 200,000
         if (num2 < 10000) {
                throw new OneException("ERROR!:  " +num2 + " is too low!");
         // Check num2 to see if it is greater than 200,000
         if (num2 > 200000) {
                throw new AnotherException ("ERROR!:  " +num2 + " is too high!");
         // Override the toString() method
         public String toString() {
              return "Number 1: " + num1+ " Number 2:" + num2 + ".";    
    // Second Class Separate file MyClass2.java
    public class MyClass2 {
        // Main method where the program begins.
        public static void main(String[] args) {
            // Instantiate first MyClass object.
            try {
               MyClass1 myobject = new MyClass1 (3456789, 150000);
               // if successful use MyClass1 toString() method.
               System.out.println(myobject);
                         // Catch the exceptions within the main method and print appropriate
                         // error messages.
             } catch (OneException e) {
                  System.out.println(e.getMessage());
             } catch (AnotherException e) {
                  System.out.println(e.getMessage());
             }I am not sure what is buggy. Everything else is working fine.

  • Page navigation problem using template method pattern

    Hi all,
    I've built a rather simple app implementing the template method design pattern. I've built a shared session bean which holds a hashmap of beans associated with pages I've visited. All of my JSPBeans extend from a common abstract class which calls three simple methods to process output for the page the first time displayed, everytime after the first time the page is displayed and yada yada.....so, let's say I'm three pages in, I've submitted a form and am looking at a page which displays data verifying my submit. Now, I click a link which should take me back two pages, say, to a home page. When I click the link, the home page is displayed momentarily...but then the app processes thu everything I just did up to the point where I started. It just flashes thru a few pages, resubmits the data and I end up right where I started. Automated data processing in a web app...and I wasn't even trying :-) Seriously tho, what in the world is this thing doing and how do I get it to stop! Has anyone ever seen this before?
    regards,
    Mat

    Hi John,
    I'm a little new so excuse my ignorance :-) Yep, I have session bean class which is nothing more than a hashmap of keyed beans ( I have one bean associated with each jsp). All beans are session persistent. What I don't understand is why when I attempt to navigate 'back' into the application ( a page where I have already been) the darn thing repeats. All my beans extend from a common class which includes three abstract methods...firstpassprocess(), process(), and footerprocess.() The idea is that I set a boolean var to "FIRSTPASS" the parent sees that and directs the application to the firstpassprocess() method in the concrete class. Why doesn't it do that again? U say it's because of the session bean? I tried to include some true/false values in the process() method of the concrete class which fixes the application flow. But, and there is always a but, now the submit includes all of the data from the prior submit. How do I do the auto update of the bean properties? Jeez...I hope I don't sound to silly! Thanks for the help....
    Mat

  • Rendering Problems using PDK-URL (URL dynamically changes)

    Oracle 9i Application Server 1.0.2.2.1
    Oracle Portal 3.0.9.8.0
    PDK Services for Java version 3.0.9.0.5.
    PDK URL Services version 3.0.9.0.4.
    Oracle HTTP Server 1.3.19.0.0a
    The PDK-URL installed fine and the rendering examples work
    (www.google.com, etc). As a POC, I'd like to render our help
    desk page on portal tab. For the help desk portlet, I added an
    entry in the URL provider.xml with the following url:
    <pageUrl>http://intranet.mas.alcoa.com/tiweb/default.asp</pageUrl>
    When the portlet is placed on a public help desk tab on the main
    portal and the help desk tab is clicked, the address resolved is
    http://mas_itport-ws2/servlet/scripts/TrackIt.asp. The
    "intranet.mas.alcoa.com" portion of the URL is being
    replaced with "mas_itport-ws2/servlet".
    Metalink referred me to this discussion forum. Please let me
    know if you have any ideas regarding this issue or can advise
    where else to get support.
    Thank you in advance,
    [email protected]

    Thank you for the reply amjad. But I do not understand what it
    is that I am suppose to look for. Here is the provider.xml
    entry.
    <provider class="oracle.portal.provider.v1.http.URLProvider">
    <proxyInfo
    class="oracle.portal.provider.v1.http.ProxyInformation">
    <httpProxyHost>na-proxy.alcoa.com</httpProxyHost>
    <httpProxyPort>80</httpProxyPort>
    </proxyInfo>
    <session>true</session>
    <portlet class="oracle.portal.provider.v1.http.URLPortlet">
    <id>1</id>
    <name>TrackIt Portlet</name>
    <title>TrackIt Portlet</title>
    <description>Display TrackIt as a portlet.</description>
    <timeout>100</timeout>
    <timeoutMessage>Timed out waiting for TrackIt
    Portlet.</timeoutMessage>
    <acceptContentType>text/html</acceptContentType>
    <showEdit>false</showEdit>
    <showEditToPublic>false</showEditToPublic>
    <showEditDefault>false</showEditDefault>
    <showPreview>false</showPreview>
    <showDetails>false</showDetails>
    <hasHelp>false</hasHelp>
    <hasAbout>false</hasAbout>
    <renderer class="oracle.portal.provider.v1.RenderManager">
    <contentType>text/html</contentType>
    <showPage class="oracle.portal.provider.v1.http.URLRenderer">
    <contentType>text/html</contentType>
    <charSet>ISO-8859-1</charSet>
    <pageUrl>http://intranet.mas.alcoa.com/tiweb/default.asp</pageUrl
    >
    <filter class="oracle.portal.provider.v1.http.HtmlFilter">
    <headerTrimTag>&lt;body</headerTrimTag>
    <footerTrimTag>/body></footerTrimTag>
    <baseHRef>http://intranet.mas.alcoa.com/Tiweb/default.asp</baseHR
    ef>
    <secBaseHRef>http://intranet.mas.alcoa.com/Tiweb/default.asp</sec
    BaseHRef>
    <inlineRendering>true</inlineRendering>
    </filter>
    </showPage>
    </renderer>
    </portlet>

  • Problems with addChild in UIComponent

    Hello there
    I have this class, which extends UIComponent class, and I
    need put a Label inside it, but when I create the label, and add it
    using addChild method, the Label isnt shown.
    The class name is "Page" and it is child of a class named
    "PageManager" (extends UIComponeny) which is a child of another
    class named "Magazine" (extends UIComponent) which is a unique
    child of "Application" (extends Canvas).
    the class source-code:
    * Página que carrega o conteúdo passado por XML e
    é dinâmica
    * @author Thiago Ricieri
    * @version 1.0
    package sm.display {
    //Importação de classes do Library do Flash
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import mx.containers.HBox;
    import mx.controls.Label;
    import mx.core.UIComponent;
    * Classe que define o documento que inicializa a revista
    public class Page extends UIComponent {
    * Atributos
    public var pageSide:Number;
    public var isBehind:Boolean;
    private var infoLabel:Label;
    static public var numInstances:Number = 0;
    * Construtor da Classe
    public function Page() {
    super();
    infoLabel = new Label();
    this.addChild(infoLabel);
    infoLabel.text = "some text here " +
    numInstances.toString();
    infoLabel.setStyle("color", "#ffffff");
    infoLabel.y=150;
    infoLabel.x=150;
    numInstances++;
    pageSide = 0;
    isBehind = false;
    this.addEventListener(MouseEvent.CLICK, clickHandle);
    public function loadImage(src:String):void {
    var _loader:Loader = new Loader();
    _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    completeHandle);
    var request:URLRequest = new URLRequest(src);
    _loader.load(request);
    //addChild(_loader);
    private function completeHandle(e:Event):void{
    protected function clickHandle(e:Event):void {
    Thanks a lot ;]

    cool,
    I've discovered the "override protected function
    createChildren()", thats cool!
    i've created two another classes extending UIComponent and
    they didnt need the "override protected function createChildren()"
    to attach components to them. This is only aplied on the classes
    that I described above, when i try to use the method "addChild()"
    to attach a Label.
    I've followed the methods from the article, but is not
    working the way I like yet.
    help ;]

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as &amp;quot;constantly change&amp;quot; what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Can I dynamically load html from file, but do not stuck the UI

    I load my html from files.
    Use JEditorPane to setContentType("text/html"),
    use JEditorPane.read method to dynamically load html from file,
    the jeditorpane is add into a jdialog,
    when my application showing the dialog, the dialog was stuck,
    user can not click other UI component, I think it is not look dynamically
    So any other suggestion?
    You are appreciated.
    Thanks in advanced.

       yourDialog.setModal(false);

  • Using return method to do this assignment

    Write a method to delete character in a string.
    Example:
    A call to deleteChar(?hello?, ?l?) will return heo
    A call to deleteChar(?madam?, ?a?) will return mdm
    I have tried to solve this problem using return method, but it doesn't work. Please help me do this exercise with return method in main method.
    Here is my work, using void method in main method
         private static void deleteChar(String input, String deletedChar) {
              for (int i = 0; i < input.length(); i++) {
                   if (!(input.charAt(i) + "").equalsIgnoreCase(deletedChar)) {
                        System.out.print(input.charAt(i));
         public static void main(String[] args) {
              String input, deletedChar;
              Scanner kb = new Scanner(System.in);
              System.out.print("Enter a String: ");
              input = kb.nextLine();
              System.out.println("Enter a letter you want to delete from String: ");
              deletedChar = kb.nextLine();
              deleteChar(input, deletedChar);
         }

    In your main method, you replace the line
    deleteChar(input, deletedChar);by
    String result = deleteChar(input, deletedChar); and the method by :
    private static String deleteChar(String input, String deletedChar) {
        return input.replaceAll(deletedChar, "");
    }

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • Problem using Option Buttons in a form

    Hello,<o:p></o:p>
    I created a form in Word using a table for defining the layout. Inside of some cells I inserted some Rich Text Content Control and in some others Option Buttons (ActiveX Control). Everything
    was working correctly.<o:p></o:p>
    The problem appears when I restrict the formatting and editing. I select the option "Allow only this type of editing in the document" and then choose "Filling in forms",
    finally click on "Yes Start Enforcing Protection". <o:p></o:p>
    Now if I want to fill in the form, at the beginning I'm able to click on the Cells with the Rich Text Content Control and type in some text, but as soon as I click on any of the Option Buttons
    all the Rich Text Content Controls get blocked, and I am not able to modify the text anymore. <o:p></o:p>
    The only way to make it work again is to jump to the next cells using the Tab key instead of using the mouse. If I go to the "Restrict Editing" and "Stop Protection", then
    everything works correctly.
    If I delete the Option Buttons the problem is solved as well, it doesn't matter if the from is protected or not.<o:p></o:p>
    How can I solve this issue? I'm using Windows 7 and Office 2013.<o:p></o:p>
    Thanks in advance.<o:p></o:p>

    W1zard is correct. Switch to Exec_SQL. Oracle does not support Forms using DBMS_SQL.
    Now... please explain why you are not using a dynamic record group. It is SOOO much easier!
    And if you want to look at some code using both methods, Exec_SQL and dynamic record group, you can download my "Quick Access" dynamic utility form, here:   Oracle Forms Utilities

  • Problems with the dynamic loader... And well... I SERIOUSLY messed up.

    So you might call me an idiot.  Go ahead... I deserve it.
    I was in the process of updating my netbook over SSH because I left it back home when I went to school.  I ended up running into problems with glibc etc...  So I did something that I seriously regret...
    I executed the command...
    mv /lib/* /usr/lib*
    This has to be the most retarded thing I have ever done ever... Like I'm not even shitting you.
    To make things worse... I don't have busybox and have no method of getting busybox onto the computer.
    Now I have seen about using the dynamic loader "ld-linux.so.2" to execute programs using a user defined library path.  So I thought perfect, I can do this.  The problem is... I can't find it.  I looked on two healthy Arch machines at the locations and names.  I used that to try this.  I am sure at least I have a recent version of glibc installed (<current version>-1 I believe).  But I still cannot find this at all.  I am logged in as root over SSH but it fails to log in again on another session.  So I have one session to work with it I can work it at all.
    Do you have any suggestions to fix this?  If not, I can always have someone tomorrow dd a copy of an arch iso tomorrow and possibly fix everything... But I would really like this fixed without all of that... Thanks...

    See these two threads.

Maybe you are looking for

  • HT1338 Can i upgrade my Macbook Pro at an Apple retail shop?

    I was just wondering, with the release of osx mountain lion today, in several hours im assuming, will i be able to upgrade my software, using the internet of a apple retail shop? do they do this kind of thing? I have only a small internet usage, and

  • Dynamically invisible ALV custom button

    Hi all, I've created an ALV with a custom toolbar button.My requirement is after clicking the button it perform its task and then disappear from the toolbar.How to make the button invisible?I'm not using OO ALV. Thanks in advance. Regards. Sarbajit.

  • Oracle forms- Number formatting in post query

    I have a column called num_value in a table. When the user retrieves the data in post query I need the following formatting For WBC if the value entered is 3 I want to show in the forms as 3.0 etc.... So I have a decode statement Cursor C5 is select

  • Need help in INBOUND idoc generation function module!

    Can anyone send me the inbound idoc function module ! i have the outbound code but i need the inbound code

  • You are a credit addict if...

    Let's have some fun here.  I know this was done a few years back, but let's do it again for all the newbies and simply for entertainment. You know you are credit addict if: You set a reminder app for a new card which has been announced so you can app