Accessing Value of a property of a derived class
I'm having trouble getting the value of a property of my class. My class is called ball and I'd like to get it's velocity (which i set but can change) from my view control.
Here is my ball.h code:
#import <Foundation/Foundation.h>
@interface Ball : UIImageView {
CGPoint ballVelocity;
int mXSpeed;
int mYSpeed;
float mAngle;
- (void)getVelocity:(CGPoint)speed;
- (void)move;
- (void)bounceHorizontal;
- (void)bounceVertical;
- (void)setSpeedX:(int)xSpeed Y:(int)ySpeed;
- (void)setVelocity:(CGPoint)speed;
- (CGPoint) ballVelocity;
@end
Here is my part of my ball.m code:
#import "Ball.h"
@implementation Ball
- (void)setVelocity:(CGPoint)speed {
ballVelocity = speed;
Here is my viewVontroller.h
#import <UIKit/UIKit.h>
@class Ball;
@interface BallsOfFireViewController : UIViewController {
IBOutlet UIImageView *ball;
NSMutableArray *mBallArray;
CGPoint ballVelocity;
CGPoint velocityz;
CGPoint velocityz2;
@property(nonatomic, retain) IBOutlet UIImageView *ball;
@property(retain, nonatomic) IBOutlet NSMutableArray *mBallArray;
@property(nonatomic) CGPoint ballVelocity;
- (void) checkCollision;
@end
and here is the relative code from my viewController.m
#import "BallsOfFireViewController.h"
#import "Ball.h"
//#define kGameStateRunning 1
//#define kGameStatePaused 2
#define kBallSpeedX 1
#define kBallSpeedY 1
@implementation BallsOfFireViewController
@synthesize ball, mBallArray, ballVelocity;
- (void)viewDidLoad {
[super viewDidLoad];
//self.gameState = kGameStatePaused;
mBallArray = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < 3; i++)
Ball* ballx=[[Ball alloc] initWithImage:[UIImage imageNamed:@"FireBall.png"]];
[mBallArray addObject:ballx];
[self.view addSubview:ballx];
if (i == 14
//[ballx setBackgroundColor:([UIColor redColor])];
ballx.image = [UIImage imageNamed:@"IceBall.png"];
ballVelocity = CGPointMake(1,1);
[ballx setVelocity:ballVelocity];
ballx.center = CGPointMake((random() % 14) * 20 + 20 ,(random() % 20) * 20 + 20);
[NSTimer scheduledTimerWithTimeInterval:0.005
target:self
selector:@selector(moveBall)
userInfo:nil
repeats:YES];
-(void)moveBall
int i;
int numberOfBalls=[mBallArray count];
for (i = 0; i < numberOfBalls; i++)
Ball* ballz=[mBallArray objectAtIndex:i];
int i2;
for (i2 = 0; i2 < numberOfBalls; i2++)
if (i2 != i) {
Ball* ballz2=[mBallArray objectAtIndex:i2];
if (CGRectIntersectsRect(ballz.frame, ballz2.frame)) {
if (sqrt(pow(ballz.center.x - ballz2.center.x,2) + pow(ballz.center.y - ballz2.center.y,2)) <= pow(ballz.frame.size.width,2)) {
[ballz move];
velocityz = ballz.ballVelocity;
velocityz2 = ballz2.ballVelocity;
if (velocityz.x == velocityz2.x * -1 && velocityz.y == velocityz2.y * -1) {
if (pow(ballz.center.x - ballz2.center.x,2) > pow(ballz.center.y - ballz2.center.y,2)) {
[ballz bounceHorizontal];
[ballz2 bounceHorizontal];
} else {
[ballz bounceVertical];
[ballz2 bounceVertical];
[ballz move];
When I get to the following line in debug mode the game in my iPhone Simulator freezes and I do not see any errors in xCode (probably don't know where to look):
velocityz = ballz.ballVelocity;
I think I'm just not setting up my ball class correctly to be able to pull back the value of the ballVelocity variable. Can anyone point me in the correct direction?
Here's the error I see in the dubugger
[NSObject doesNotRecognizeSelector:]
this is the line of code it is trying to execute in viewController.m:
velocityz = ballz.ballVelocity
I do have this in my ball.h
- (CGPoint)ballVelocity;
the ballVelocity of the ball is set right after it is created. No idea why it thinks this is not recognized. I know it's probably something stupid but I just don't see it!
Similar Messages
-
How can I hide a property in a derived class
For Example
Class Rectangle
Private dLength, dBreadth as Double
Sub new(Byval Length as Double, Byval Breadth as Double)
dlength = length dbreadth = breadth
end Sub
Public Readonly Property Length as Double
return dlength
end property
Public Readonly Property Breadth as Double
return dbreadth
end property
Public Property Area as Double
return dLength * dBreadth
end Property
End Class
Class Square
Inherits Rectangle
Sub New(Byval Length as Double)
Mybase.new(Length, Length)
end sub
' I want to hide the breadth property here.
' Only length should be visible.
end Class
How can I implement this in VB?Hello,
I agree with Frank, this goes against the concepts of OO. If you really wanted to it can be done yet would highly recommend rethinking your reasoning and design. The following is how it can be done but it should not be done.
Imports System.ComponentModel
Class Rectangle
Private dLength, dBreadth As Double
Sub New(ByVal Length As Double, ByVal Breadth As Double)
dLength = Length
dBreadth = Breadth
End Sub
Public ReadOnly Property Length As Double
Get
Return dLength
End Get
End Property
<Browsable(False), EditorBrowsable(EditorBrowsableState.Never)> _
Public ReadOnly Property Breadth As Double
Get
Return dBreadth
End Get
End Property
Public ReadOnly Property Area As Double
Get
Return dLength * dBreadth
End Get
End Property
End Class
Class Square
Inherits Rectangle
Sub New(ByVal Length As Double)
MyBase.New(Length, Length)
End Sub
' I want to hide the breadth property here.
' Only length should be visible.
End Class
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
Output text show Null when access value through property inspector in ADF
Hi,
we declare two UIComponents one is Deptno which is InputComboBoxListofValues and othre is Dname as output text.
we create ManagedBean called "deptBean"(which is in BackingBeanScope) and create a method inside bean "deptnoChanged".
ValueChangeListener of Deptno pointing to deptnoChanged method of deptBean.
Inside deptBean we declare a variable private String departmentName which are having setter and getters.
we can Initialize departmentName based on valueChangeEvent in bean level
for example:
if (deptno=10)
setdepartmentName("Accounts");
else
setdepartmentName("Sales");
Now we Can Access the Value of departmentName.
The UIComponent(output text field) such as Dname in JSP Page we set value (in property Inspector)
_#{backingBeanScope.deptBean.departmentName}_
when we execte the JSP Page Dname show Null as output. but output we expect as Accounts or Sales only.
Please help us, how to resolve the problem
Thanks,
kumar.when we execte the JSP Page Dname show Null as output. but output we expect as Accounts or Sales only.The value to be got while debugging should be via EL expressions and stored somewhere.
If the value Dname is bound to the backing bean then you can view its value in the property inspector using
#{<BeanScope>.<BeanName>.value} or the like -
Unable to access nested managed bean property in JSF 1.2.9
In an old version of JSF, namely 1.2-b20-FCS from April/21/2006, I could access nested properties of a managed bean. So I had a managed bean OuterBean, and in JSF I could write
<h:inputText value="#{outerBean.innerBean1.propertyA"/>
The Java class OuterBean has a member function
InnerBean OuterBean.getInnerBean1();
That is, there is a function getInnerBean1() taking no arguments, and it returns something which in my example above is the class InnerBean.
Class InnerBean has a member function getPropertyA().
But in the latest JSF from July/17/2008, this nested stuff is not working.
Simple access like #{outerBean.propertyA} works, but nested access like #{outerBean.innerBean.propertyA} does not.
The exception is something like
org.apache.jasper.el.JspELException: /whatever/mypage.jsp(71,15) '#{outerBean.innerBean.username}' Error reading 'innerBean' on type
mypackage.OuterBean at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107) at javax.faces.component.UIOutput.getValue(UIOutput.java:184) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946) at javax.faces.render.Renderer.encodeChildren(Renderer.java:148) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942) at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) atThanks.Sorry, it looks fine to me. In my original post, I had the call stack in code and for some reasons the newlines were removed. So let me try again in text, but putting two newlines. Hope it works this time:
org.apache.jasper.el.JspELException: /whateverr/mypage.jsp(71,15) '#{outerBean.innerBean.property}' Error reading 'innerBean' on type mypackage.OuterBean at
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107) at javax.faces.component.UIOutput.getValue(UIOutput.java:184) at
com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201) at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284) at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154) at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at
javax.faces.component.UIComponent.encodeAll(UIComponent.java:946) at
javax.faces.render.Renderer.encodeChildren(Renderer.java:148) at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at
javax.faces.component.UIComponent.encodeAll(UIComponent.java:936) at
javax.faces.component.UIComponent.encodeAll(UIComponent.java:942) at
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271) at
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202) at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at
Edited by: sn72 on Sep 21, 2008 10:21 AM
Edited by: sn72 on Sep 21, 2008 10:22 AM -
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
I am getting the following error with IE9 and Firefox 26 with application express 3.2:
SCRIPT5007: Unable to get value of the property 'nodeName': object is null or undefined
apex_ns_3_1.js, line 589 character 10
this.dialog.check2 = function (e){
var tPar = html_GetTarget(e);
var lEl = $x('apexir_col_values_drop');
var l_Test = true;
****** while(tPar.nodeName != 'BODY'){
tPar = tPar.parentNode;
if(tPar == lEl){l_Test = false;}
if(l_Test){$x_Remove('apexir_col_values_drop')}
This happens when I click the Gear Icon, then Filter, then I click the dropdown arrow under expressions and pick an expression from the list.
If I set (through IE Developer tools) back to IE8 mode, I don't get the error.Guess no one is using 3.2 any longer or no one else gets this error..... Guess I can edit the JavaScript file to trap the error since it really doesn't seem to cause an issue. Just didn't want to have to go that route.
-
Unable to access values from database in login page..
Hey all,
Friends I have a login.jsp page and I want if i enter username and password then it will be accessed from database and after verifying the details it will open main.jsp.I made a database as "abc" and created DSN as 1st_login having table 1st_login. But the problem is that I am unable to access values from database.
So Please help me.
Following is my code:
<HTML>
<body background="a.jpg">
<marquee>
<CENTER><font size="5" face="times" color="#993300"><b>Welcome to the"<U><I>XYZ</I></U>" of ABC</font></b></CENTER></marquee>
<br>
<br>
<br>
<br><br>
<br>
<form name="login_form">
<CENTER><font size="4" face="times new roman">
Username
<input name="username" type="text" class="inputbox" alt="username" size="20" />
<br>
<br>
Password
<input type="password" name="pwd" class="inputbox" size="20" alt="password" />
<br/>
<input type="hidden" name="option" value="login" />
<br>
<input type="SUBMIT" name="SUBMIT" class="button" value="Submit" onClick="return check();"> </CENTER>
</td>
</tr>
<tr>
<td>
</form>
</table>
<%
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection("jdbc:odbc:1st_login");
Statement statement = connection.createStatement();
String query = "SELECT username, password FROM 1st_login WHERE username='";
query += request.getParameter("username") + "' AND password='";
query += request.getParameter("password") + "';";
ResultSet resSum = statement.executeQuery(query);
//change: you gotta move the pointer to the first row of the result set.
resSum.next();
if (request.getParameter("username").equalsIgnoreCase(resSum.getString("username")) && request.getParameter("password").equalsIgnoreCase(resSum.getString("password")))
%>
//now it must connected to next page..
<%
else
%>
<h2>You better check your username and password!</h2>
<%
}catch (SQLException ex ){
System.err.println( ex);
}catch (Exception er){
er.printStackTrace();
%>
<input type="hidden" name="op2" value="login" />
<input type="hidden" name="lang" value="english" />
<input type="hidden" name="return" value="/" />
<input type="hidden" name="message" value="0" />
<br>
<br><br>
<br><br>
<br><br><br><br><br>
<font size="2" face="arial" color="#993300">
<p align="center"> <B>ABC © PQR</B>
</BODY>
</HTML>
and in this code i am getting following error
C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:93: cannot find symbol_
C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:93: cannot find symbol_
C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:94: cannot find symbol_
C:\Project\SRS\build\generated\src\org\apache\jsp\loginjsp.java:95: cannot find symbol_
4 errors
C:\Project\SRS\nbproject\build-impl.xml:360: The following error occurred while executing this line:
C:\Project\SRS\nbproject\build-impl.xml:142: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 6 seconds)As long as you're unable to compile Java code, please use the 'New to Java' forum. This is really trival.
To ease writing, debugging and maintenance, I highly recommend you to write Java code in Java classes rather than JSP files. Start learning Servlets. -
How to get all the allowed values of a property?
Hi all,
I want to read all the allowed values of a property. I have created a new custom property and given 3 values as allowed values.
What i want to do is programtically read all the allowed values of that particular property.
Regards
RajeevHi guys,
I'm trying to do exactly the same, i need a list with all the KM properties, i'm using the very same code thar Romano putted on his post, and i'm getting this:
InitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.#
On this sentence:
IConfigurationAccess icAccess = Configuration.getInstance();
I'm developing a Webdynpro application on server A and i'm using the KM libraries through an EJB inside a Webservice on server B.
Do you have any suggestions?
Thanks in advance -
Hi,
I am getting this error from visual studio 2012 whenever i try to create the following project types:
- Workflow Custom activity
- Web parts
The error is as mentioned below
"The partial project item type does not have a value for this property"
Due to this the when I add above type of items in my project, they show a red cross icon against them.
Please let me know If have you any solution?Hi
I had same issue. Below is the solution
Installing
"Visual Studio 2012 Update 3" usually solves this problem. (You can download it through microsoft's official site at
"http://www.microsoft.com/en-in/download/details.aspx?id=39305")
Hansraj Rathva -
Adjusting Portal Pages throws "Specify a value for the property {0}"
I found (with the help of our friends at OSS) the setting I need to change with to adjust the Runtime frame size for Guided Procedures.
It's quite logical really, since GP is just a bunch of pages in the portal it would make sense to find them in the Portal Content option ... So there it was.
Content Administration > Portal Content
Search for content and go to Process Instance. The following part shows the 3 main content parts of the GP Runtime window. As you can see in the third container are the two elements that contain your content. "Content Area" and "Public Content Area".
Open those two areas (scroll down in the list in the middle, select one and press open) and change the value of Height Type from "Fixed" to "Automatic" or "Full Page".
This is where I get my error (see the link below for a screenshot as well): When I try to change a value, any value or just open for modifying and try saving again (without changing anything) I get this error:
[http://wow.telenet.be/delaware/property0.jpg]
Specify a value for the property
Now I don't know if there any portal expert watching this thread, but it seems as though all those pages have been wrongly configured from the start. And until I figure out the right configuration I won't be able to save them either way.
My question is two-fold:
1) Can anyone provide me with all the settings he has for this component so I can compare them to mine?
2) How do I fix this error? I'm assuming every page in the portal gives the same error?
Thanks in advance,
Frederik-Jan
Edited by: Frederik-Jan Roose on Apr 1, 2008 11:33 AM
Edited by: Frederik-Jan Roose on Apr 1, 2008 11:33 AMI found (with the help of our friends at OSS) the setting I need to change with to adjust the Runtime frame size for Guided Procedures.
It's quite logical really, since GP is just a bunch of pages in the portal it would make sense to find them in the Portal Content option ... So there it was.
Content Administration > Portal Content
Search for content and go to Process Instance. The following part shows the 3 main content parts of the GP Runtime window. As you can see in the third container are the two elements that contain your content. "Content Area" and "Public Content Area".
Open those two areas (scroll down in the list in the middle, select one and press open) and change the value of Height Type from "Fixed" to "Automatic" or "Full Page".
This is where I get my error (see the link below for a screenshot as well): When I try to change a value, any value or just open for modifying and try saving again (without changing anything) I get this error:
[http://wow.telenet.be/delaware/property0.jpg]
Specify a value for the property
Now I don't know if there any portal expert watching this thread, but it seems as though all those pages have been wrongly configured from the start. And until I figure out the right configuration I won't be able to save them either way.
My question is two-fold:
1) Can anyone provide me with all the settings he has for this component so I can compare them to mine?
2) How do I fix this error? I'm assuming every page in the portal gives the same error?
Thanks in advance,
Frederik-Jan
Edited by: Frederik-Jan Roose on Apr 1, 2008 11:33 AM
Edited by: Frederik-Jan Roose on Apr 1, 2008 11:33 AM -
Rate and accessable value is not displaying for the tax invoice output
Hello All,
Rate and accessable value is not displaying for the tax invoice output. Rest of all outputs for invoices shows Rate and accessable value.
Scenerio is free of charge sales order (samples) removing the goods from pant so excise invoice has been created and also updated. but for tax invoice out put rate and access value is not displaying.
Pricing procedure: In pricing procedure account keys have not been maintained because there is not gl account upadation during billing for free of charge delivery.
Thanks & Regards,
rameshhi Gurpreet,
You can add values to that transient column programatically,either by getiing the row from the iterator and then row.setAttribute('Column_name','Value');
Or providing value to it in the SQL... -
Hello everyone !
I run into this problem today ... take a look on the code :
import com.trick7.effects.TeraFire;
for (var j:uint=0; j<10; j++) {
var fire:TeraFire = new TeraFire();
fire.x = j * 40 + 20;
fire.y = 100;
fire.number = j; //This line is causeing the problem
addChild(fire);
fire.buttonMode = true;
TeraFire class creates fire particles. The compiler error is :
Scene 1, Layer 'Layer 1', Frame 1, Line 7
1119: Access of possibly undefined property number through a reference with static type com.trick7.effects:TeraFire.
Anyone can help me to find a solution to this problem.
I can do that ".number" with a movieclip but not in this case. What can I do ?I borrowed that class from the internet.
I made the changes you suggested: imported flash.Display.MovieClip and also made the class extend MovieClip.
The error is still throwing in compiler errors. I am not really good enough to edit this class because there are some functions I don't still understand very good. This is the class below:
package com.trick7.effects{
import flash.display.BitmapData;
import flash.display.GradientType;
import flash.display.MovieClip;
import flash.events.Event;
import flash.filters.DisplacementMapFilter;
import flash.filters.DisplacementMapFilterMode;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
public class TeraFire extends MovieClip{
public var phaseRateX:Number;
public var phaseRateY:Number;
private var offsets:Array= [new Point(),new Point()];
private var seed:Number = Math.random();
private var fireW:Number;
private var fireH:Number;
//火の色
//private var fireColorIn:uint;
//private var fireColorOut:uint;
private var ball:Sprite;
private var gradientImage:BitmapData;
private var displaceImage:BitmapData;
private var focalPointRatio:Number = 0.6;
private const margin:int = 10;
private var rdm:Number;
public function TeraFire(xPos:Number=0, yPos:Number=0, fireWidth:Number=30, fireHeight:Number=90, fireColorIn:uint = 0xFFCC00,fireColorOut:uint = 0xE22D09){
fireW = fireWidth;
fireH = fireHeight;
phaseRateX = 0;
phaseRateY = 5;
var matrix:Matrix = new Matrix();
matrix.createGradientBox(fireW,fireH,Math.PI/2,-fireW/2,-fireH*(focalPointRatio+1)/2);
var colors:Array = [fireColorIn, fireColorOut, fireColorOut];
var alphas:Array = [1,1,0];
var ratios:Array = [30, 100, 220];
var home:Sprite = new Sprite();
ball = new Sprite();
ball.graphics.beginGradientFill(GradientType.RADIAL,colors, alphas, ratios, matrix,"pad","rgb",focalPointRatio);
ball.graphics.drawEllipse(-fireW/2,-fireH*(focalPointRatio+1)/2,fireW,fireH);
ball.graphics.endFill();
//余白確保用透明矩形
ball.graphics.beginFill(0x000000,0);
ball.graphics.drawRect(-fireW/2,0,fireW+margin,1);
ball.graphics.endFill();
addChild(home);
home.addChild(ball);
this.x = xPos;
this.y = yPos;
addEventListener(Event.ENTER_FRAME,loop);
displaceImage = new BitmapData(fireW+margin,fireH,false,0xFFFFFFFF);
var matrix2:Matrix = new Matrix();
matrix2.createGradientBox(fireW+margin,fireH,Math.PI/2,0,0);
var gradient_mc:Sprite = new Sprite;
gradient_mc.graphics.beginGradientFill(GradientType.LINEAR,[0x666666,0x666666], [0,1], [120,220], matrix2);
gradient_mc.graphics.drawRect(0,0,fireW+margin,fireH);//drawのターゲットなので生成位置にこだわる必要はない。
gradient_mc.graphics.endFill();
gradientImage = new BitmapData(fireW+margin,fireH,true,0x00FFFFFF);
gradientImage.draw(gradient_mc);//gradient_mcを消す必要は?
rdm = Math.floor(Math.random()*10);
private function loop(e:Event):void{
for(var i:int = 0; i < 2; ++i){
offsets[i].x += phaseRateX;
offsets[i].y += phaseRateY;
displaceImage.perlinNoise(30+rdm, 60+rdm, 2, seed, false, false, 7, true, offsets);
displaceImage.copyPixels(gradientImage,gradientImage.rect,new Point(),null, null, true);
var dMap:DisplacementMapFilter = new DisplacementMapFilter(displaceImage, new Point(), 1, 1, 20, 10, DisplacementMapFilterMode.CLAMP);
ball.filters = [dMap];
I you can clarify a little bit further I would appreciate it a lot because I wasted some good time on this. -
Not able to change values in the Property Inspector
Hello!
Can some one please help me with this. I was working in
Director when I noticed that all of a sudden I wasn't able to
change the values in the property inspector, specifially the sprite
properties such as the x and y coordinates and the width and
height. I'll type in a value and then I will get an error sound and
it will revert to the previous value. How can I fix this??
Thanks!Hi Ringerz,
I've seen the PI lock up sometimes. What usually works is to
switch to List Viw
Mode. Never have trouble there. Then, close Director and
reopen. Think it's jus a
bug that hasn't been fixed yet.
regards
Dean
Director Lecturer / Consultant / Director Enthusiast
http://www.fbe.unsw.edu.au/learning/director
http://www.multimediacreative.com.au
email: [email protected] -
Access values stored in 2D Array in HashMap
Hi everyone i would like to know how to access values stored in a 2D array inside a HashMap
Here is a drawing representation of the map.
So to get the KEYS I just have to execute this code:
this.allPeople = personInterests.keySet();But how can I get acces to the actual values inside the 2D Array?
My goal is to create a treeSet and store all the elements of the first array in it, then look at the second array if any new elements are detected add them to the treeset, then third array and so on.
I tried this code:
Object[] bands = personInterests.values().toArray();
for( int i=0; i<bands.length; i++)
this.allBands.add(bands.toString());
}But this.allBands.add(bands[i].toString())seems to be the problem, Dealing with a 2D array, this code only return a string representation of the Arrays and not a string representation of their elements.
Using my logic I tried to execute:
this.allBands.add(bands[0][i].toString());But i get a ARRAY REQUIRED BUT JAVA.LANG.OBJECT FOUND
I really don't know the way to go.
Thanks to anyone that will help.
Regards, Damien.
Edited by: Fir3blast on Mar 3, 2010 5:27 PMYou'll just need to cast the object to the correct type. This is nothing to do with HashMap at all. If you don't know what that means then your google keywords are "java cast tutorial".
-
Set proprty as value of another property
my datacollector bean has refrenc of type data with 4 different properties
<jsp:useBean id="data" class="com.custom.util.DataCollector" scope="request"/>
<c:set target="${data}" property="IP1" value="${param.subnet1}" />
<c:set target="${data}" property="IP2" value="${param.subnet2}" />
<c:set target="${data}" property="IP3" value="${param.subnet3}" />
<c:set target="${data}" property="IP4" value="${param.subnet4}" />now i want to set the data as property of another refernce. I tried this way
<jsp:useBean id="saved" class="com.custom.util.SaveData" scope="request"/>
<c:set target="${saved}" property="DataSafe" value="${data}" />my SaveData class
package com.custom.util;
import java.util.*;
import java.io.*;
public class SaveData implements Serializable {
ObjectOutputStream dos;
int ip1;
int ip2;
int ip3;
int ip4;
public SaveData() {
public void setIP1(int ip1){
this.ip1 = ip1;
public void setIP2(int ip2){
this.ip2 = ip2;
public void setIP3(int ip3){
this.ip3 = ip3;
public void setIP4(int ip3){
this.ip3 = ip3;
public void setDataSafe(SaveData sd)throws FileNotFoundException, IOException{
dos = new ObjectOutputStream(new FileOutputStream("data.txt"));
dos.writeObject(sd);
dos.flush();
}and my DataCollector class
package com.custom.util;
import java.util.*;
import java.io.*;
public class DataCollector implements Serializable {
TreeMap dataMap = new TreeMap();
int ip1;
int ip2;
int ip3;
int ip4;
public DataCollector() {
public void setIP1(int ip1){
this.ip1 = ip1;
public void setIP2(int ip2){
this.ip2 = ip2;
public void setIP3(int ip3){
this.ip3 = ip3;
public void setIP4(int ip4){
this.ip4 = ip4;
}and i got illegalargumentexception
please help..from ehat i could understand from the method is that my code should be like this
<jsp:useBean id="data" class="com.custom.util.DataCollector" scope="request"/>
<c:set target="${data}" property="IP1" value="${param.subnet1}" />
<c:set target="${data}" property="IP2" value="${param.subnet2}" />
<c:set target="${data}" property="IP3" value="${param.subnet3}" />
<c:set target="${data}" property="IP4" value="${param.subnet4}" />
<jsp:useBean id="saved" class="com.custom.util.SaveData" scope="request"/>
<c:set target="${saved}" property="dataSafe" value="${data}" />and exception i m getting because of this
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
java.lang.IllegalArgumentException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.java:154)
org.apache.jsp.basics1.Saved_jsp._jspx_meth_c_set_0(Saved_jsp.java:139)
org.apache.jsp.basics1.Saved_jsp._jspService(Saved_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
Maybe you are looking for
-
Any suggestions on how I can import an album without the songs going to alphabetical order? The last few times I have imported....I cannot get the play list to come up in the album order.
-
Found solution for connection problems iPod Nano 3rd gen to Windows Vista!!
Hello people! I just found a solution to connection problems with iPod Nano 3rd generation when connecting it to a Windows Vista machine. Because of 'security reasons', Vista asks you to check the drive for errors when connecting the iPod. The thing
-
RAID block size for final cut pro x
Just got one of the new late 2012 27" iMacs and a 6 TB LaCie Thunderbolt drive. Can finally edit the video I took last spring. I'll be using Final Cut Pro X, and doing a lot of multicam stuff with 4 or 5 views and a separate audio track. The LaCie ca
-
I have been in dialog with "Just Answer" the past two weeks 60 times over this issue. This has been an issue for several months. Just today I tried 18 times "Sever not Found" "Try again" before accessing Firefox. Yesterday Firefox crashed in Yahoo em
-
CS3 Won't Generate a TOC in book?
Hi everyone! I am trying to create a table of contents for a book I have laid out in CS3, but I keep hitting a problem with the program only pulling the styles from the page I currently have open. When I open the dialogue for the table of contents, a