Simple algorithm help to replace hardcoding
How can this be simplified into simple algorithm?
public void AI() {
count++;
if (count > 4 && randomMoveDecider() == true) {
randomMove();
} else if (buttons[1].getText().equals("O") && buttons[2].getText().equals("O") && buttons[3].getText().equals("")) {
buttons[3].setText("O");
buttons[3].setEnabled(false);
board.setButton3("O");
} else if (buttons[4].getText().equals("O") && buttons[5].getText().equals("O") && buttons[6].getText().equals("")) {
buttons[6].setText("O");
buttons[6].setEnabled(false);
board.setButton6("O");
} else if (buttons[7].getText().equals("O") && buttons[8].getText().equals("O") && buttons[9].getText().equals("")) {
buttons[9].setText("O");
buttons[9].setEnabled(false);
board.setButton9("O");
} else if (buttons[2].getText().equals("O") && buttons[3].getText().equals("O") && buttons[1].getText().equals("")) {
buttons[1].setText("O");
buttons[1].setEnabled(false);
board.setButton1("O");
} else if (buttons[5].getText().equals("O") && buttons[6].getText().equals("O") && buttons[4].getText().equals("")) {
buttons[4].setText("O");
buttons[4].setEnabled(false);
board.setButton4("O");
} else if (buttons[8].getText().equals("O") && buttons[9].getText().equals("O") && buttons[7].getText().equals("")) {
buttons[7].setText("O");
buttons[7].setEnabled(false);
board.setButton7("O");
} else if (buttons[1].getText().equals("O") && buttons[3].getText().equals("O") && buttons[2].getText().equals("")) {
buttons[2].setText("O");
buttons[2].setEnabled(false);
board.setButton2("O");
} else if (buttons[4].getText().equals("O") && buttons[6].getText().equals("O") && buttons[5].getText().equals("")) {
buttons[5].setText("O");
buttons[5].setEnabled(false);
board.setButton5("O");
} else if (buttons[7].getText().equals("O") && buttons[9].getText().equals("O") && buttons[8].getText().equals("")) {
buttons[8].setText("O");
buttons[8].setEnabled(false);
board.setButton8("O");
} else if (buttons[1].getText().equals("O") && buttons[4].getText().equals("O") && buttons[7].getText().equals("")) {
buttons[7].setText("O");
buttons[7].setEnabled(false);
board.setButton7("O");
} else if (buttons[2].getText().equals("O") && buttons[5].getText().equals("O") && buttons[8].getText().equals("")) {
buttons[4].setText("O");
buttons[4].setEnabled(false);
board.setButton4("O");
} else if (buttons[3].getText().equals("O") && buttons[6].getText().equals("O") && buttons[9].getText().equals("")) {
buttons[9].setText("O");
buttons[9].setEnabled(false);
board.setButton9("O");
} else if (buttons[4].getText().equals("O") && buttons[7].getText().equals("O") && buttons[1].getText().equals("")) {
buttons[1].setText("O");
buttons[1].setEnabled(false);
board.setButton1("O");
} else if (buttons[5].getText().equals("O") && buttons[8].getText().equals("O") && buttons[2].getText().equals("")) {
buttons[2].setText("O");
buttons[2].setEnabled(false);
board.setButton2("O");
} else if (buttons[6].getText().equals("O") && buttons[9].getText().equals("O") && buttons[3].getText().equals("")) {
buttons[3].setText("O");
buttons[3].setEnabled(false);
board.setButton3("O");
} else if (buttons[1].getText().equals("O") && buttons[7].getText().equals("O") && buttons[4].getText().equals("")) {
buttons[4].setText("O");
buttons[4].setEnabled(false);
board.setButton4("O");
} else if (buttons[2].getText().equals("O") && buttons[8].getText().equals("O") && buttons[5].getText().equals("")) {
buttons[5].setText("O");
buttons[5].setEnabled(false);
board.setButton5("O");
} else if (buttons[3].getText().equals("O") && buttons[9].getText().equals("O") && buttons[6].getText().equals("")) {
buttons[6].setText("O");
buttons[6].setEnabled(false);
board.setButton6("O");
} else if (buttons[1].getText().equals("O") && buttons[5].getText().equals("O") && buttons[9].getText().equals("")) {
buttons[9].setText("O");
buttons[9].setEnabled(false);
board.setButton9("O");
} else if (buttons[5].getText().equals("O") && buttons[9].getText().equals("O") && buttons[1].getText().equals("")) {
buttons[1].setText("O");
buttons[1].setEnabled(false);
board.setButton1("O");
} else if (buttons[1].getText().equals("O") && buttons[9].getText().equals("O") && buttons[5].getText().equals("")) {
buttons[5].setText("O");
buttons[5].setEnabled(false);
board.setButton5("O");That is only some of it. :(
But the point is for the AI to check the grid on a tic tac toe grid 3/3 and make the best move(win or stop wins)
tjacobs01 wrote:
private boolean buttonTest(JButton button1, JButton button2, JButton button3) {
if (button1.getText().equals("O") && button2.getText().equals("O") && button3.getText().equals("")) {
button3.setText("O");
button3.setEnabled(false);
return true;
return false;Edited by: tjacobs01 on Dec 4, 2009 1:39 PMGreat ;)
Similar Messages
-
Need Help in Replacement of Function Modules
Hello all,
I am working on Upgrade project from ECC 5.0 to ECC 6.0. I am facing problems for Replacement of two Obsolete Function Modules. Please give me a solution. FM's are as follows.
1) SET_AUTHORITY : This FM is obsolete in ECC 6.0 and there is not alternative FM present in help.sap.com or any other web portal.
2) WS_QUERY : Here as per my knowledge we use class CL_GUI_FRONTEND_SERVICES and methods FILE_EXIST or DIRECTORY_EXIST as per the parameters in old FM. For parameter 'FS' we use 'FILE_EXIST' and 'DS' we use 'DIRECTORY EXIST'.
But in our program prev. FM has parameter 'OS' i.e. Operating System.
But there is not method called 'OS EXIST' or similar. Please suggest suitable method.
Thanking you all in anticipation.
Best Regards,
HarishHi Harish,
I too could not find any replacement for SET_AUTHORITY
Obsolete Modules can be used in newer versions, but it is not supported by SAP in case of any technical issues.If you still need a replacement, you can replace it by the source code in the FM SET_AUTHORITY itself and modify according to your needs.
Below is the source code of FM SET_AUTHORITY, so you can modify it according to your requirement.
DATA: l_actvt TYPE tact-actvt,
l_hier TYPE STANDARD TABLE OF sethier WITH HEADER LINE.
CASE action.
WHEN 'A '.
l_actvt = activity-add.
WHEN 'C '.
l_actvt = activity-modify.
WHEN 'D '.
l_actvt = activity-display.
WHEN 'E '.
l_actvt = activity-delete.
WHEN 'UD '.
l_actvt = activity-display.
ENDCASE.
CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
no_descriptions = 'X'
no_rw_info = 'X'
setid = set
tabname = table
root_header_only = 'X'
TABLES
set_hierarchy = l_hier
EXCEPTIONS
OTHERS = 0.
READ TABLE l_hier INDEX 1.
IF sy-subrc <> 0.
CLEAR l_hier.
l_hier-shortname = set.
ENDIF.
CALL FUNCTION 'G_SET_AUTHORITY_CHECK'
EXPORTING
actvt = l_actvt
authgr = l_hier-authgr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
CASE action.
WHEN 'A '.
MESSAGE e827 WITH l_hier-shortname RAISING no_authority.
WHEN 'C '.
MESSAGE e828 WITH l_hier-shortname RAISING no_authority.
WHEN 'D '.
MESSAGE e829 WITH l_hier-shortname RAISING no_authority.
WHEN 'E '.
MESSAGE e830 WITH l_hier-shortname RAISING no_authority.
WHEN 'UD '.
MESSAGE e831 WITH l_hier-shortname RAISING no_authority.
ENDCASE.
ENDIF.
If you need help in replacing in the above source code, please post your code here so that I can help you in modifying accordingly.
Regards,
Vasuki -
Mapping Help for replacing source value
Mapping Help for replacing source value
Posted: Mar 14, 2006 1:06 AM Reply
Hi all,
I am unable to do transform the source value to required target value,
From Source ADDRESS_TYPE = 'HOME' should be replaced with 03 to target field ANSSA, and 'MAIL' to be replaced with 05, I am trying to do it but i am unable to handle it, please give u r valuable suggestions,
The source structure is like this,
- <Event ID="239" TRANS_TYPE="ADR">
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="HOME" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="HOME" KEY3="02/10/2006" />
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="MAIL" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="MAIL" KEY3="02/10/2006" />
</Event>
REGARDS,
sridharHi,
This can be done using user-defined function as well.
Code the function as...
if(Addr_Type.equals("HOME"))
return "03";
else if(Addr_Type.equals("MAIL"))
return "05";
else
return "Invalid Address Type";
Here, Addr_Type is Input String Argument for this function.
Map this function between ADDRESS_TYPE and ANSSA.
Regards,
Uma -
I need some help with my 3 class hangman program.
whenever the program is run, it doesn't function as intended when a letter is entered. Any advice is greatly appreciated.
Here's what I have so far:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
//<applet code="Hangman.class" width=400 height=400>
//</applet>
public class Hangman extends JApplet implements ActionListener
private final int WIDTH = 400;
private final int HEIGHT = 400;
private JPanel panel,tools;
private JLabel inputLabel;
private Hang drawing;
private JTextField guess;
RandomWord t = new RandomWord();
public String answer = t.getWord();
public void init()
tools = new JPanel();
tools.setLayout(new BoxLayout(tools,BoxLayout.X_AXIS));
tools.setBackground(Color.yellow);
tools.setOpaque(true);
guess = new JTextField(1);
guess.addActionListener(this);
inputLabel = new JLabel("Enter Guess:");
tools.add(inputLabel);
tools.add(guess);
drawing = new Hang();
panel = new JPanel();
panel.add(tools);
panel.add(drawing);
getContentPane().add(panel);
setSize(WIDTH,HEIGHT);
public void actionPerformed(ActionEvent event)
String g = guess.getText();
int incorr = 0;
int c = 0;
int i;
for(i = 0;i<answer.length();i++)
if((answer.substring(i,i+1)).equals(g))
c++;
drawing.setLetter(i,g);
if(c == 0)
incorr++;
drawing.setIndex(incorr);
repaint();
// class number 2:
import java.awt.*;
import javax.swing.JPanel;
public class Hang extends JPanel
private final int PAN_HEI = 400;
private final int PAN_WID = 400;
private int index;
private int posNum,corr = 0;
private String print;
public Hang()
setBackground(Color.black);
setPreferredSize(new Dimension(PAN_WID,PAN_HEI));
public void setIndex(int v)
index = v;
public void setLetter(int y,String s)
print = s;
posNum = y + 1;
public void drawBase(Graphics page)
setBackground(Color.white);
page.setColor(Color.black);
page.fillRect(0,350,150,50);// base
page.fillRect(0,150,25,200);
page.fillRect(0,125,100,25);
page.setColor(Color.gray);
page.fillRect(84,125,7,50);// rope
page.setColor(Color.black);
page.drawOval(75,175,24,25);// head
page.drawLine(250,55,255,55);
page.drawLine(260,55,265,55);
page.drawLine(270,55,275,55);
page.drawLine(280,55,285,55);
page.drawLine(290,55,295,55);
page.drawLine(300,55,305,55);
page.drawLine(310,55,315,55);
public void paintComponent(Graphics page)
super.paintComponent(page);
this.drawBase(page);
if(index == 1)
page.drawLine(84,200,84,250);
if(index == 2)
page.drawLine(84,215,34,175);
if(index == 3)
page.drawLine(84,215,116,175);
if(index == 4)
page.drawLine(84,250,50,300);
if(index == 5)
page.drawLine(84,250,100,300);
page.drawString("You Lose",250,75);
if(posNum == 1)
corr++;
page.drawString(print,250,50);
if(posNum == 2)
corr++;
page.drawString(print,260,50);
if(posNum == 3)
corr++;
page.drawString(print,270,50);
if(posNum == 4)
corr++;
page.drawString(print,280,50);
if(posNum == 5)
corr++;
page.drawString(print,290,50);
if(posNum == 6)
corr++;
page.drawString(print,300,50);
if(posNum == 7)
corr++;
page.drawString(print,310,50);
if(corr == 7)
page.drawString("You Win",250,75);
//last class :
import java.util.Random;
public class RandomWord
Random g = new Random();
String w1;
String w2;
String w3;
String w4;
String w5;
String w6;
String w7;
String w8;
public RandomWord()
w1 = "freedom";
w2 = "justice";
w3 = "impulse";
w4 = "destiny";
w5 = "celsius";
w6 = "ignited";
w7 = "believe";
w8 = "realize";
public String getWord()
String x = " ";
int a = g.nextInt(6);
if(a == 0) x = w1;
if(a == 1) x = w2;
if(a == 2) x = w3;
if(a == 3) x = w4;
if(a == 4) x = w5;
if(a == 5) x = w6;
if(a == 6) x = w7;
if(a == 7) x = w8;
return x;
}I'm a very inexperiencd programmer as you can see.Darn, I thought you actually needed algorithm help. But instead all I see is:
"Here's all my code. It doesn't work right. Let me plop it onto your virtual desk and ask that you just fix it for me. I'm going shopping (or whatever) and will be back soon." -
Hi gooday all , I need a help in replacing the phonenumber country code to 0 where the combinations in my source can be 0044,+0044,44,+44,004400. All the above combinations need to be replaced with 0 . Any help in this regard is appreciated . Thanks in Advance. Omprakash.
맥심카지노ホ【TOP015、C0M【ホ바카라사이트맥심카지노ホ【TOP015、C0M【ホ바카라사이트【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노맥심카지노ホ【TOP015、C0M【ホ바카라사이트【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노【맥심카지노
-
Hi when i send imessages it keeps showing up as my email address on the receiving device. I know its something simple! Help please.
Hi Megamanfx,
If you are having issues with the Sent From settings in iMessage on your iPhone, you may find the following article helpful:
iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
http://support.apple.com/kb/HT5538
Regards,
- Brenden -
all of my contacts, music etc has vanished from itunes. have no idea why? can anyone help. apple replaced my iphone 4 handset today as it was faulty. i did sync the old phone before i gave it back to them. can anyone help?
Backup, backup, backup...
T-21 wrote:
Hello.
I did not touch my computer the past week, I've only been messing with my laptop. I had my computer off a whole day. I turn it on, open iTunes, and everything is gone.
Is your laptop a different computer than your computer?
You have two computers?
iTunes is missing everything from which one/both?
I system restore. Everything is gone. None of my podcasts, apps, or music files are there.
Do you mean you reinstalled the system from scratch?
Yes, that tends to delete everything.
Or you restored everything from a backup?
Directions on where to go to download all past purchases?
Selete Store on the left side of iTunes.
Make sure you are signed in.
Click on Purchased on the right side under Quick links to redownlaod your purchases.
Then make sure to regularly backup, backup, backup all your important data . -
Developing a Payroll System with NSD - A simpler algorithm in Java?
Hi,
I've been trying to develop a payroll system but I'm having some challenges on "trapping" the Night Shift Differential for all shifts.
I'm from the Philippines and our NSD starts from 10pm - 6am by law.
This payroll system is supposed to accept any shifts: day or night; 8-hour shifts, more or less than 8-hour shifts... making it dynamic in a sense.
I've tried to evaluate each possible shift by start time and end time against the NSD's start time and end time. The result is a lot of "if-else" statements and some deep nesting.
I'd like to know if there's a simpler algorithm for this in Java to "trap" the NSD from 10pm - 6am no matter what shift that "intersects" with it? Just so to have lesser complexity and better maintainability.
Thanks.morphian wrote:
abillconsl wrote:
morphian wrote:
Not yet. I'm still working on the codes for computations.Where's the data? If it is not in a database, then where is it?I'm using test cases.Okay ... where was I going with my line of questioning? ... It is just this - if you know where your data is coming from and what form it is in, it can make a difference in how you proceed.
If you are working on Payroll data, nowdays it makes sense to imagine some relational DB containing the data. If that is the case, then knowing the structure of that data is absolutely paramount.
For example - I really can't imagine doing this with times of day. In a well conceived DB structure, employees would likely be assigned some employee classification, based on a coding structure of some kind ... NS, DS, FT, PT ... etc. This might be broken down further by other classifications such as Primary vs Secondary job, salaried vs hourly workers, earning codes, whatever.
So rather than working with times, you'd find the classifications of your employees and them perhaps add their hours or whatnot.
So you see, it makes all the difference.
~Bill -
Logic Execution Algorithm - Help
Help for me - Logic Execution Algorithm
Considering the Execution Sequence 1: Consider the following information in the table GBI_PAR_DEFINE_ROTA parameterized.
The required fields are filled in by users: Required_Res_1 and one of the fields:
Product_id, customer_id or Sales_Order_No.
Off the field will only be filled with the value N if you want to disable the rule. If the value of the rule is N, the routine being developed disregard the rule.
REQUIRED_RES_1 PRODUCT_ID SALES_ORDER_NO CUSTOMER_ID OFF
P_P_LAM2 P_289874 18669437-20 WHGA
Step 1: Find Table MP_WO_REP which records have sales order number 18669437-20.
Step 2: Within these sales orders, search through the table Works_Operation which ones have the field Product_ID = P_289874.
Step 3: Restrict further data selection Sales_Order searching the table, which of them belong to the client WHGA.
Step 4: In the records remaining in the table Works_Operation verify which code Alternate_Pref whose field Required_Res_1 equals P_P_LAM2. If more than one return Alternate_Pref (different) for the same product_id Required_Res_1 and generate a table of error called GBI_ERR_ALTERNATE_PREF, containing the following information: Required_Res_1, Works_Order and product_id. If this error occurs, the following steps should not be performed.
Step 5: In the remaining records, delete those records whose field Alternate_Pref is different from the value returned in Step 4. IMPORTANT NOTE: The records can only be deleted if they exist for the same product_id Alternates_Prefs different. These same deleted records should be inserted in the table Works_Operation_Rota_Excluida.
Step 6: Deleted records Works_Operation table must also be deleted from the table Works_Op_Char. Fields of connection between these two tables are: Works_Order_No, Version_No, Works_Op_No, Alternate_Pref and Op_Proc_No. Deleted records will be recorded in the table Works_OP_Char_Rota_Excluida.I did not offer an opinion.
You have what is called a technical or program specification. It describes the programming steps that need to be designed and written. This is exactly what programmers do. And your seeming inability to do this, points to the fact that you are not a programmer. That is the issue you need to address - instead of looking for so-called algorithmic logic.
Simple and basic approach. Take step 1. Write SQL code that satisfies the requirements and outputs of that step. E.g.
Step 1: Find Table MP_WO_REP which records have sales order number 18669437-20.
Code: select * from mp_wo_rep where sales_order = '18669437-20'
Do the same for step 2. And the remaining steps
You now have the basic code template required to perform these steps. The next actions are:
Modularising the code (instead of a hardcoded sales order number, support specifying it as a parameter).
Simplify the code (by combining and integrating processing steps). Real programming is said to be the act of removing program source code statements, and not writing them. -
Help using -replace with wildcard characters, specifically braces
Hello all,
Needing help in using -replace with literal wildcard characters, specifically the braces characters. From reading old posts online this seems to have been a notorious shortcoming of PowerShell, but not sure if it's been resolved or not. My simple
code tries to remove the braces as follows (would like to keep the foreach loop and everything as is if possible):
$string = "test[]"
$braces = @("``[","``]")
Foreach($brace in $braces){
If($string -like "*$brace*"){
$string = $string -replace ($brace,"")
write-host $string
This code gives an error at the -replace line, saying "The regular expression pattern `] is not valid." I'm not sure how to pass the literal brace characters to the -replace parameter? Can this be done?-like is a wildcard operator (it recognized wildcard patterns like * ,? and [a-z].
For a regular expression you use the -match operator.
Wildcard patterns and regular expressions are not interchangeable.
See:
get-help about_wildcards
get-help about_regular_expressions
for an explanation and examples of each one, and
get-help about_comparison_operators
for examples of using -like and -match.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
Hallo!
I have a question for you!
I have a PowerMac G5 (2003) with cpu PPC G5 970 (v.2.2) 2GHz as seen in System Profiler;
My Mac is a Dual processor, but one CPU is brocken and today it runs with only one CPU.
Now I want to buy the second CPU in ebay, to replace the second CPU broken, but I can't find nothing of clear in apple part number, in fact I Have a CPU 630-4890.
Reading service manual I think that I must search a 661-2901, but i don't know if this is correct!
There is someone that can help me in this choice?
Thank a lot!
PaoloLook at the model number like the other member said to do . But it you change out the cpu yuo need to re calibrate the fans on it . You need the dvd that will re calibrate the fans for the new processor . The apple service diagnostic disk or better know as the thermal calibration of the fans . Thats a must or I think you will burn up the new processor .
get a service manual plus the disk I told you about . Goto ebay for that . -
Simple button help needed!
I want to make a simple round button that glows when you
mouse over it and depresses when you click it.
Apparently to do this I need to use Filters to make the glow
and bevels. But Filtersonly work on movie clips, buttons and text.
So I make a circle and convert it into a button symbol
(Btn1). Then I make another button symbol (Btn2) and use the first
button symbol (Btn 1) on the Up Over and Down frames of Btn 2.
Assorted Filters are applied to Btn 1 on the Up Over and Down
frames to get the effects I want.
I test the button (Btn2) using Enable Simple Buttons. It
works perfectly - glows on mouse over and depresses on click. Then
I try Test Movie -- and the button doesn't work!!!
Not does it work when exported as a SWF file!!!
I watched a tutorial video that came with my Flash Pro 8
Hands-On-Training (HOT) book and he used pretty much the same
technique -- except he only tested his button with Enable Simple
Buttons. I'll bet my house his didn't work with Test Movie either!
The stupid thing, is I was just able to achieve exactly what
I wanted very quickly using LiveMotion 2!
What is wrong here? Why is it so impossible to create a glow
button in Flash? Why has it been easy in Live Motion for years?
All help appreciated!
Thanks
craigI thought the nesting button situation might be the problem
BUT there is no other way to apply Filters to Up, Down, etc. Also,
a freaking tutorial book described that as a valid method, but
obviously it ain't.
I tried using movieclips as well but basically had the same
problem.
I mentioned LiveMotion 2 because that ancient program can do
easily what Flash Pro 8 seems incapable of.
What is the logic behind not allowing Filters to be applied
to simple graphics? It's absurd!
There's got to be a way... -
Hi
I am new to flash and having a bit of trouble. All I would
like to do is be able to create a button and have that button
navigate to a frame.
What I am doing now is:
Insert - New Symbol - Button and name the button (ex: about)
Go through the up/over/down/hit steps and return to scene 1
I then drag the about button onto the stage
I give the about button the instance name of about_btn
In the action layer, I enter the following code:
stop();
_root.about_btn.onRelease = function(){
gotoAndStop("about");
"about" being the keyframe I would like to go to
When I test the button, I get error 1120: "Access of
undefined property onrelease".
I am working on adobe flash cs3 on a pc. I know this is a
very simple issue and any help would be greatly appreciated.
Thank you.what have you done so far? what don't you know how to do?
where are you stuck at? need way more detail to help any
further. -
Need help to replace hexadcimal character in flat file
Hi,
I am loading data from flat file.
My flat file contains some hexadecimal characters.
Hence when I load the data the load fails.
I have checked many routines on SDN but could not get exact solution.
Actually in some of my fields TAB or CARRIAGE RETURN symbols are coming.
I want to write a simple routine in start routine of transfer structure. It will be # in PSA if I load the data till PSA.
can anyone help me?
Thanks & Regards,
Rashmi.hi Rashmi,
validate the data in flat file itself else you can edit the data in PSA while loading else you can allow the data is RSKC by specifying ALL_CAPITAL and execute .
Assign Point if useful
Ramesh -
Help with Replacing text in a file using a vbscript
I have the following script which I am wanting to
1. Take the prf file and read it
2. Edit a line in the outlook .prf file replacing it with the text I have asked it to replace which is the full name of the user pulled from the currently logged on user
The problem I am seeing is that when the temp file is being generated it is throwing off the formatting of the file hence the script doesn't work. Can anyone help me please.
set objSysInfo = CreateObject("ADSystemInfo")
struser = objSysInfo.Username
set objUser = GetObject("LDAP://" & strUser)
strFullName = objUser.Get("displayName")
Const ForReading=1
Const ForWriting=2
Set objFSO = CreateObject("Scripting.FileSystemObject")
folder = "C:\test"
'filePath = folder & "file.txt"
filePath = "c:\test\test2007_3.prf"
Set myFile = objFSO.OpenTextFile(filePath, ForReading)
Set myTemp= objFSO.OpenTextFile(filePath & ".tmp", ForWriting, True)
Do While Not myFile.AtEndofStream
myLine = myFile.ReadLine
If InStr(myLine, "MailboxName=%UserName%") Then
myLine = "&strFullName"
End If
myTemp.WriteLine myLine
Loop
myFile.Close
myTemp.Close
objFSO.DeleteFile(filePath)
objFSO.MoveFile filePath& ".tmp", filePath
ChristopherSorry Irv,
Here is the code I have and then after that is the prf file. I think there is an issue with the file structure because if I take a regular text file and add the lines in there myself it replaces the lines, but with the prf file or even the prf file as a
text file it gives me the invalid argument message
Const filePath = "c:\test\test2007_3.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set myFile = objFSO.OpenTextFile(filePath)
fileText = myFile.ReadAll()
myFile.Close
fileText=Replace(fileText,"%UserName%","THIS_IS_THS_REPLACEMENT_TEXT")
Set myTemp= objFSO.OpenTextFile(filePath, 2, True)
myTemp.Write fileText
myTemp.Close
;Automatically generated PRF file from the Microsoft Office Customization and Installation Wizard
; Section 1 - Profile Defaults
[General]
Custom=1
ProfileName=Somthing
DefaultProfile=Yes
OverwriteProfile=Yes
ModifyDefaultProfileIfPresent=false
DefaultStore=Service1
; Section 2 - Services in Profile
[Service List]
ServiceX=Microsoft Outlook Client
ServiceEGS=Exchange Global Section
Service1=Microsoft Exchange Server
ServiceEGS=Exchange Global Section
; Section 3 - List of internet accounts
[Internet Account List]
; Section 4 - Default values for each service.
[ServiceX]
CachedExchangeMode=0x00000002
CachedExchangeSlowDetect=true
[ServiceEGS]
CachedExchangeConfigFlags=0x00000900
MailboxName=%UserName%
HomeServer=
RPCoverHTTPflags=0x0027
RPCProxyServer=
RPCProxyPrincipalName=
RPCProxyAuthScheme=0x0001
[Service1]
OverwriteExistingService=No
UniqueService=Yes
MailboxName=%UserName%
HomeServer=
OfflineAddressBookPath=%USERPROFILE%\local settings\application data\microsoft\outlook\
OfflineFolderPathAndFilename=%USERPROFILE%\local settings\application data\microsoft\outlook\outlook.ost
AccountName=Microsoft Exchange Server
DefaultAccount=TRUE
;[ServiceX]
;FormDirectoryPage=
;-- The URL of Exchange Web Services Form Directory page used to create Web forms.
;WebServicesLocation=
;-- The URL of Exchange Web Services page used to display unknown forms.
;ComposeWithWebServices=
;-- Set to true to use Exchange Web Services to compose forms.
;PromptWhenUsingWebServices=
;-- Set to true to use Exchange Web Services to display unknown forms.
;OpenWithWebServices=
;-- Set to true to prompt user before opening unknown forms when using Exchange Web Services.
; Section 5 - Values for each internet account.
; Section 6 - Mapping for profile properties
[Microsoft Exchange Server]
ServiceName=MSEMS
MDBGUID=5494A1C0297F101BA58708002B2A2517
MailboxName=PT_STRING8,0x6607
HomeServer=PT_STRING8,0x6608
OfflineAddressBookPath=PT_STRING8,0x660E
OfflineFolderPathAndFilename=PT_STRING8,0x6610
[Exchange Global Section]
SectionGUID=13dbb0c8aa05101a9bb000aa002fc45a
MailboxName=PT_STRING8,0x6607
HomeServer=PT_STRING8,0x6608
RPCoverHTTPflags=PT_LONG,0x6623
RPCProxyServer=PT_UNICODE,0x6622
RPCProxyPrincipalName=PT_UNICODE,0x6625
RPCProxyAuthScheme=PT_LONG,0x6627
CachedExchangeConfigFlags=PT_LONG,0x6629
[Microsoft Mail]
ServiceName=MSFS
ServerPath=PT_STRING8,0x6600
Mailbox=PT_STRING8,0x6601
Password=PT_STRING8,0x67f0
RememberPassword=PT_BOOLEAN,0x6606
ConnectionType=PT_LONG,0x6603
UseSessionLog=PT_BOOLEAN,0x6604
SessionLogPath=PT_STRING8,0x6605
EnableUpload=PT_BOOLEAN,0x6620
EnableDownload=PT_BOOLEAN,0x6621
UploadMask=PT_LONG,0x6622
NetBiosNotification=PT_BOOLEAN,0x6623
NewMailPollInterval=PT_STRING8,0x6624
DisplayGalOnly=PT_BOOLEAN,0x6625
UseHeadersOnLAN=PT_BOOLEAN,0x6630
UseLocalAdressBookOnLAN=PT_BOOLEAN,0x6631
UseExternalToHelpDeliverOnLAN=PT_BOOLEAN,0x6632
UseHeadersOnRAS=PT_BOOLEAN,0x6640
UseLocalAdressBookOnRAS=PT_BOOLEAN,0x6641
UseExternalToHelpDeliverOnRAS=PT_BOOLEAN,0x6639
ConnectOnStartup=PT_BOOLEAN,0x6642
DisconnectAfterRetrieveHeaders=PT_BOOLEAN,0x6643
DisconnectAfterRetrieveMail=PT_BOOLEAN,0x6644
DisconnectOnExit=PT_BOOLEAN,0x6645
DefaultDialupConnectionName=PT_STRING8,0x6646
DialupRetryCount=PT_STRING8,0x6648
DialupRetryDelay=PT_STRING8,0x6649
[Personal Folders]
ServiceName=MSPST MS
Name=PT_STRING8,0x3001
PathAndFilenameToPersonalFolders=PT_STRING8,0x6700
RememberPassword=PT_BOOLEAN,0x6701
EncryptionType=PT_LONG,0x6702
Password=PT_STRING8,0x6703
[Unicode Personal Folders]
ServiceName=MSUPST MS
Name=PT_UNICODE,0x3001
PathAndFilenameToPersonalFolders=PT_STRING8,0x6700
RememberPassword=PT_BOOLEAN,0x6701
EncryptionType=PT_LONG,0x6702
Password=PT_STRING8,0x6703
[Outlook Address Book]
ServiceName=CONTAB
[LDAP Directory]
ServiceName=EMABLT
ServerName=PT_STRING8,0x6600
UserName=PT_STRING8,0x6602
UseSSL=PT_BOOLEAN,0x6613
UseSPA=PT_BOOLEAN,0x6615
EnableBrowsing=PT_BOOLEAN,0x6622
DisplayName=PT_STRING8,0x3001
ConnectionPort=PT_STRING8,0x6601
SearchTimeout=PT_STRING8,0x6607
MaxEntriesReturned=PT_STRING8,0x6608
SearchBase=PT_STRING8,0x6603
CheckNames=PT_STRING8,0x6624
DefaultSearch=PT_LONG,0x6623
[Microsoft Outlook Client]
SectionGUID=0a0d020000000000c000000000000046
FormDirectoryPage=PT_STRING8,0x0270
WebServicesLocation=PT_STRING8,0x0271
ComposeWithWebServices=PT_BOOLEAN,0x0272
PromptWhenUsingWebServices=PT_BOOLEAN,0x0273
OpenWithWebServices=PT_BOOLEAN,0x0274
CachedExchangeMode=PT_LONG,0x041f
CachedExchangeSlowDetect=PT_BOOLEAN,0x0420
[Personal Address Book]
ServiceName=MSPST AB
NameOfPAB=PT_STRING8,0x001e3001
PathAndFilename=PT_STRING8,0x001e6600
ShowNamesBy=PT_LONG,0x00036601
; Section 7 - Mapping for internet account properties. DO NOT MODIFY.
[I_Mail]
AccountType=POP3
;--- POP3 Account Settings ---
AccountName=PT_UNICODE,0x0002
DisplayName=PT_UNICODE,0x000B
EmailAddress=PT_UNICODE,0x000C
;--- POP3 Account Settings ---
POP3Server=PT_UNICODE,0x0100
POP3UserName=PT_UNICODE,0x0101
POP3UseSPA=PT_LONG,0x0108
Organization=PT_UNICODE,0x0107
ReplyEmailAddress=PT_UNICODE,0x0103
POP3Port=PT_LONG,0x0104
POP3UseSSL=PT_LONG,0x0105
; --- SMTP Account Settings ---
SMTPServer=PT_UNICODE,0x0200
SMTPUseAuth=PT_LONG,0x0203
SMTPAuthMethod=PT_LONG,0x0208
SMTPUserName=PT_UNICODE,0x0204
SMTPUseSPA=PT_LONG,0x0207
ConnectionType=PT_LONG,0x000F
ConnectionOID=PT_UNICODE,0x0010
SMTPPort=PT_LONG,0x0201
SMTPSecureConnection=PT_LONG,0x020A
ServerTimeOut=PT_LONG,0x0209
LeaveOnServer=PT_LONG,0x1000
[IMAP_I_Mail]
AccountType=IMAP
;--- IMAP Account Settings ---
AccountName=PT_UNICODE,0x0002
DisplayName=PT_UNICODE,0x000B
EmailAddress=PT_UNICODE,0x000C
;--- IMAP Account Settings ---
IMAPServer=PT_UNICODE,0x0100
IMAPUserName=PT_UNICODE,0x0101
IMAPUseSPA=PT_LONG,0x0108
Organization=PT_UNICODE,0x0107
ReplyEmailAddress=PT_UNICODE,0x0103
IMAPPort=PT_LONG,0x0104
IMAPUseSSL=PT_LONG,0x0105
; --- SMTP Account Settings ---
SMTPServer=PT_UNICODE,0x0200
SMTPUseAuth=PT_LONG,0x0203
SMTPAuthMethod=PT_LONG,0x0208
SMTPUserName=PT_UNICODE,0x0204
SMTPUseSPA=PT_LONG,0x0207
ConnectionType=PT_LONG,0x000F
ConnectionOID=PT_UNICODE,0x0010
SMTPPort=PT_LONG,0x0201
SMTPSecureConnection=PT_LONG,0x020A
ServerTimeOut=PT_LONG,0x0209
CheckNewImap=PT_LONG,0x1100
RootFolder=PT_UNICODE,0x1101
[INET_HTTP]
AccountType=HOTMAIL
Account=PT_UNICODE,0x0002
HttpServer=PT_UNICODE,0x0100
UserName=PT_UNICODE,0x0101
Organization=PT_UNICODE,0x0107
UseSPA=PT_LONG,0x0108
TimeOut=PT_LONG,0x0209
Reply=PT_UNICODE,0x0103
EmailAddress=PT_UNICODE,0x000C
FullName=PT_UNICODE,0x000B
Connection Type=PT_LONG,0x000F
ConnectOID=PT_UNICODE,0x0010
Christopher
Maybe you are looking for
-
Unable to get automatic event handling for OK button.
Hello, I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typin
-
Issue with lockscreen stuck displaying homescreen wallpaper iOS 8.2 iphone 5
By sliding the lockscreen in a quick random way, it displays the homescreen wallpaper whe still on the lockscreen. The time is still there and so is the slide to unlock but it stops me from sliding the screen and getting through. I remember this issu
-
Problem with synching audio with the metronome!/Background tracks
I'm trying to record a bassline (real bass) from my Lexicon Firewire interface (FW810S) into Logic Express 8. Even though I'm not hearing any latency with the playback, and I can totally play it on time, when I go to listen to it back, I hear the bas
-
How to change nickname when writing reviews in App Store?
Hi guys, I had an iTunes account that I don't use anymore but I want to use the nickname I had when writing the reviews in my new account, it won't let me chose it because it's already taken by my older account... Is there a way to change it? Thanks
-
Authorization Not to save Favorites
Hi all, is there authorization that prevents users from saving a favorite? They should be able to create a new view based on existing planning view template, make data changes, save data, but NOT be able to save a planning view favorite. I played wit