As3 compiler error
package{
import flash.display.Sprite;
public class test extends Sprite{
public function test(){
public function set data(val:XML):void{
private function foo(data:XML):void{
this.data=data; // compiler don't detect this error
This code have error (this.data=data) assing to noexist variable
but Flash Builder don't show error
one more compiler problem
package{
import menu.Foo;
public class Bar{
public function Bar(){
public function some():void{
var menu:int;
menu=1; // impossible use variable menu; compiler detect menu as package
// but declaration variable menu must hide outer package menu;
Similar Messages
-
Help- Components Throwing Compile Errors
Thank you for reading my issue. I am using Flash CS3.
Recently, all my projects began throwing compile errors for
standard component AS3 code.
UI Component, FLVPlayback.
I have uninstalled and reinstalled Flash CS3, but to no
avail. Problem persists
I keep getting errors involving "QNAN", which I think
involves trapping for a non-numeric value, or something.
As a test, I created a new Flash doc, placed an instance of
FLVPlayback on the stage, pointed it to a .FLV file in the same
directory.
Errors on compile:
1093: Syntax error.
1084: Syntax error: expecting rightparen before QNAN.
1093: Syntax error.
1084: Syntax error: expecting rightparen before QNAN.
And so on, I get 5 sets of the same errors for different
functions.
The first offending function above reads:
function queueCmd(param1:VideoPlayerState, param2:Number,
param3:Number = 1.#QNAN) : void
if (param1.cmdQueue == null)
param1.cmdQueue = new Array();
}// end if
param1.cmdQueue.push(new QueuedCommand(param2, null, false,
param3));
return;
}// end function
I get similar errors from my UI component AS3 as well.
I have not touched the shipped AS3 for these components. What
gives?
Any ideas?
Thanks
TimThanks, by the way to everyone who has offered thoughts so
far.
xchanin - I've encountered issues with the FLVPlayback
component as well as various of the UI components.
I tried some example applications (from the web) not too long
ago and this issue popped up shortly there after.
But, I'm having issues with even a simple Flash with a single
FLVPlayback instance and one .flv.
There is nothing in the class path for my test file and the
root .as files open from the Flash install when I click the compile
errors in the output window.
So, it really looks like I somehow corrupted those files. I
read a post somewhere that someone had "strange invisible
characters" show up in their .as that were throwing errors.
I thought a clean install would do the trick.
I may completely isolate the example files I was using and
try another reinstall... that's about all I can think of at the
moment.
This has been a couple week search for a solution. I have a
real project coming up an need to solve this.
Thanks for any input! (I assume I can't call Adobe for an
assist as I'm still on CS3 ;)
Tim -
Compile error on errorID ?
Start a new blank Flash 9/AS3 .fla in CS3,
Type in this code :
var _urlLoader:URLLoader = new URLLoader();
_urlLoader.addEventListener(IOErrorEvent.IO_ERROR,
_onXMLIOError);
function _onXMLIOError(e:IOErrorEvent):void
trace("Error = " + e.errorID);
Try to compile, got this compile error:
1119: Access of possibly undefined property errorID through a
reference with static type flash.events.IOErrorEvent.
Am I missing something here? In livedocs, it states clearly
that there is a public read-only property errorID in ErrorEvent
class, which is the parent class of IOErrorEvent.
Any clue? Thank a lot guys !!
WandiOld thread...but I encountered the same issue with
IOErrorEvent and was looking for a solution. I think I've found
it...
If you're looking at the LiveDocs for IOErrorEvent and have
inherited properties set to "show", you'll see a read-only property
named errorID. You'd think you should be able to access this
property, but you'd be wrong...
Navigate to the documentation for the parent object,
ErrorEvent. You'll see errorID is labeled as an "Air-Only"
attribute. This means it won't work in your Flash player.
I would consider this a bug in the documentation. You should
be able to see inherited "Air-Only" properties on the child object,
and not have to navigate through the parent objects in order to
discover this.
I did submit a support case a bug report to Adobe about this
issue.
Regards,
-jmh -
Compile error when using a class by fully-qualified name
Hi... Is it an AS3 "feature" or a FB compiler bug that I cannot use a class without importing it?
I have a statement such as
if (de.codebank.util.StringUtilities.startsWith(status.name, phase.name+"_"))
which does not compile until I import the StringUtilities class, which is pointless, of course.
The compile error mentions an unknown property "util"I believe this is how AS3 works. Fully qualified class types require import statement.
You use fully qualified name whenever you want to avoid ambiguity.
However, when the code is like,
import mx.collections.XMLListCollection;
var arr:mx.collections.ArrayCollection;
It works since compiler now understands that "mx.collections" is a package. -
Compilation error while calling static method from another class
Hi,
I am new to Java Programming. I have written two class files Dummy1 and Dummy2.java in the same package Test.
In Dummy1.java I have declared a static final variable and a static method as you can see it below.
package Test;
import java.io.*;
public class Dummy1
public static final int var1= 10;
public static int varDisp(int var2)
return(var1+var2);
This is program is compiling fine.
I have called the static method varDisp from the class Dummy2 and it is as follows
package Test;
import java.io.*;
public class Dummy2
public int var3=15;
public int test=0;
test+=Dummy1.varDisp(var3);
and when i compile Dummy2.java, there is a compilation error <identifier > expected.
Please help me in this program.public class Dummy2
public int var3=15;
public int test=0;
test+=Dummy1.varDisp(var3);
}test+=Dummy1.varDisplay(var3);
must be in a method, it cannot just be out somewhere in the class! -
Compile Error: "schema 'name' does not exist
Im trying to build a program that quereys a table in a database but i keep getting this error. Am i missing a link between the files or am i missing a line of code in my program??
Apologies. I receive a compiler error which reads as follows;
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
java.sql.SQLSyntaxErrorException: Schema 'DEMO' does not exist
Heres the main body of code i am trying to execute.
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
try{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
}catch(ClassNotFoundException e){
System.out.println(e);
try{
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/SimpleDBDemo", "demo", "demo");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM DEMO.Table1");
while (rs.next()) {
String s = rs.getString("Name");
float n = rs.getFloat("Age");
System.out.println(s + " " + n);
}catch(SQLException e){
System.err.println(e);
I am using NetBeans IDE and have created a database under: Services->Databases-> Java DB->SimpleDBDemo.
I have a database connection in which theres a simple table (called "TABLE1") created which contains the names and ages of two people.
Hope this makes the problem a bit clearer.
Any help would be greatly appreciated. -
I am just starting to implement a new user login authentication process wherein after prompting user for username & password, I hope to authenticate them againts our company Active Directory user data. Since I am just starting, I only have very few things
done at this point which is how I wanted to work on this so that my development environment is still at its simplest state.
I am using the following for development:
MS-Visual Studios Professional 2013 Version 12.0.30501.00 Update 2, and
MS .NET Framework Version 4.5.50938.
Here are my project solution's current items:
Web.config:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="Login.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Web.Debug.config:
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
Web.Assemblies.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<assemblies>
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
</system.web>
</configuration>
Login.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="loginForm" style="height: 562px; width: 399px; margin-left: 0px" title="Login Form">
<asp:Label ID="loginPageLabel" runat="server" Font-Bold="True" Font-Names="Arial Black" Font-Size="Large" Text="Please Log In"></asp:Label>
<br />
<br />
<asp:Label ID="loginUsernameLabel" runat="server" Text="Username:"></asp:Label>
<asp:TextBox ID="loginUserNameTextBox" runat="server" OnTextChanged="loginUserNameTextBox_TextChanged" Width="213px" Wrap="False" AutoPostBack="True" TabIndex="1"></asp:TextBox>
<br />
<br />
<asp:Label ID="loginPasswordLabel" runat="server" Text="Password:"></asp:Label>
<asp:TextBox ID="loginPasswordTextBox" runat="server" OnTextChanged="loginPasswordTextBox_TextChanged" Width="212px" Wrap="False" AutoPostBack="True" TabIndex="2"></asp:TextBox>
<br />
<br />
<asp:RadioButton ID="loginUAradioButton" runat="server" Font-Bold="True" OnCheckedChanged="loginUAradioButton_CheckedChanged" Text="TUPSS Associate" AutoPostBack="True" TabIndex="3" />
<asp:RadioButton ID="loginAFradioButton" runat="server" Font-Bold="True" OnCheckedChanged="loginAFradioButton_CheckedChanged" Text="Area Franchisee" AutoPostBack="True" TabIndex="4" />
<br />
<br />
<br />
<asp:Button ID="loginSubmitButton" runat="server" Font-Bold="True" OnClick="loginSubmitButton_Click" Text="Log In" TabIndex="5" />
<asp:Button ID="loginCancelButton" runat="server" Font-Bold="True" OnClick="loginCancelButton_Click" Text="Cancel" TabIndex="6" />
<br />
<br />
<asp:Label ID="loginStatusInstructionLabel" runat="server" Text="Status/Instruction:"></asp:Label>
<br />
<asp:TextBox ID="loginStatusInstructionTextBox" runat="server" Height="230px" MaxLength="100" Rows="12" TextMode="MultiLine" Width="360px" EnableViewState="False" OnTextChanged="loginStatusInstructionTextBox_TextChanged" ReadOnly="True" TabIndex="-1"></asp:TextBox>
</div>
</form>
</body>
</html>
Login.aspx.cs:
using System;
using System.DirectoryServices;
public partial class Login : System.Web.UI.Page
private string uName; // user-entered username
private string pWord; // user-entered password
private int loginLoadCycles; // just keeping track of how many times Page_Load is called
protected void Page_Load(object sender, EventArgs e)
if (this.loginUserNameTextBox.Text == String.Empty &&
this.loginPasswordTextBox.Text == String.Empty &&
this.loginUAradioButton.Checked == false &&
this.loginAFradioButton.Checked == false)
this.loginInit();
this.setLoginVisibilityAndFocus();
this.loginLoadCycles += 1;
private void loginInit()
this.uName = String.Empty;
this.pWord = String.Empty;
this.loginLoadCycles = 0;
private void setLoginVisibilityAndFocus()
// Decide on whether or not the Login submit & cancel buttons should be enabled or not
if ( this.loginUserNameTextBox.Text == String.Empty ||
(this.loginUAradioButton.Checked == false && this.loginAFradioButton.Checked == false) )
this.loginSubmitButton.Enabled = false;
this.loginCancelButton.Enabled = false;
this.loginStatusInstructionTextBox.Text = "Please specify if you are a TUPSS Associate or an Area Franchisee by checking either the 'TUPSS Associate' or 'Area Franchisee' checkbox.";
else
this.loginSubmitButton.Enabled = true;
this.loginCancelButton.Enabled = true;
if (this.loginPasswordTextBox.Text == String.Empty)
this.loginStatusInstructionTextBox.Text = "Now that you have entered your username & type, please enter your password.";
else
this.loginStatusInstructionTextBox.Text = "When you are ready, please select either the Log In button to login, or the Cancel button to abort.";
if (this.loginUAradioButton.Checked == false && this.loginAFradioButton.Checked == false)
this.SetFocus(this.loginUAradioButton);
else if (this.loginUserNameTextBox.Text == String.Empty)
this.SetFocus(this.loginUserNameTextBox);
else if (this.loginPasswordTextBox.Text == String.Empty)
this.SetFocus(this.loginPasswordTextBox);
else
this.SetFocus(this.loginSubmitButton);
protected void loginUserNameTextBox_TextChanged(object sender, EventArgs e)
protected void loginPasswordTextBox_TextChanged(object sender, EventArgs e)
// For some reason, after specifying that the password entry box's textmode to 'Password' setting,
// the UI's password textbox is emptied
this.loginStatusInstructionTextBox.Text = "NOTICE:\nThis application is still under development.\n\n" +
"This is why the password you entered is visible. Once this portion of the application is ready, it will be masked.\n\n" +
"Also, still need to figure out why when changing this to Password entry mode to mask its entered data, password is getting reset.";
protected void loginSubmitButton_Click(object sender, EventArgs e)
this.loginLoadCycles = 0;
this.uName = this.loginUserNameTextBox.Text;
this.pWord = this.loginPasswordTextBox.Text;
if (this.loginUAradioButton.Checked == true && this.loginAFradioButton.Checked == false)
this.loginLADPauthenticate('U'); // authenticate UPS Associates against UPS Corp's Active Directory
else if (this.loginUAradioButton.Checked == false && this.loginAFradioButton.Checked == true)
this.loginLADPauthenticate('A'); // authenticate Area Franchisees against UPS Store's iNet Active Directory
else
// set colors to show that this is an error instead of a status message or instruction
this.loginStatusInstructionTextBox.Text = "ERROR: Cannot log in without specifying if you are an UPS Associate or an Area Franchisee!";
protected void loginCancelButton_Click(object sender, EventArgs e)
this.loginStatusInstructionTextBox.Text = "You have selected to cancel from logging in...";
// Still need to plan what to do when user cancels out of logging in. For now, just initialize class attributes
this.loginInit();
protected void loginUAradioButton_CheckedChanged(object sender, EventArgs e)
String msg = String.Empty;
if (this.loginUAradioButton.Checked == true)
this.loginAFradioButton.Checked = false;
msg = "Thanks for specifying that you are a TUPSS Associate. ";
if (this.loginUserNameTextBox.Text == String.Empty)
msg += "Now please specify your username.";
else if (this.loginPasswordTextBox.Text == String.Empty)
msg += "Now please enter your password.";
this.loginStatusInstructionTextBox.Text = msg;
protected void loginAFradioButton_CheckedChanged(object sender, EventArgs e)
String msg = String.Empty;
if (this.loginAFradioButton.Checked == true)
this.loginUAradioButton.Checked = false;
msg = "Thanks for specifying that you are an Area Franchisee. ";
if (this.loginUserNameTextBox.Text == String.Empty)
msg += "Now please specify your username.";
else if (this.loginPasswordTextBox.Text == String.Empty)
msg += "Now please enter your password.";
this.loginStatusInstructionTextBox.Text = msg;
private void loginLADPauthenticate(char whichActiveDirectory)
String msg = "Authenticating user '" + this.uName + "' with password '" + this.pWord + "' against ";
if (whichActiveDirectory == 'U')
msg += "UPS Corp's Active Directory...";
else if (whichActiveDirectory == 'A')
msg += "The UPS Store's Franchisee Active Directory...";
msg += "\n\nNOTICE:\nThis is still under development.\n\nAt this point, this application is supposed to do something else now but is not yet ready.";
this.loginStatusInstructionTextBox.Text = msg;
this.loginStatusInstructionTextBox.AutoPostBack = true;
// Authenticate using LDAP
protected void loginStatusInstructionTextBox_TextChanged(object sender, EventArgs e)
I confirmed that I have System.DirectoryServices.dll located in
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\v4.0_4.0.0.0__b03f5f7f11d50a3a\ folder and that I as well as System have read as well as read&execute privileges
not only to all folders in its path but also to the DLL file itself.
I would appreciate any help in trying to resolve this compilation error so that I can proceed with implementing LDAP features for this endeavor.
Thanks so much,
hguico @ The UPS StoreHi,
For web application problem, please post your thread in
ASP.NET forum.
Best Wishes!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and
makes it easier for other visitors to find the resolution later. -
PL/SQL Procedure Compilation error
Hi,
<br><br>
I have wrote a PL/SQL Stored Procedure to read a couple of table values and then output some data to a file, when I create the procedure on the database I get the following compilation error:
<br><br>
LINE/COL ERROR<br>
-------- -----------------------------------------------------------------<br>
25/7 PLS-00103: Encountered the symbol ")" when expecting one of the<br>
following:<br>
( - + case mod new null <an identifier><br>
<a double-quoted delimited-identifier> <a bind variable> avg<br>
count current max min prior sql stddev sum variance execute<br>
forall merge time timestamp interval date<br>
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe<br>
The symbol "null" was substituted for ")" to continue.<br>
<br>
The script is below: <br><br>
CREATE OR REPLACE <br>
PROCEDURE TDF_EXTRACT AS<br>
v_file UTL_FILE.FILE_TYPE;<br>
YEAR number(4);<br>
Q1_VALUE NUMBER(7);<br><br>
BEGIN<br><br>
SELECT PERSON_VALUE<br>
INTO Q1_VALUE<br>
FROM PERSON<br>
WHERE ID = 79;<br><br>
SELECT EXTRACT(YEAR FROM SYSDATE)<br>
INTO YEAR <br>
FROM DUAL;<br><br>
v_file := UTL_FILE.FOPEN(location => '/tmp',<br>
filename => 'extratced_values.txt',<br>
open_mode => 'W',<br>
max_linesize => 32767);<br><br>
UTL_FILE.PUT_LINE(v_file,<br>
'Q1' || YEAR || '23' || Q1_VALUE || '\r\n' ||<br>
);<br><br>
UTL_FILE.FCLOSE(v_file);<br><br>
END TDF_EXTRACT;'Q1' || YEAR || '23' || Q1_VALUE || '\r\n' ||
);Syntax error during concatenation, maybe?
C.
Message was edited by:
cd -
Can't Export Movie - Unknown Compile Error - Help!
I edited a 32 minute movie in Premiere Elements 10, and now I'm trying to export it. At some point during the export, and it seems to vary, I get an unknown compile error. I've been trying to export the movie for the past week and all I get is failure despite trying just about everything I've found written about how to solve this.
I have Win 7 Ultimate SP 1 running on a Lenovo desktop machine with an Intel Core 2 Quad CPU at 2.67 GHz, 4GB of RAM, 32 bit proc.
Premiere is installed on system C drive with 6 GB of free space.
Project and scrach disks are on D drive with 165 GB of free space.
Media files are on 2nd E drive with 50GB of free space.
Project and most source material is NTSC DV -- there are quite a few photos with motion, plus some iPhone HD video on the timeline, hundreds of clips in all plus narration, a few titles, etc.
Export destination folder is on D drive.
Everything will render to green lines atop timeline (sometimes it quits during render and I have to keep hitting Enter to continue rendering, but eventually it's all green)
So far I've tried:
- Reinstalling PE 10
- Reinstalling Quicktime
- Copying all the photos to their own separate folder
- Editing each photo slightly (outside of PE 10) and resaving to make sure none of the photos are corrupted
- Emptying the temp folder
- Deleting all the renders and cache files and letting them rebuild
- Exporting small pieces of the timeline to try to identify a bad clip -- this is a maddening process and I did find one clip that would generate the error, but I managed to export that to AVI and reimport and replace on timeline. It would be awfully nice if PE would just TELL ME which clip it doesn't like if in fact it's a clip error.
- Turning off the shadow / highlight feature I had on some clips, but this wasn't the issue, smaller sections with these clips exported fine
- Tried exporting to various formats: Vimeo SD, MPEG DV Standard, iPad Standard High Quality, AVI -- all result in the same error (the format I want by the way is Vimeo SD)
- Rebooting the machine and turning everything off that might possibly consume memory
This machine has never had problems exporting in the past. One thing I did try that worked -- installed PE 10 on another (less capable) Win 7 machine, and fed it all the media via an external drive. The other machine did the export fine (though it took a while given it is underpowered). This is nothing more than a work around though as I don't normally have access to this machine and I'm not done editing.
I'm at my wits' end! What else can I do to get this movie file to export?
Appreciate any help or clues you can provide to solve this mystery.Oh, that is tragic!
I never had any issues with mine. Maybe it knew how respectful I was, having come from manual rewinds and a sync block? The Moviola was a godsend, at least for me. I am glad that I got to edit film, and on many setups, as some of that translated well to digital Video. Back when I was in film school, Video was 2" tape, and the only editing was by cutting at a 45 degree angle, and splicing the tape. There was not even deck-to-deck editing, way back then. Also, Video looked like crap, at least to my eyes. We could only use a switcher, to "edit," or do a feed to air. Looked like crap!
As for the Lexus, I can imagine all sorts of problems. My new LX-570 requires me to "Accept," when I put it into reverse, on the rear-view monitor! At least my wife's MB does not require that, but it is a 2011 model, so maybe the 2013 models will require that the user sign off on all sorts of "stuff."
Now, I can play Finding Nemo, for my rear-seat passengers, while driving, but the front-seat passengers cannot see it, which is just fine. When driving, I am not even a fan of hands-free calls, and declined most of the streaming stock quotes, etc. for XM/Sirius radio. NOT while I am driving. I will save that for reading the WSJ in the club at the airport.
Some years ago, our driver in London got a new BMW 7-series, and it allowed the playing of DVD's, even in the front, while driving. Not sure that I would want that, but such is life. At least his seats' ventilation system was "well-chilled," where ours' are just air. He almost froze my bum, showing off his new auto.
Now, working with PS, or PrE in an auto, or even on a mobile device, is just not something that I can wrap my old head around. I want a fast computer, with a big display, and cannot imagine editing Images, or Video, on any handheld (or auto) device.
Hunt -
How can I read ALL the compilation errors in a DOS window?
On compilation using a DOS window, if the number of errors exceeds the window size, some of the errors disappear off the top of the window and I cannot read them.
Is there an effective solution to somehow use scrolling of the DOS window or transfer the compilation errors to a file?Hey buddy,
When I first started programming with Java, I wondered the same thing. I have the very best solution for you. This one is waaay easy!!!!
There is a text editor which will not only color code your text for you, but you can easily configure it to give you the compiler /DOS output for Java. Just go to this website and download the program. Enjoy!
http://www.textpad.com/ -
Hi!
I can't run LV, I get everytime thins error:
Compiler error. Report this problem to ni tech support.
copy cvt str/pict/tag, csrc=0x40
~~~~
Regards
Sarah
LV 7.1.1Dear Sarah,
have you updated to LV 7.1.1 or does your problem occur in LV 7.1? I haven't updated to lv7.1.1 by now and we are using the english version.
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions -
Compiled Error in Xcode for iphone game and other questions
Dear all,
Hi, I am a newbie of xcode and objective-c and I have a few questions regarding to the code sample of a game attached below. It is written in objective C, Xcode for iphone4 simulator. It is part of the code of 'ball bounce against brick" game. Instead of creating the image by IB, the code supposes to create (programmatically) 5 X 4 bricks using 4 different kinds of bricks pictures (bricktype1.png...). I have the bricks defined in .h file properly and method written in .m.
My questions are for the following code:
- (void)initializeBricks
brickTypes[0] = @"bricktype1.png";
brickTypes[1] = @"bricktype2.png";
brickTypes[2] = @"bricktype3.png";
brickTypes[3] = @"bricktype4.png";
int count = 0;`
for (int y = 0; y < BRICKS_HEIGHT; y++)
for (int x = 0; x < BRICKS_WIDTH; x++)
- Line1 UIImage *image = [ImageCache loadImage:brickTypes[count++ % 4]];
- Line2 bricks[x][y] = [[[UIImageView alloc] initWithImage:image] autorelease];
- Line3 CGRect newFrame = bricks[x][y].frame;
- Line4 newFrame.origin = CGPointMake(x * 64, (y * 40) + 50);
- Line5 bricks[x][y].frame = newFrame;
- Line6 [self.view addSubview:bricks[x][y]]
1) When it is compiled, error "ImageCache undeclared" in Line 1. But I have already added the png to the project. What is the problem and how to fix it? (If possible, please suggest code and explain what it does and where to put it.)
2) How does the following in Line 1 work? Does it assign the element (name of .png) of brickType to image?
brickTypes[count ++ % 4]
For instance, returns one of the file name bricktype1.png to the image object? If true, what is the max value of "count", ends at 5? (as X increments 5 times for each Y). But then "count" will exceed the max 'index value' of brickTypes which is 3!
3) In Line2, does the image object which is being allocated has a name and linked with the .png already at this line *before* it is assigned to brick[x][y]?
4) What do Line3 and Line5 do? Why newFrame on left in line3 but appears on right in Line5?
5) What does Line 4 do?
Thanks
NorthHi North -
macbie wrote:
1) When it is compiled, error "ImageCache undeclared" in Line 1. ...
UIImage *image = [ImageCache loadImage:brickTypes[count++ % 4]]; // Line 1
The compiler is telling you it doesn't know what ImageCache refers to. Is ImageCache the name of a custom class? In that case you may have omitted #import "ImageCache.h". Else if ImageCache refers to an instance of some class, where is that declaration made? I can't tell you how to code the missing piece(s) because I can't guess the answers to these questions.
Btw, if the png file images were already the correct size, it looks like you could substitute this for Line 1:
UIImage *image = [UIImage imageNamed:brickTypes[count++ % 4]]; // Line 1
2) How does the following in Line 1 work? Does it assign the element (name of .png) of brickType to image?
brickTypes[count ++ % 4]
Though you don't show the declaration of brickTypes, it appears to be a "C" array of NSString object pointers. Thus brickTypes[0] is the first string, and brickTypes[3] is the last string.
The expression (count++ % 4) does two things. Firstly, the trailing ++ operator means the variable 'count' will be incremented as soon as the current expression is evaluated. Thus 'count' is zero (its initial value) the first time through the inner loop, its value is one the second time, and two the third time. The following two code blocks do exactly the same thing::
int index = 0;
NSString *filename = brickTypes[index++];
int index = 0;
NSString *filename = brickTypes[index];
index = index + 1;
The percent sign is the "modulus operator" so x%4 means "x modulo 4", which evaluates to the remainder after x is divided by 4. If x starts at 0, and is incremented once everytime through a loop, we'll get the following sequence of values for x%4: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, ...
So repeated evaluation of (brickTypes[count++ % 4]) produces the sequence: @"bricktype1.png", @"bricktype2.png", @"bricktype3.png", @"bricktype4.png", @"bricktype1.png", @"bricktype2.png", @"bricktype3.png", @"bricktype4.png", @"bricktype1.png", @"bricktype2.png", ...
3) In Line2, does the image object which is being allocated has a name and linked with the .png already at this line *before* it is assigned to brick[x][y]?
Line 2 allocs an object of type UIImageView and specifies the data at 'image' as the picture to be displayed by the new object. Since we immediately assign the address of the new UIImageView object to an element of the 'bricks' array, that address isn't stored in any named variable.
The new UIImageView object is not associated with the name of the png file from which its picture originated. In fact the UIImage object which inited the UIImageView object is also not associated with that png filename. In other words, once a UIImage object is initialized from the contents of an image file, it's not possible to obtain the name of that file from the UIImage object. Note when you add a png media object to a UIImageView object in IB, the filename of the png resource will be retained and used to identify the image view object. But AFAIK, unless you explicitly save it somewhere in your code, that filename will not be available at run time.
4) What do Line3 and Line5 do? Why newFrame on left in line3 but appears on right in Line5?
5) What does Line 4 do?
In Line 2 we've set the current element of 'bricks' to the address of a new UIImageView object which will display one of the 4 brick types. By default, the frame of a UIImageView object is set to the size of the image which initialized it. So after Line 2, we know that frame.size for the current array element is correct (assuming the image size of the original png file was what we want to display, or assuming that the purpose of [ImageCache loadImage:...] is to adjust the png size).
Then in Line 3, we set the rectangle named newFrame to the frame of the current array element, i.e. to the frame of the UIImageView object whose address is stored in the current array element. So now we have a rectangle whose size (width, height) is correct for the image to be displayed. But where will this rectangle be placed on the superview? The placement of this rectangle is determined by its origin.
Line 4 computes the origin we want. Now we have a rectangle with both the correct size and the correct origin.
Line 5 sets the frame of the new UIImageView object to the rectangle we constructed in Lines 3 and 4. When that object is then added to the superview in Line 6, it will display an image of the correct size at the correct position.
- Ray -
Compiler error when useing switch statements in an inner class
I have defined several constants in a class and want to use this constans also in an inner class.
All the constants are defined as private static final int.
All works fine except when useing the switch statement in the inner class. I get the compiler error ""constant expression required". If I change the definition from private static final to protected static final it works, but why?
What's the difference?
Look at an example:
public class Switchtest
private static final int AA = 0;
protected static final int BB = 1;
private static int i = 0;
public Switchtest()
i = 0; // <- OK
switch(i)
case AA: break; //<- OK, funny no problem
case BB: break; //<- OK
default: break;
private class InnerClass
public InnerClass()
i = 0; // <- OK: is accessible
if (AA == i) // <- OK: AA is seen by the inner class; i is also accessible
i = AA + 1;
switch(i)
case AA: break; // <- STRANGE?! Fail: Constant expression required
case BB: break; // <- OK
default: break;
}Thank's a lot for an explanation.Just a though:
Maybe some subclass of Switchtest could decalare its own variable AA that is not final, but it can not declare its own BB because it is visible from the superclass. Therefore the compiler can not know for sure that AA is final. -
Compilation error in PL/SQL
Hi All,
Please find the strange query situation in PLSQL.
If i run the query without PLSQL block (i.e. declar begin end) it runs well and insert data
in table but if put the same query in PLSQL block it gives compilation error.
Following is the spool
SQL> select * from v$version;
BANNER
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
SQL> insert into smcbom_load_hours_temp
2 select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
3 from (
4 select plan_level,sp.data_set_name,
5 sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
6 usagerate ,operationseq,percent,
7 sbov.group_id,sp.alloy,sp.planner_code,
8 sbov.days,sbov.totaloffsetdays,deptclass,dept,
9 decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
10 (SELECT MAX(INWEIGHT)
11 FROM SMCBOM_BOM_OPERATION_VIEW
12 WHERE ALLOY=sbov.alloy
13 AND PLANNER_CODE=sbov.planner_code
14 AND PLAN_LEVEL = 0
15 AND GROUP_ID = sbov.group_id ),
16 0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
17 1) v_hr,
18 smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
19 sum(-sbov.totaloffsetdays)
20 over (partition by sp.alloy,sp.planner_code,sbov.group_id
21 order by plan_level asc,operationseq desc) new_offset
22 from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
23 where sbov.alloy= sp.alloy
24 and sbov.planner_code=sp.planner_code
25 and group_id=521136
26 )
27 group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
23 rows created.
SQL> commit;
Commit complete.
SQL> declare
2 begin
3 insert into smcbom_load_hours_temp
4 select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
5 from (
6 select plan_level,sp.data_set_name,
7 sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
8 usagerate ,operationseq,percent,
9 sbov.group_id,sp.alloy,sp.planner_code,
10 sbov.days,sbov.totaloffsetdays,deptclass,dept,
11 decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
12 (SELECT MAX(INWEIGHT)
13 FROM SMCBOM_BOM_OPERATION_VIEW
14 WHERE ALLOY=sbov.alloy
15 AND PLANNER_CODE=sbov.planner_code
16 AND PLAN_LEVEL = 0
17 AND GROUP_ID = sbov.group_id ),
18 0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
19 1) v_hr,
20 smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
21 sum(-sbov.totaloffsetdays)
22 over (partition by sp.alloy,sp.planner_code,sbov.group_id
23 order by plan_level asc,operationseq desc) new_offset
24 from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
25 where sbov.alloy= sp.alloy
26 and sbov.planner_code=sp.planner_code
27 and group_id=521136
28 )
29 group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
30 end;
31 /
(SELECT MAX(INWEIGHT)
ERROR at line 12:
ORA-06550: line 12, column 2:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
ORA-06550: line 22, column 6:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
, from
SQL> spool off;In some versions of Oracle (certainly all of the 8.x versions and earlier, and possibly some of the earlier 9 versions) the SQL parsers in the SQL engine and in the PL/SQL engine were different. Some features that worked directly in SQL did not work in PL/SQL. Scalar sub-queries were one of those things.
You have three options. You can try to re-write the insert statement to eliminate the PL/SQL unimplemented feature. You can create a view in the database for the SELECT part of the insert statement then use that view in the insert. finally, and least desirable, you can build the whole statment as a string, and use EXECUTE IMMEDIATE to run it in PL/SQL.
HTH
John -
Hi All,
I am getting flex compilation error when i deploy the models which were developed in older version7.0, now it is 7.01.I am getting the following error in 7.01 version.
Flex2Compiler.Build: Error in executing a process for Flex compilation: /usr/sap/BWD/DVEBMGS30/j2ee/cluster/server0/GUIMachine_Business_Packages/[KCRXK59]MyModels.SMIScoreCard/FLEX_COMPILATION_FOLDER/AAD583.mxml
Does the older version models doesnot deploy in new versions?
Thanks
Srinivas KHello Srinivas,
Currently i am also facing the same issue , Can you let us know were you able to solve the problem u encountered , if yes how?
Thanks and Regards,
Ronniee
Maybe you are looking for
-
Hi, My requirement is The newly configured Text field to contain the NxTrend Po number needs to be available in EDI 850 IDoc for XI maps the value to the field.This text field is configured at Sales Order header level and named as end customer PO.Thi
-
Search Help for standard field
I need to enhance the existing collective search help provided for a certain standard field(ex.Field XXX). However while providing this additional search help, I need to show XXX data along with YYY( this is maintained in some other table but linked
-
I lost the password to my iMac desktop profile
2 months ago our imac was stolen from our house and only yesterday it was recovered by the police but in the mean time they restarted the computer and made a profile that we do not know the password to. Is there anyway we can restart the computer wit
-
We composed some text on in iPad in Pages, then wanted to copy and paste it. Copy was easy, press and hold and "Copy/Copy All" choices appear. Then navigating to email, trying to paste the text into a message (yes, afterwards we saw that we could hav
-
Wifi LAN VERY slow on mac mini 10.6.8
All, I have a mac mini 1.66 intel core Duo with 2gb of RAM. The HD crashed a couple months ago and so it has a clean version of 10.6.8 on it. In my house I have a Motorola modem (comcast) hooked to a vonage box with wifi. Off this we run 2 MBP's a