Please I need a Little Help with xmlloader

Hello pretty people,
Could someone help me with this code?
I have an xmlloader Class, which load an xml file.
This is the code...when I trace the xml, it load with any problem but when
I want that load it, nothing happen, and there is no throw an error too.
Would you please tell me why nothin happen? I am using the main time.
Thanks in advance for some help.
Regards
Joselyn
import flash.events.Event;
import com.greensock.TweenLite;
import com.greensock.easing.Back;
// XML LISTS //
// ========= //
var projectTitle:XMLList;
var projectImage:XMLList;
var projectInfo:XMLList;
var projectContent:XMLList;
var projectClient:XMLList;
var projectMedia:XMLList;
var projectTechnology:XMLList;
var projectLink:XMLList;
var newsTitle:XMLList;
var newsInfo:XMLList;
var newsContent:XMLList;
var newsTitleArray:Array;
var newsInfoArray:Array;
var newsContentArray:Array;
// number of items
var projectsNum:Number;
var newsNum:Number;
// LOAD XML //
// ======== //
var xml:XMLLoader = new XMLLoader(this,"data.xml");
// function called when XML is loaded
function getXML(xmlData:XML):void {
// STORING RELEVANT DATA INTO LISTS FOR LATER ACCESS //
projectTitle = xmlData.projects.project.title;
projectImage = xmlData.projects.project.image_path;
projectInfo = xmlData.projects.project.info;
projectContent = xmlData.projects.project.content;
projectClient = xmlData.projects.project.client;
projectMedia = xmlData.projects.project.media;
projectTechnology = xmlData.projects.project.technology;
projectLink = xmlData.projects.project.link;
newsTitle = xmlData.news.article.title;
newsInfo = xmlData.news.article.info;
newsContent = xmlData.news.article.content;
projectsNum = projectTitle.length();
newsNum = newsTitle.length();
trace(projectInfo);
newsTitleArray = xmlData.news.article.title.text().toXMLString().split("\n") ;
newsTitleArray.reverse();
newsInfoArray = xmlData.news.article.info.text().toXMLString().split("\n") ;
newsInfoArray.reverse();
newsContentArray = xmlData.news.article.content.text().toXMLString().split("\n") ;
newsContentArray.reverse();
//this is one part of the complete cody
//CONTAINER FOR SCROLLING
var panelContainer:Sprite = new Sprite();
addChild(panelContainer);
//ARRAY FOR REMOVING AND ADDING LISTENERS
var panelArray:Array = new Array();
var MT:MovieClip = new MovieClip(); //before I declare this variable to load the xml, was the problem//
//ADDING PROJECTPANEL IN A LOOP
for (var i:Number=0; i<MT.projectsNum; i++){
    var projectPanel:ProjectPanel = new ProjectPanel();
    //INSERT XML CONTENT
    projectPanel.title.text = MT.projectTitle[i];
    projectPanel.info.text = MT.projectInfo[i];
    projectPanel.content.text = MT.projectContent[i].substr(0,150)+"...Ver mas";
    projectPanel.loadImage(MT.projectImage[i]);
    projectPanel.x = i*(projectPanel.width+5);
    panelContainer.addChild(projectPanel);
    panelArray.push(projectPanel);
    //listener for click on ProjectPanel
    projectPanel.addEventListener(MouseEvent.CLICK, onClick); 
function onClick(evt:MouseEvent):void{
for(var i:Number = 0; i<MT.projectsNum; i++){
  panelContainer[i].removeEventListener(MouseEvent.CLICK, onClick);
removeChild(panelContainer);
TweenLite.to(panelContainer, 0.5, {y:stage.stageHeight, ease:Back.easeIn});
this.addFullPanel();
removeListeners();
function removeListeners():void{
for(var i:Number = 0; i<MT.projectsNum; i++) {
  panelContainer[i].removeEventListener(MouseEvent.CLICK, onClick);
function addListeners():void{
for(var i:Number = 0; i<MT.projectsNum; i++) {
  panelContainer[i].addEventListener(MouseEvent.CLICK, onClick);
function slideUp():void{
TweenLite.to(panelContainer, 0.5, {y:0, ease:Back.easeOut});
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
function onMove(evt:MouseEvent):void {
//trace(mouseX);
if(fullProjectPanelUp==false){
  TweenLite.to(panelContainer, 0.3, { x:-(stage.mouseX/800)*panelContainer.width+stage.stageWidth/2});
  //tweenPanelContainer = new Tween(panelContainer, "alpha", Strong.easeOut, 0, 1, 3, true);

Hello Kglad:
Thank you I copy and paste the complete code
I wanted to add that I am using URLLoader class is to send you to the previous comment.
Regards
Joselyn
// XML LISTS //
// ========= //
var projectTitle:XMLList;
var projectImage:XMLList;
var projectInfo:XMLList;
var projectContent:XMLList;
var projectClient:XMLList;
var projectMedia:XMLList;
var projectTechnology:XMLList;
var projectLink:XMLList;
var newsTitle:XMLList;
var newsInfo:XMLList;
var newsContent:XMLList;
var newsTitleArray:Array;
var newsInfoArray:Array;
var newsContentArray:Array;
// NUMS ITEMS
var projectsNum:Number;
var newsNum:Number;
// LOAD XML //
// ======== //
var xml:XMLLoader = new XMLLoader(this,"data.xml");
// function called when XML is loaded
function getXML(xmlData:XML):void {
// STORING RELEVANT DATA INTO LISTS FOR LATER ACCESS //
projectTitle = xmlData.projects.project.title;
projectImage = xmlData.projects.project.image_path;
projectInfo = xmlData.projects.project.info;
projectContent = xmlData.projects.project.content;
projectClient = xmlData.projects.project.client;
projectMedia = xmlData.projects.project.media;
projectTechnology = xmlData.projects.project.technology;
projectLink = xmlData.projects.project.link;
newsTitle = xmlData.news.article.title;
newsInfo = xmlData.news.article.info;
newsContent = xmlData.news.article.content;
projectsNum = projectTitle.length();
newsNum = newsTitle.length();
trace(xmlData);
        newsTitleArray = xmlData.news.article.title.text().toXMLString().split("\n") ;
newsTitleArray.reverse();
newsInfoArray = xmlData.news.article.info.text().toXMLString().split("\n") ;
newsInfoArray.reverse();
newsContentArray = xmlData.news.article.content.text().toXMLString().split("\n") ;
newsContentArray.reverse();
useXML();
//////////////PROJECT PANEL //////////
import flash.events.Event;
import com.greensock.TweenLite;
import com.greensock.easing.Back;
//CONTAINER FOR SCROLLING
var panelContainer:Sprite = new Sprite();
addChild(panelContainer);
//ARRAY FOR REMOVING AND ADDING LISTENERS
var panelArray:Array = new Array();
var MT:MovieClip = new MovieClip();
function useXML():void {
//trace(MT.projectsNum);
for (var i:Number=0; i<MT.projectsNum; i++){
  var projectPanel:ProjectPanel = new ProjectPanel();
  //INSERT XML CONTENT
  //trace(i);
  trace(MT.projectTitle[i]);
        projectPanel.title.text = MT.projectTitle[i];
        projectPanel.info.text = MT.projectInfo[i];
        projectPanel.content.text = MT.projectContent[i].substr(0,150)+"...Ver mas";
        projectPanel.loadImage(MT.projectImage[i]);
        projectPanel.x = i*(projectPanel.width+5);
  panelContainer.addChild(projectPanel);
  panelArray.push(projectPanel);
  //listener for click on ProjectPanel
  projectPanel.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evt:MouseEvent):void{
for(var i:Number = 0; i<MT.projectsNum; i++){
  panelArray[i].removeEventListener(MouseEvent.CLICK, onClick);
TweenLite.to(panelContainer, 0.5, {y:stage.stageHeight, ease:Back.easeIn});
this.addFullPanel(Number(evt.currentTarget.name));
removeListeners();
function removeListeners():void{
for(var i:Number = 0; i<MT.projectsNum; i++) {
  panelArray[i].removeEventListener(MouseEvent.CLICK, onClick);
function addListeners():void{
for(var i:Number = 0; i<MT.projectsNum; i++) {
  panelContainer[i].addEventListener(MouseEvent.CLICK, onClick);
function slideUp():void{
TweenLite.to(panelContainer, 0.5, {y:0, ease:Back.easeOut});
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
function onMove(evt:MouseEvent):void {
//trace(mouseX);
if(fullProjectPanelUp==false){
  TweenLite.to(panelContainer, 0.3, { x:-(stage.mouseX/800)*panelContainer.width+stage.stageWidth/2});
//////////FULLPROJECTPANEL ////////////////////////
import com.greensock.TweenLite;
var fullProjectPanelUp:Boolean = false;
var fullProjectPanel:FullProjectPanel;
function addFullPanel(k:Number): void {
        fullProjectPanel = new FullProjectPanel;
        fullProjectPanel.title.text = projectTitle[k];
        fullProjectPanel.Info.text = projectInfo[k];
        fullProjectPanel.Content.text = projectContent[k];
        fullProjectPanel.Client.text = projectClient[k];
        fullProjectPanel.Media.text = projectMedia[k];
        fullProjectPanel.technology.text = projectTechnology[k];
        fullProjectPanel.link.text = projectLink[k];
        fullProjectPanel.loadImage(projectImage[k]);
        TweenLite.from(fullProjectPanel, 0.6, {alpha:0, delay:0.5});
addChild(fullProjectPanel);
        fullProjectPanelUp=true;
        fullProjectPanel.closePanel.addEventListener(MouseEvent.CLICK, onCloseClick);
fullProjectPanel.closePanel.buttonMode = true;
function onCloseClick(evt:MouseEvent):void {
    slideUp();
    removeChild(fullProjectPanel);
    TweenLite.delayedCall(0.4, upFalse);
function upFalse():void {
fullProjectPanelUp = false;
THIS CODE INSIDE ProjectPanel MOVIE CLIP
title.mouseEnabled = false;
info.mouseEnabled = false;
content.mouseEnabled = false;
this.buttonMode = true;
var _progress:ProgressBar = new ProgressBar;
_progress.x = 80;
_progress.y = 80;
_probress.alpha = 0.7;
addChild(_progress);
function loadImage(imagePath:String):void {
   var loader:Loader = new Loader();
   configureListener(loader.contentLoaderInfo);
   var url:String = imagePath;
   var urlRequest:URLRequest = new URLRequest(url);
   loader.x = 9;
   loader.y = 9;
   loader.load((urlRequest);
   addChild(loader);
function configureListeners(dispatcher:IEventDispatcher):void {
   dispatcher.addEventListener(Event.COMPLETE, completeHandler);
   dispatcher.addEventListener(ProgressEvent.PROGRESS, progresHandler);
function completeHandler(evt:Event):void {
   _progress.visible = false;
function progressHandler(evt:ProgressEvent):void {
   _progress._progress.x = -_progress._progress.width+((evt.bytesLoaded/evt.bytesTotal)*_progress._progress.width);

Similar Messages

  • Please I need a little help with Jbuilder7

    Hello:
    I�m working with Jbuilder7 Enterprise, i�m a trying to compile a program that use JMS Api, but when i make it, i always receive a message like this:
    "Jms1.java": Error #: 750 : initialization error: com.borland.compiler.symtab.LoadError: java.io.IOException: class not found: class java.lang.Object.
    I�ve revised project�s properties and it seems that they are well.
    Even, this message appears if i use JMS wizard of Jbuilder.
    Could anyone tell me what�s wrong?
    Many thanks.
    Sorry for my English ;-).

    Hi,
    When u have this error message in JBuilder, generaly, that's 'cause ur JBuilder don't succes to locate ur JDK. Go to Tools / Configure JDKs... and verify if the JDK u're using in ur project is valid and/or try to re-configure it.
    By default, JBuilder embed is own JDK located in $JBUILDER_HOME/jdk1.3.1
    Hope this can help u
    Seb

  • Need a little Help with my new xfi titanium

    +Need a little Help with my new xfi titanium< A few questions here.
    st question? Im using opt out port on the xfi ti. card and using digital li've on a windows 7 64 bit system,? I would like to know why when i use 5. or 7. and i check to make sure each speakear is working the rear speakers wont sound off but the sr and sl will in replace of the rear speakers. I did a test tone on my sony amp and the speaker are wired correctly becasue the rear speakers and the surrond? left and right sound off when they suppose too. Also when i try to click on? the sl and sr in the sound blaster control panel they dont work but if i click on the rear speakers in the control panel the sl and sr sound off. Do anyone know how i can fix this? So i would like to know why my sl and sr act like rears when they are not?
    2nd question? How do i control the volume from my keyboard or from windows period when using opt out i was able to do so with my on board? sound max audio using spidf? Now i can only control the audio using the sony receiver.
    Thank you for any help..

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • Need a little help with syncing my iPod.

    I got a new macbook pro for cristmas and a few cds. After i tried to sync my ipod to itunes i put a symbol next to each song that i got from other cds saying that they were downloading but they werent. Also the cds i downloaded to my ipod for the first time didnt appear at all. Need help.

    /Re: Need a little Help with my new xfi titanium? ?
    ZDragon wrote:
    I'm unsure about the first question. Do you even have a 7. system and receiver? If you just have 5., you should be able to remap the audio in the THX console.
    I do have a sony 7. reciever str de-995 its an older one but its only for my cpu. At first i didnt even have THX installed because it didnt come with the driver package for some reason until i downloaded the daniel_k support drivers and installed it. But it doesnt help in anyway.
    I have checked every where regarding the first question and alot of people are having problems getting sound out of there rear channels and the sound being re-mapped to the surround right and the surround left as if there rear left and rear right.
    I read somewhere that the daniel_k support drivers would fix this but it didnt for me and many others.
    For the second question i assumed it would be becasue of the spidf pass through and that my onboard sound card was inferior to the xfi titaniums. But i wasnt sure and i was hopeing that someone would have a solution for that problem because i miss controlling the volume with my keyboard.

  • Need a little help with dial setup on CME

    I've got a CME I'm using for testing and I think I need a little help figuring out the proper config to get the system to accept numbers I dial and have those numbers be passed on to an Avaya system (including the leading 9 for ARS in Avaya) via H.323 IP trunks.   I have it working well for internal 5 digit extension calls across the H.323 trunks and I also have it working well for some types of outside calls that gets passed on to the Avaya and then the Avaya dials the call out to the PSTN.   My only real problem is, I can't figure out how to correctly configure CME to examine the digits I'm dialing and only send the digits once I'm finished dialing....not as soon as it sees an initial match.
    What's happening is this.  I can dial local numbers in my area as 7 digits or 10 digits.  The phone company doesn't yet force us to dial area code and number for local calls (10 digits).  I can still dial 7 digits.   But...if I put an entry in CME that looks like this....
    (by the way, the 192.168.1.1 IP is not the real IP address, that's just an example, but the rest of this entry is what I really have entered in CME)
    dial-peer voice 9 voip
    description Outside 7 Dig Local Calls Via Avaya
    destination-pattern 9.......
    session target ipv4:192.168.1.1
    dtmf-relay h245-alphanumeric
    no vad
    ...Then it will always try to dial out immediately after seeing the first 8 digits I dial (9 plus the 7 digit number I called)...even though I have a speicifc entry in the system that accounts for calls to 9 plus area code 513.  I would have assumed that if I put the specific entry in for 9513....... it would see that and wait to see if I was actually dialing something to match 9513....... instead of 9.......   Understand what I mean?   Because 9513....... is more specific than 9....... but it still tries to send the call out immediately after seeing the first 8 digits I dialed.
    dial-peer voice 9513 voip
    description Outside 10 Dig Local Calls Via Avaya
    destination-pattern 9513.......
    session target ipv4:192.168.1.1
    dtmf-relay h245-alphanumeric
    no vad
    ...BUT...here's the interesting thing.  If I trace the 10 digit call in Avaya, I see that the number being presented to the Avaya PBX is only the first 7 digits of the number....not the full 10 digits...BUT I see a few more of the digits I dialed (like the 8th and 9th digits) after the call is already setup and sent to the PSTN.  It's like the CME is trying to send the rest of the 10 digits I dialed, but at that point it's already too late.   It setup the call as a 7 digit call (9 plus 7 digits), not 10 digit like I wanted.
    I'm more familiar with how to setup dialing in the Avaya via ARS.  My background is Avaya, not Cisco, so this dial-peer config is a little difficult for me until I understand the reasoning of how it examines the numbers and what I should do to make it wait for me to finish dialing....or to tell the system that what I'm dialing will be a minimum or a certain amount of digits and maximum of a certain amount of digits, like the Avaya does.  I just need some pointers and examples to look at :-)   I think I've almost got it....but I'm just missing something at the moment.
    Just so you understand, the call flow should be like this:  Cisco phone registered to CME > CME to Avaya via H.323 trunks > Avaya to PSTN via ISDN PRI trunks connected to Avaya.  I have to be sure I send the 9 to the Avaya also, because 9 triggers ARS in the Avaya. 
    Thanks for your help

    Here is a good document that explains how dial-peers are matched in the Cisco world:
    http://www.cisco.com/en/US/tech/tk652/tk90/technologies_tech_note09186a008010fed1.shtml#topic7
    In your case, it is variable length dial plan you are trying to implenent. To fix it, you need to add a T to force the system to wait for more digits to be entered if there is any.
    dial-peer voice 9 voip
    description Outside 7 Dig Local Calls Via Avaya
    destination-pattern 9.......T
    session target ipv4:192.168.1.1
    dtmf-relay h245-alphanumeric
    no vad
    dial-peer voice 9513 voip
    description Outside 10 Dig Local Calls Via Avaya
    destination-pattern 9513.......
    session target ipv4:192.168.1.1
    dtmf-relay h245-alphanumeric
    no vad
    You can also configure the inter-digits timeout using the command timeouts interdigit under telephony-service.
    Please rate helpful answers!

  • Need a little help with G3 Clameshell...Please

    I just received this Clameshell, and it only has OS9 on it, I haven't used 9 in forever, and really need to get OSX on it. I have retail Panther cd's. But I hear I need to update the firmware, if it isn't updated yet.
    I know I can find out which I have in System Profiler, but I can't find it in there. Is it called something else? What part of System Profiler is it in(in OS9).
    Also, I have Cable net, this Clamshell was always used with dial up, how can I switch things around in it so I can hook up my ethernet cable and run with it? Is that possible with OS9? Or will I have to update the firmware a different way.
    I am stuck. Need lots of help.
    Thanks!!!
    veganjustice

    Is it called something else? What part of System Profiler is it in(in OS9).
    It is in the field called "Boot ROM".
    ...how can I switch things around in it so I can hook up my ethernet cable and run with it?
    Open the TCP/IP control panel. Configure it to use Ethernet and DHCP to get an IP address.

  • Need a little help with Slimbox (Lightbox clone) and Spry data sets

    Hello guys!
    First of all let me say that I'm not a programmer in any way,
    shape or form, and somehow I managed to build me a dynamic
    thumbnail gallery that reads data from an XML file and displays it
    on my webpage using a Spry data set and a slider widget (yay!)
    This is of course only thanks to the many great examples
    provided by the Adobe Spry team, and me being stubborn enough to
    keep at it, even though I don't really understand what I'm doing :D
    But I got to this point where I have basically everything
    working, except that I can't get the Slimbox (Lightbox clone)
    script to work with the Spry-generated thumbnail gallery.
    From what I could understand from other threads on this
    forum, is that I need to add an observer somewhere, only that I'm
    not sure where and how (those threads are pretty old and the
    examples aren't available anymore).
    I'm sure you guys know what I'm talking about, anyway, here's
    what I got so far:
    http://www.riotdesign.com.ar/misc/gallery/test1.html
    I have the thumbnail gallery populated from the external XML
    file, a basic page navigation using the Sliding Panels widget, and
    the Slimbox script which works only on the static test image.
    Okay I guess that's it for now, sorry for the long post and
    of course any help with this will be GREATLY appreciated :)
    Thanks & bye!

    Kev,
    Where exactly does the .evalScripts = true; text need to go?
    Does it go in the href call?
    <a href="ManageNotes.asp" title="Manage Notes" onClick="this.blur();
    Modalbox.show(this.href, {title: 'Manage Notes', width: 575}); return false;">View your notes.</a>
    Thanks for any assistance.
    J Bishop

  • Need a little help with RAF logic

    So Im making a program to give different users, different rights. This is the method that appends them to file and Map
         * Writes the players rights to the appendages
         * @param playerName Player to update
         * @param playerRights Rights to give the player
         * @param pointer The lines index in the files
         * @throws IOException If a read/write error occours
        public void writeRights(String playerName, Rights playerRights, long pointer) throws IOException {
            rightsRAF.seek(pointer);
            rightsRAF.write(("\n" + playerName + "::" + playerRights).getBytes());
            if(rightsRAF.read() != '\n') {
                rightsRAF.seek(rightsRAF.getFilePointer()-1);
                rightsRAF.write("\n".getBytes());
            rightsMap.put(playerName, playerRights);
        }1. The RAF goes to the predetermined index in the file, pointer, which is the line the users name starts on. Entries are stored in the file as "name::RIGHTS"
    2.It writes out the players name, and rights
    3. It checks to see if it accidentally wrote over the \n
    My problem now, is that some rights are longer than others. For example, if there was already an entry, "name::MODERATOR" and you overwrite it, with "name::OWNER" then it would turn into "name::OWNERATOR" because the rest of the line wasn't overwritten.
    I need some help with logic to determine how to overwrote the entire line, because sometimes you could go from a short one, to a long one, and need to append a new \n character, and sometimes you could go the other way around from long to short and end up with two words fused, I cant figure out how to determine whats a word that got partially overwritten and whats a new line totally.
    Thanks

    As pointed out you need to have fixed size records, or at least a maximum size.
    You also have another problem nobody commented on yet (I don't think) with the getBytes() calls. At that point in your code you will mangle most unicode Strings.
    All things being equal here I think your best solution is to use an embedded database like JavaDB with JDBC. I think you will find an XML solution to slow for your purposes.
    If you decide to continue the RAF route though here is an example. I know this is not exactly what you are doing but you can extrapolate from this...
    public void updatePlayerName(String playerName, int playerIndex){
       int recordlength = 200;  
       byte[] buff = playerName.getBytes("UTF-8");
       if(buff.length>recordlength){
          //truncate bytes. this is also not great because a character at the end could be mangled
          byte[] temp = new byte[recordlength];
          System.arraycopy(buff,0,temp,0,temp.length);
          buff = temp;
       long pointer = playerIndex * (recordlength+4);// plus 4 bytes per record for actual length
       raf.seek(pointer);
       raf.writeInt(buff.length);
       raf.write(buff);
    public String getPlayerName(int playerindex){
        int recordlength = 200;  
        long pointer = playerIndex * (recordlength+4);
        raf.seek(pointer);
        int lengthToRead = raf.readInt();
        //length to read should be checked for sanity or bad things will happen next
        byte[] buff = new byte[lengthToRead];
        raf. readFully(buff);
        return new String(buff,"UTF-8");
    }And then of course you'd have to add storing the "rights". It gets complicated in a hurry. I do really recommend the JDBC route.

  • Need a little help with some errors.

    Receiving some errors..
    btn2.addActionListener(new ActionListener() {
    and also
    frame.setLocation(400,400);
    frame.setVisible(true);
    }<<~~has 2 errors here...
    Both above have class or interface expected errors..clueless on what i'm missing at the moment.
    Anyone mind pointing out what {'s and }'s i'm missing?
         btn1.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
         btn2.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
                        private void btn2actions() {
                             if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                             if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
                   btn3.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn1actions();
                        private void btn3actions() {
                             txt1.setText("");
                             txt1.requestFocus();
    public static void main(String[] args) {
        Test2 frame = new Test2();
        frame.setTitle("Test Frame");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 300);
        frame.setLocation(400,400);
        frame.setVisible(true);
    }

    All my code..finally posted...just need help with more errors.
    F:\DocumentsTest2.java:169: ';' expected
              btn1.addActionListener(new ActionListener()) {
    ^
    F:\Documents\Test2.java:176: illegal start of expression
              private void btn1actions() {
    ^
    F:\Documents\Test2.java:191: illegal start of expression
              private void btn2actions() {
    ^
    F:\Documents\.java:202: illegal start of expression
              private void btn3actions() {
    ^
    4 errors
    Tool completed with exit code 1
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test2 extends JFrame{
         static JButton btn1,btn2,btn3;
         static JTextField txt1;
         static JRadioButton radio1,radio2;
           public Test2() {
             Container container = getContentPane();
             container.setLayout(new BorderLayout());
              //Create Panels
                JPanel Panel1 = new JPanel();
                JPanel Panel2 = new JPanel();
                JPanel Panel3 = new JPanel();
                JPanel Panel4 = new JPanel();
                JPanel Panel5 = new JPanel();
                JPanel Panel6 = new JPanel();
                JPanel Panel7 = new JPanel();
                JPanel Panel8 = new JPanel();
                JPanel Panel9 = new JPanel();
                JPanel Panel10 = new JPanel();
              //Set Layout for Panels
              Panel3.setLayout(new BorderLayout());
              Panel4.setLayout(new BorderLayout());
              Panel5.setLayout(new BorderLayout());
              Panel6.setLayout(new BorderLayout());
              Panel10.setLayout(new BorderLayout());
              //Create the Various Fonts and Colors for this GUI
              Font font1 = new Font("SansSerif", Font.BOLD, 20);
              Font font2 = new Font("Serif", Font.PLAIN, 15);
              Color color1 = new Color(3,15,125);//A Dark Blue Color
              Color color2 = new Color(201,29,10);//A Red Color
              Color color3 = new Color(127,127,127);//A Grey Color
              //Create Buttons and Labels
             btn1 = new JButton("Submit");
             btn2 = new JButton("Display Schedule");
             btn3 = new JButton("Enter New Name");
             JLabel label1 = new JLabel("Student Name");
             JLabel label2 = new JLabel("Course Number");
              JLabel label3 = new JLabel("Welcome to the Java Community College");
              JLabel label4 = new JLabel("Registration System!");
              //Declare Text Field For Entering Student Names
              txt1 = new JTextField(15);
              //"Put Course Number from another Method Here"
              String[] courseStrings = { "CISM2230 A", "CISM2230 B", "CISM1110 A", "CISM1110 B", "CISM1120 A", "CISM1120 B" };
              JComboBox Combo1 = new JComboBox(courseStrings);
              //Declare Radio Buttons for Add and Drop Course
              radio1 = new JRadioButton("Add a Course", false);
              radio2 = new JRadioButton("Drop a Course", false);
              ButtonGroup radioButtons = new ButtonGroup();
              radioButtons.add(radio1);
              radioButtons.add(radio2);
              //Panel 10 is the Main Displaying Panel
              Panel10.add(Panel3, BorderLayout.NORTH);
              Panel10.add(Panel4, BorderLayout.CENTER);
              Panel10.add(Panel8, BorderLayout.SOUTH);
              //Panel 3 Used to Display Label 3 and 4 using Panels 1 and 2
              Panel3.add(Panel1, BorderLayout.NORTH);
              Panel3.add(Panel2, BorderLayout.CENTER);
              Panel1.add(label3);
             Panel2.add(label4);
              //Panel 4 Used to Display Student Name, Txt1, Course Number, Combo Box and Radio Buttons
             Panel5.add(label1, BorderLayout.NORTH);
             Panel5.add(txt1, BorderLayout.CENTER);
             Panel6.add(label2, BorderLayout.NORTH);
              Panel6.add(Combo1, BorderLayout.CENTER);
              Panel7.add(radio1, BorderLayout.NORTH);
              Panel7.add(radio2, BorderLayout.CENTER);
              Panel4.add(Panel5, BorderLayout.NORTH);
              Panel4.add(Panel6, BorderLayout.CENTER);
              Panel4.add(Panel7, BorderLayout.SOUTH);
              //Panel 8 Used to Display the Buttons
              Panel9.add(btn1, BorderLayout.CENTER);
              Panel9.add(btn2, BorderLayout.CENTER);
              Panel9.add(btn3, BorderLayout.SOUTH);
              Panel8.add(Panel9, BorderLayout.CENTER);
              //Setting Background, ForeGround and Font of all Text.
             Panel1.setBackground(color3);
             Panel2.setBackground(color3);
             Panel3.setBackground(color3);
             Panel4.setBackground(color3);
             Panel5.setBackground(color3);
             Panel6.setBackground(color3);
             Panel7.setBackground(color3);
             Panel8.setBackground(color3);
             Panel9.setBackground(color3);
             Panel10.setBackground(color3);
             btn1.setBackground(color3);
             btn2.setBackground(color3);
             btn3.setBackground(color3);
             radio1.setBackground(color3);
             radio2.setBackground(color3);
             btn1.setFont(font2);
             btn2.setFont(font2);
             btn3.setFont(font2);
             Combo1.setFont(font2);
             Combo1.setBackground(color3);
             Combo1.setForeground(color1);
             label1.setFont(font2);
             label2.setFont(font2);
             label3.setFont(font1);
             label4.setFont(font1);
             label1.setForeground(color2);
             label2.setForeground(color2);
             label3.setForeground(color1);
             label4.setForeground(color1);
             container.add(Panel10);
              //Setting Keyboard Shortcuts to Radio Buttons and Regular Buttons
              btn1.setMnemonic('S');
              btn2.setMnemonic('D');
              btn3.setMnemonic('E');
              radio1.setMnemonic('A');
              radio2.setMnemonic('C');
              //ActionListener
              btn1.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()){ System.out.println("Radio Button 1 is selected. Button 1")};
                   if (radio2.isSelected()){ System.out.println("Radio Button 2 is selected. Button 1")};
              btn2.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
              private void btn2actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected(Button 2).");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.Button 2");
              btn3.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn3actions() {
                   txt1.setText("");
                   txt1.requestFocus();
         public static void main(String[] args) {
             JavaCollegeTest2 frame = new JavaCollegeTest2();
             frame.setTitle("Project 4");
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             frame.setSize(400, 300);
             frame.setLocation(400,400);
             frame.setVisible(true);
    }

  • Need a little help with AE

    Hi all, I’m having a little issue with After Effects. I’m a second year Computer Games Design Student and I’m in the process of wrapping up my various modules for the year.
    One of my modules is 3D and animation, I’ve rendered my final animation out as PNG’s. There are enough to run at 24 frames a second to suit the 22 second audio clip. When I put the images into After Effects as a PNG sequence the sequence is only 18 seconds long, and renders out at 18 seconds.
    I set the composition to 22 seconds long and made the frame rate 24 seconds when I first started the comp. I have a layer of the PNG’s ( The frames you’ll see) and a second layer of PNG’s (A Zdepth render from 3D Studio Max) to create a depth of field effect.
    How do I get those PNG’s to render out at the speed I want? They always render out too quickly.
    This will probably turn out to be something really simple, I apologise if it is! I tried looking online for other people asking, but I’ve got too many deadlines in the next week and can’t afford to spend time looking around. I’d greatly appreciate if someone could give me a hand.
    Thank you.

    Make sure that you're interpreting the still-image sequence footage item at the right frame rate. Read this page.

  • Uh oh. Need a little help with my account please

    Ok. So my user name freaked out (I didn't notice it at the time) and now it's back to normal but with no points or posts.
    Can someone give me a hand getting this fixed please? Thanks
    THAI should be me: http://forums.adobe.com/people/~graffiti
    But this is the wacked out one that shows all my points and posts: http://forums.adobe.com/people/~graffiti-BHnWiM

    Man. That one could use some translation.
    Here's what I did. I closed the browser, remove ALL cookies. So far, so good.
    Came back in through www.adobe.com and clicked the forum link under support. Clicked on log-in/register, did not select remember me.
    Used the sign-out link at the top of the page.
    Ok, if all is working right I should be able to close the browser, come back to the forums and would have to log-in, right?
    Well here I am, already logged in.
    So I've tried all the steps as far as they actually worked, What next?

  • Need a little help with bookmarks please

    hi folks. in my old days of windows internet explorer favorites i could put the list of favorite websites in the order i wanted from top to bottom. when i click on popular in safari i haven't found a way to do that. can anyone help? in other words i want the bookmark that is currently at the bottom of the list to be closer to the top. thanks for any help.

    HI,
    Just drag the Bookmarks in the order you want them.
    You can create a "collection" of Bookmarks in a folder, drag that folder to the Desktop where the Finder will automatically alphabetize them then drag the folder back to the Safari window.
    How to manage Safari Bookmarks
    More help here: http://osxhelp.com/mastering-safari-learning-now-to-manage-and-tame-your-bookmar ks/
    Carolyn

  • Need a Little Help with Understanding How Layers Work in PSE

    I have PSE version 5 and I am using it on a PC with Windows XP.
    As I get more into editing photos, I am enjoying it, but confusion is also starting to set in.  My question is about layers.  When I go to edit a photo for web/email use only, I start by resizing it to 72 ppi and then reducing the pixel dimensions quite a bit.  Then after that I normally go through this process of editing the photos by using normally about three different commands.  One is Levels, then I may go to Shadows/Highlights, and then my last command is always sharpening.  I used to do this all on one layer, but then finally learned to put each one of these editing features on their own layer so I can make changes/deletions without too much trouble.
    When I started doing the separate layers, I was just making a copy of the background layer each time and then touching that particulay layer up with Levels, Sharpen or Shadows/Highlights.  But I noticed that depending on the order in which the layers were placed, some changes would be obscured.  If I put the Levels layer on top, and then the Sharpen layer and the Shadows/Highlight layer below that, the sharpen effect and the shadows/highlights effects were no longer there.  I could only see the levels effect.  The photo was still not sharp and so on.  If I put the Sharpen level on top, then the photo showed the sharpen effects, but now the Levels and Shadows/Highlights effects were no longer visible.
    So then I started to make a copy of the background initially, do a levels adjustment here, then, instead of making a copy of the original background layer again, I would make a copy of the layer that now has the levels changes on it.  Then do the sharpen effect on this layer.  This way I had all the changes on one layer as long as I put that layer as the top layer.  But then I realized that I once again fI didn't have a layer with only one fix on it.   Finally, I started to use an adjustment layer for Levels, put this as the top layer, make a copy of the background layer, do shadows/highlights, copy background layer again, do sharpen, and this seems to work a little better.  But even with this way, depending on what order I place the sharpen and shadows/Highlights layers, one of them still seems to get obscured by the layer above it.
    Can someone help me to understand how layers work in this regard.  I am obviously a little confused here.
    Thanks,
    Lee

    You really aren't working efficiently. First of all, do your editing on a full sized version of the photo, since you have more data for PSE to work on and will get better results. Use save for web to make your web/email copy when you are totally done. You can resize it down on the right side of the save for web window.
    Duplicating a regular layer makes an opaque layer that obscures the layers below it. It's best to start off by not working on your original image, so that you don't have to worry if you mess up. If you're working on a copy, you can work right on the background layer, or only duplicate the layer once and apply your changes to that. So you'd apply both shadows/highlights and sharpening to the same layer.
    Finally, you should use an adjustment layer for levels. Layer>New Adjustment Layer>Levels. This will put levels on a transparent layer above your image, but you will need to click the layer below it to get back to a pixel layer to apply other changes (you can't sharpen an adjustment layer, for example).

  • Need a little help with FLASH

    Hi every one
    I am a very new to using flash 8 and I need som help.
    I know that it mifgt be a simple for some of you but for me it is a chlange...
    I need to create a page with 6 buttons
    I can create a button no problem and i can incer scrupt and it will open url
    However if I have 4-5 buttons  every thing work  up , down over etc but script do not work so link do not oupe page..
    I am sure it is a simple soluton to this issue
    Please HELP
    I  like to attach .fla file to show what I was doing but it seem that is not possible.....
    Any way Please help if u can
    Sincerely
    L.

    Thanx
    I had try to uploaded samplle .fla file however i could not found the way of doin it...
    However in this post it is at the buttom of the text  box......
    Here is ths sample button file, however thisis not what reat will be.
    Project  wil have a art work split in 8 sements six of then will akc as a a buttons with over and down efferct
    the button name and function will be shown as you mouse over the segment...
    in the  sample i just placed 4 buttons  2 and 2 in one I am working on is  2 colomn of 3 segments
    I hope this can help.. to get understanding what i am trying to do..
    Thanx again for you respond
    Oh  .fla has script I use ( and it is not working on multy buttons only on on button)
    I colud not upload .fla file  here is script i use for ever button
    I had try to gave numerical identety to very button
    like this:
    button1
    myButton.onRelease = function(){
    getURL('http://www.aol.com');
    Button2
    myButton1.onRelease = function(){
    getURL('http://www.aol.com');
    and so on 4 buttons in 2 rows... see file
    Lev..
    Message was edited by: Levsky

  • Need a little help with JFrame

    I have looked all over the net for my answer but guess i am just not putting two and two together.
    I want to be able and edit the size of this JFrame but can not figure out how to set the default size and i know it is something simple but just a little over my head as i am a newb. I appreciate any help offered.
    class Browser extends JFrame {
         private JButton button;
         public Browser() {
              button = new JButton("Open Browser");
              this.getContentPane().add(button);
              this.pack();
              this.setSize(500, 600);
              this.setLocationRelativeTo(null);
              this.setDefaultCloseOperation(EXIT_ON_CLOSE);
              this.setTitle("Browser Demo");
    Thanks again for your help.

    iheartgeeks wrote:
    I would suggest using GridBagLayout - this will allow you to specify the position of your components in the frame.As do all layout managers, to some degree.
    As Michael_Dunn said, you're using two sizing methods which are, I suspect, giving you undesirable results. Delete the pack and see what happens. Delete the set size and see what happens. If you need further assistance, trying being more specific about the expected results, desired results and actual results.Good try, but not quite there.
    Swing has a couple ways to specify component sizes:
    PreferredSize -- This is the size some layout managers (pretty much anything but Grid) use to determine a default starting size when computing your layout. Most components will calculate this for you without you doing anything.
    MinimumSize & MaximumSize -- Self explanatory
    Size -- The current size of the component. This will be probably be wiped out when any layout managers start messing around with your frame
    the .pack() call is actually more important than you think. It will compute the smallest container size that allows your components to be sized to at least their preferredSize. Note that this must be done before making the frame visible
    So in short, when setting up a Swing layout
    1) If you're using GridLayout, don't bother setting PreferredSize, everything gets the same size; otherwise, don't set PreferredSize explicitly until you need to.
    2) Call frame.pack() before frame.setVisible()
    3) Run your gui and see what happens. At this point, if any components need to have their PreferredSize set, do it now.

Maybe you are looking for

  • Ipod nano not recognised in windows or itunes have done R&R twice

    I have had ipods from the beginning of time. trying to sync brand new gen 6 nano without any success. My ipad works OK. can any one help?

  • Upgrade from CF 8 to CF 10 Enterprise or Standard?

    Trying to decide whether to go with CF10 Enterprise or Standard. If we were to develop our web applications using the additional features that only Enterprise provides and a client wants to host the site on their own server, would they have to be lic

  • Standard movement to transfer blocked batches to a different plant/center

    I am trying to transfer blocked batches to a different plant/center where it is (from 2000 to 3000). Is there any standard movement which allows to move blocked batches to another plant/center without unblocking them? Thank you in advance. Edited by:

  • Can not open app store on macbook air 2013

    I just bought a 2nd Macbook Air 2013 using OS X 10.9.2 (13C64), but don:t know why I can't open the App Store on my macbook without any notifications when I click on the icon. Anyone can let me know what's the problem and what should I do now? Thank

  • Getting back deleted files

    I feel like an idiot! I needed to use my sons iPod to move large files over from one windows computer to another. When I pluged the iPod into the computer, it asked my if I wanted to format it, I clicked yes, and yes. I was wrong, I deleted all of hi