Access of possibly undefined property number through a reference with static type...
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.
Similar Messages
-
Hi Guys,
As i am using the nigtly build of TLF 4.0.0.11073.
I want to copy some text from the TLF, by copy operation. I am getting this type of Error.
- Call to a possibly undefined method getClipboardContents through a reference with static type flashx.textLayout.edit:ISelectionManager.
In the previous build, i dont use to get this type of error, but in this nightly builds i am getting this type of error.
Can anyone help me to fix the same or any workaound.
Thanks in advance.
KrishnaThis functionality is still available, but it has moved. It's now in a TextClipboard class, in the same flashx.textLayout.edit package. So you should replace calls to getClipboardFormat() with TextClipboard.getContents().
Hope this helps,
- robin -
Im trying to use the hit test built into flash, but its failing. I have used this many time before! but this time flash is crying at me.
I Think i know why but im not sure how to fix it.
Here is my hit test code:
stage.addEventListener( Event.ENTER_FRAME, handleCollision);
private function handleCollision( e:Event ):void
if (MissleMc.hitTestObject(Enemy))
trace("HIT");
else
trace("MISS");
I have tried multiple things, Changing instances, location of the code. I currently have 4 classes, Main, Missile, Enemy and House. House has nothing it in really. Missile make a missile, Enemy Makes a enemy. And main deals with adding it all to the stage, and making it randomly appear ect.Yes you are correct, MissleMc is a class, thats the name its exported to. But i have tryed various things.
Well i completely cahnged it now. Cleaned up my code a little created a new Bullet class, that i am currently using.
Here is the function that fire's the bullet
private function fireBullet():void
var newBullet:Bullet = new Bullet;
stage.addChild(newBullet);
newBullet.x = house.x;
newBullet.y = house.y;
aBulletArray.push(newBullet);
trace(aBulletArray.length);
So im making the instance bullet, yet still when i use the hit test it does not wotk. -
Hi all.
I am trying to set the size of the buttons on my site:
http://www.samtest09.nineteenseventysix.com
i am using the script:
imagesb_btn.setSize(width, height);
imagesb_btn.setSize(100, 50);
but i keep getting the above error message when i try to publish.
As far as i am aware im using as3 script in an as3 movie.
Thanks for any helpthanks for that Raymond, it works fine.
now what id really like to ask is, is there a way that now i have set the size, the button will stay that size no matter what size browser or screen your on?
i.e. the site has the buttons on the left and is set to fullscreen. but if i restore down the button gets smaller the smaller the screen gets. i would like the button to stay the same size.
Thanks for your help
stuart -
Goods Receipt through internal order with movement type 262
Dear Friends,
some of our users making entries like the following
1. created Internal Order
2. Creating Reservation with movement type 262 ( which not issued material through movemnt type 261)
3. Stock updated
i just want to confirm, we not issued like X material, even stock not available, we can make entries like the above, To receive X material from Internal order/ subcontractor using movement type 262.
kindly advice please if it is wrong then tell me the process.
Regards,
Rajesh GHI,
if we receive material from subcontractor what process we can do...
can you explain your issue exactly what problem you have at your end .
I think you want to take subcontracting material inside which is not in sap system now,it may finished material or it may component.If you don't want to show this material as at vendor now
then you can try movement type 501 or through physical inventory t-code MI10
Regards
Kailas Ugale -
Possible to simulate a spreadsheet for input, with static values per row
Haven't seen this done but thought I'd ask, is it possible to simulate a spreadsheet interface in Apex? Basically, I have 9 columns each of which needs to be filled out for 10 time periods per day (row), and it's easiest for the user to tab across the columns then down to a new row / next timeslot, to fill out the whole day's worth of data, rather than entering hour by hour & then changing the timeslot manually. This would require that the value for column 1 of row 1 = 8, column 1 of row 2 = 9, column 1 of row 3 = 10 and so on. So, a tabular form but with static values on each row.
Is this possible & if so, any pointers to what to start researching to make this work would be greatly appreciated. I know they can work in a spreadsheet & upoad it and we may go that way but this seemed like an interesting problem to see if Apex could handle it; I just am uncertain where to start on it is all.
Many thanks for your pointers!
gp
Edited by: 834058 on Jul 18, 2011 10:37 AMTabular report, with some modifications to have rows added at start of usage. User would on occasion need to click a control to add rows..
Thank you,
Tony Miller
Webster, TX
There are two kinds of pedestrians -- the quick and the dead.
If this question is answered, please mark the thread as closed and assign points where earned.. -
How to resolve Comparison between a value with static type string and a possible unrelated type numb
I am new to this and any help would be greatly appreciated, Im trying to display custom numbers for values of a Hslider.
Here is my code so far:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.events.SliderEvent;
protected function ValueSlider_changeHandler(event:SliderEvent):void
ValueLabel.text = String(ValueSlider.value);
if(ValueSlider.value == "0")
ValueLabel.text = "150";
if(ValueSlider.value == "1")
ValueLabel.text = "333";
if(ValueSlider.value == "2")
ValueLabel.text = "543";
if(ValueSlider.value == "3")
ValueLabel.text = "9342";
]]>
</fx:Script>
<s:Panel x="199" y="141" width="250" height="200">
<s:HSlider id="ValueSlider" x="74" y="68" maximum="5" minimum="0" stepSize="1"/>
<s:Label id="ValueLabel" x="109" y="38" text="Label"/>
</s:Panel>
</s:Application>Thank you for your help, I was using quotes around the number from a suggestion on another forum. Now how to I display the result on valueLabel? "valueLabel.text"? {valueLable.text}, "const"?,
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.events.SliderEvent;
protected function ValueSlider_changeHandler(event:SliderEvent):void
const CONVERSION:Array = ["150","333","543","9342"];
valueLabel.text = CONVERSION[valueSlider.value];
]]>
</fx:Script>
<s:Panel x="199" y="141" width="250" height="200">
<s:HSlider id="valueSlider" x="78" y="69" maximum="3" minimum="0" stepSize="1" value="1"/>
<s:Label id="valueLabel" x="109" y="38" text= "(valueLabel.text)"/> <-----what do I place here?
</s:Panel>
</s:Application> -
I am trying to update my credit card info - no longer using credit card and trying to put in a debit card and it wont accept?????
You are probably entering your Visa's security code incorrectly. Here's how to find it:
http://support.apple.com/kb/HT3541 -
1119 Error help undefined property
Here is my code:
var gameSounds:Sound = new Sound(new URLRequest("inGame.mp3"));
gameSounds.play();
var gunShotSound:Sound = new Sound(new URLRequest("gunshot.mp3"));
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.geom.Point;
stop();
gunBarrel.addEventListener(Event.ENTER_FRAME, gunEnterFrame);
function gunEnterFrame(pEvt) {
var mc = pEvt.currentTarget;
var angleRadian = Math.atan2(mouseY - mc.y,mouseX - mc.x);
var angleDegree = angleRadian * 180 / Math.PI;
mc.rotation = angleDegree;
Mouse.hide();
main_crosshair.startDrag(true);
main_crosshair.addEventListener(MouseEvent.MOUSE_DOWN, crosshairFX);
function crosshairFX (e:MouseEvent):void{
gunShotSound.play();
var projectile:bullet = new bullet();
//projectile.x = parent.mouseX;
// projectile.y = parent.mouseY;
projectile.x = gunBarrel.x;
projectile.y = gunBarrel.y;
// Save the randian angle between the mouse and the tank
// This angle will set the direction of the bullet
projectile.angleRadian = Math.atan2(mouseY - gunBarrel.y, mouseX - gunBarrel.x);
// Add an enter frame event on each bullet
projectile.addEventListener(Event.ENTER_FRAME, bulletEnterFrame);
addChild(projectile);
main_crosshair.gotoAndPlay(3);
// Velocity of each bullet
var speed = 8;
function bulletEnterFrame(pEvent) {
// Get the current object (Bullet)
var p = pEvent.currentTarget;
// Move this bullet on each frames
// On X axis use the cosinus angle
p.x += Math.cos(p.angleRadian) * speed;
// On Y axis use the sinus angle
p.y += Math.sin(p.angleRadian) * speed;
// Orient the bullet to the direction
p.rotation = p.angleRadian * 180 / Math.PI;
// You have to remove each created bullet
// So after every moves you must check bullet position
// If the bullet is out of the screen
if (p.x < 0 || p.x > 400 || p.y < 0 || p.y > 400) {
// Remove it from the display list
removeChild(p);
// /!\ AND REOMOVE HIS EVENT LISTER
p.removeEventListener(Event.ENTER_FRAME, bulletEnterFrame);
When I try to run it though I get "1119: Access of possibly undefined property angleRadian through a reference with static type bullet."
What's wrong with my code?cast p as a MovieClip and retest. if that fails, click file/publish settings/swf, tick "permit debugging" and retest to see the line number with the problematic code.
function bulletEnterFrame(pEvent) {
// Get the current object (Bullet)
var p = MovieClip(pEvent.currentTarget); -
I have a slideshow app that I want to go to certain frames when a thumbnails button is clicked. I get this error
1119: Access of possibly undefined property targetPic through a reference with static type flash.display:SimpleButton.
here is my inexperienced actionscript
stop();
var numFrames:Number = 14;
tmb1_btn.targetPic = 1;
tmb2_btn.targetPic = 2;
right_btn.addEventListener(MouseEvent.CLICK, nextPic);
left_btn.addEventListener(MouseEvent.CLICK, prevPic);
tmb1_btn.addEventListener(MouseEvent.CLICK, picFrame);
function nextPic(e:MouseEvent):void
if (currentFrame < numFrames)
nextFrame();
else
gotoAndStop(1);
function prevPic(e:MouseEvent):void
if (currentFrame > 1)
prevFrame();
else
gotoAndStop(numFrames);
function picFrame(e:MouseEvent):void
gotoAndStop(e.currentTarget.targetPic);
thanks for your timethe simple button class won't allow you to add new properties like targetPic. use a movieclip button.
-
Mxmlc 3.6 Socket.timeout undefined property
Hi,
I decided to dive into and get dirty with Flex and ActionScript. Downloaded flex_sdk_3.6.0.16995A.zip from Adobe site, extracted it, added to my path and started coding away.
I am trying to compile an ActionScript class with mxmlc in Linux (Ubuntu 10.04).
In my class I use a socket, and I try to set the timeout property, however it gives me a compile error.
Here is the class that's giving me the problem (I have left only the relevant code for clarity):
package
import flash.net.*
import flash.events.*
public class Socks4Sock
private var sock: Socket;
public function Socks4Sock(host:String, port:int):void
sock = new Socket();
sock.timeout = 5000;
I get the following error during compilation:
mxmlc Socks4Sock.as
Loading configuration file /opt/flexsdk/frameworks/flex-config.xml
/var/www/example/Socks4Sock.as(14): col: 16 Error: Access of possibly undefined property timeout through a reference with static type flash.net:Socket.
sock.timeout = 5000;
I am not sure what I am doing wrong. It seems according to the documentation, that timeout property is supported in AS3.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html#t imeout
This is the mxmlc version I am using:
mxmlc -version
Version 3.6.0 build 16995
Any help would be greatly appreciated!Thanks for the quick and consise reply. I tried that argument and gave me "command line: Error: unknown configuration variable 'player-version'"
Howerver, following up on the same idea, I searched and found out it's '-target-player'
This is the argument I used:
mxmlc -target-player=10 Socks4Sock.as
That worked. Once again, thanks. -
...undefined property keyCode...
Hi, I'm fairly new to actionscript. I was just begining to get the hang of buttons in AS2 when I dropped it to begin learning AS3. I have Adobe Flash CS3 Professional and I'm going through the "Programming Actionscript 3.0" tutorial files in the help section of the program. I've gotten past the introductory explainations and reached the first hands-on segment of the tutorial and I'm running into compiler errors like crazy. I'm 99% sure I don't have any typos or missing semi-colons.
mainText.border = true;
textIn.border = true;
var myGreeter:Greeter = new Greeter();
mainText.text = myGreeter.sayHello("");
textIn.addEventListener(KeyboardEvent.KEY_UP, keyPressed);
function keyPressed(event:Event):void
if (event.keyCode == Keyboard.ENTER)
mainText.text = myGreeter.sayHello(textIn.text);
that's the code I'm working with. I have a dynamic textbox with the lable "mainText" and an input textbox with the lable "textIn" the tutorial previously went through creating a custom class in an external file "Greeter.as" When i try to compile this I recieve the error
Description: 1119: Access of possibly undefined property keyCode through a reference with static type flash.events:Event.
Source: if (event.keyCode == Keyboard.ENTER)
I'm just totally lost right now, so any tips that could point me in the right direction to fix this and understand it better would be tremendously appreciated.In the listener you are defining it as a KeyboardEvent, so you should be consistent and retain that in the function...
function keyPressed(event:KeyboardEvent):void
If the tutorial offered the code as you had it, do not be shocked. -
Hi Guys,
I got a problem. I found these awesome Voxel-Stage3D Engine http://pixelpaton.com/?p=3713 and downloaded the sourcecode (http://www.pixelpaton.com/download/MoleHillVoxels1.zip)
I openend everything in my Flash Builder 4.6 with Flex 4.6.0 but then i got these Error Message:
1119: Access of possibly undefined property viewPort through a reference with static type flash.display:Stage3D. in
Voxel1.as on Line 56
yeah.. cool.. a bug. thats what i thougt in the first seconds. then i opend up the Voxel1.as and have a look at the Error-Line
stage3D.viewPort = new Rectangle(0, 0, W, H);
yeah.. so where is the wrong line in here? looks right to me?! but then i found out, that the viewPort property has been removed by Adobe Frome Stage 3D and i read someting like
Developers should instead use the Stage3D.x and Stage3D.y properties. Width and height can only be set using the Context3D object.
and now this part gets difficult to me... actually i just sit in front of the code and think "what? what should i do?" the lines are now:
var stage3D:Stage3D = stage.stage3Ds[0];
stage3D.addEventListener(Event.CONTEXT3D_CREATE, initialize);
stage3D.requestContext3D(Context3DRenderMode.AUTO);
stage3D.viewPort = new Rectangle(0, 0, W, H);
var c:Camera = new Camera(W,H, this.stage);
addChild(c);
and the fourth line is wrong. so, could you be so kind and tell me how i should change the line now? sorry but... i dont get it :-/ok, that helps a lot.
after i scroll threw the reference page i guess its something like:
public function Context3D_drawToBitmapData()
stage3D = this.stage.stage3Ds[0];
stage3D.x = 0;
stage3D.y = 0;
//Add event listener before requesting the context
stage3D.addEventListener( Event.CONTEXT3D_CREATE, contextCreated );
stage3D.requestContext3D( Context3DRenderMode.AUTO );
//Compile shaders
vertexAssembly.assemble( Context3DProgramType.VERTEX, VERTEX_SHADER, false );
fragmentAssembly.assemble( Context3DProgramType.FRAGMENT, FRAGMENT_SHADER, false ); }
but, that doesent work eather :-/
but i goess iam close to a final solution... or at least something near to that -
Call to a possibly undefined method setPropertyIsEnumerable?
Hi,
I am trying to accomplish using doubleClick events on dateChoosers. Below is the code that is working:
<mx:VBox>
<mx:Label text="Simple DateChooser control."/>
<mx:DateChooser id="dateChooser1" doubleClickEnabled="true"
doubleClick="displayDate2()"
change="displayDate(DateChooser(event.target).selectedDate)"/>
<mx:Label id="selection" color="blue" text="Date selected:"/>
</mx:VBox>
I tried putting in doubleClickEnabled as true in Actionscript, and then call the event, and this is the syntax I used:
//enable the double Click Enabled Property
dch.setPropertyIsEnumerable("doubleClickEnabled",true);
dch.addEventListener("doubleClick", useDate2);
This did not work, and I got this error instead: 1061: Call to a possibly undefined method setPropertyIsEnumerable through a reference with static type mx.controls:DateChooser.
I tried to find a suitable import statement to insert in my code, but I am not sure what to put there. Could anyone please give me a hint what to do here to get my code to accept the method?
Thanks in advance.
AliceHi, Ryan:
Thanks, I got that to work, but it seems like the doubleClick does not allow me to use it on the dateChooser. Here is the code:
The MXML:
<mx:VBox id="box2">
<mx:DateChooser id="dch" doubleClickEnabled="true"
doubleClick="displayDate2()"
change="displayDate(DateChooser(event.target).selectedDate)"/>
</mx:VBox>
The same thing in Actionscript, but not working:
dch = new DateChooser();
dch.addEventListener("change", displayDate);
dch.doubleClickEnabled = true;
dch.addEventListener("doubleClick",displayDate2);
//Got an error saying TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent@20112769 to
//mx.events.CalendarLayoutChangeEvent.
box2.addChild(dch);
Could you give me some pointers on what I have wrong here?
Thanks for your help.
Alice -
Call to a possibly undefined method asyncResponder
Hi, why would I be getting this error for this code
token.addResponder(Async.asyncResponder(this, new AsyncResponder(onResult, faultHandler), 600));
1061: Call to a possibly undefined method asyncResponder through a reference with static type Class.
my imports look fine
import flexunit.framework.Assert;
import org.flexunit.async.Async;that method is only available in the flex version of flexunit. since it depends of an flex library class, it is not included in the actionscriptonly build
Maybe you are looking for
-
how can i activate an ipad that was attached to someones icloud account. I am not able to reach the person to have them release it
-
Error in MSS Report (Using MSS Reporting Launch Pad)
Hello, I'm currently using the convert manager's desktop data to MSS report launch pad for the portal. When trying to run the report in MSS, I'm getting the error below: "Error in Manager Self Service. When calling the report, the following error oc
-
Essbase Load Rules File Header Issue
Hi, Is it possible to specify more than one member for the same dimension in the Load Rules file Header? Example: I need to load the same data in all the remaining months in current year. I tried using a substitution variable in the header which is d
-
How can I use Java 3D in Linux ?
As the subject.
-
BW Hierarchy imported into Universe
We are importing our PVA Cost Allocations cube into a Web Intelligence Universe. When that information comes across we have all of our data elements including the hiearchy master data for items such as cost element, cost center, etc. When you display