Havent Even Started Workin..gettin Class Name Error
so im cheking out the new flashMX2004, i click on the "form apllication" thing in that first welcome menu that appears and already wihtout even touching the thing i get an error so large the board says is too long to publis but it goes something like this:
Code:
**Error** C:Documents and SettingsAdministradorConfiguración localDatos de programaMacromediaFlash MX 2004enConfigurationClassesmxskinsSkinElement.as: Line 18: The name of this class, 'mx.skins.SkinElement', conflicts with the name of another class that was loaded, 'mx.skins.SkinElement'. class mx.skins.SkinElement extends MovieClip that same error happens about 30 o so times...(for some reason the out put doesnt say the usual "xxx errors reported")
whazzp with that? same thing happens if i try to drag ANY component....already tried unistalling and reinstalling...
does any one know?
where are this conflicts at?
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-15-2003, 05:26 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Gettin Started..
Yo homies,
I'm the kind of guy who learns by doing.
Are there any step by step tutorials out there on how to make advance Flash Sites from scratch?
Preloader - Intro - Navigation - Gallery and so on?
All in actionscript...
I'm tired of looking on google for stuff in this direction...plz help...
Also Gettin That 1009 Error
ok this doesnt make any since and im about to distroy my comp trying to figure this out, here my roll over and out functions
quote:
stop();
function overpdp(event:MouseEvent):void {
gotoAndStop(2);
}
function overCSUDSU(event:MouseEvent):void {
gotoAndStop(3);
}
function overredcom(event:MouseEvent):void {
gotoAndStop(4);
}
function overPSupply(event:MouseEvent):void {
gotoAndStop(5);
}
function overGateway(event:MouseEvent):void {
gotoAndStop(6);
}
function overUPS(event:MouseEvent):void {
gotoAndStop(7);
}
function out(event:MouseEvent):void {
gotoAndStop(1);
}
pdp.addEventListener(MouseEvent.MOUSE_OVER, overpdp);
CSUDSU.addEventListener(MouseEvent.MOUSE_OVER, overCSUDSU);
redcom.addEventListener(MouseEvent.MOUSE_OVER, overredcom);
PSupply.addEventListener(MouseEvent.MOUSE_OVER, overPSupply);
Gateway.addEventListener(MouseEvent.MOUSE_OVER, overGateway);
UPS.addEventListener(MouseEvent.MOUSE_OVER, overUPS);
there are my functions so on each page after words i have this
quote:redcom.addEventListener(MouseEvent.MOUSE_OUT, out);
it works for the first two frames but after that, it shoots me those errors on the mouse out event listener, any ideas why thats not working?
Gettin Type Coercion Error
Hello,
I have a webservice that operates on a datamodel, as shown in the xsd given below(part of it):-
<complexType name="PersonNameType">
<sequence>
<choice maxOccurs="unbounded">
<element name="GivenName" type="mpeg7:NameComponentType" />
<element minOccurs="0" name="LinkingName" type="mpeg7:NameComponentType" />
<element minOccurs="0" name="FamilyName" type="mpeg7:NameComponentType" />
<element minOccurs="0" name="Title" type="mpeg7:NameComponentType" />
<element minOccurs="0" name="Salutation" type="mpeg7:NameComponentType" />
<element minOccurs="0" name="Numeration" type="string" />
</choice>
</sequence>
</complexType>
<complexType name="NameComponentType">
<simpleContent>
<extension base="mpeg7:TextualBaseType">
<attribute name="initial" type="string" use="optional" />
<attribute name="abbrev" type="string" use="optional" />
</extension>
</simpleContent>
</complexType>
While invoking webservice from flex using AS3
Setting values in the givenname of NameComponentType throws the following Exception:
Error #1034: Type Coercion failed: cannot convert tva.mpeg7._2005::NameComponentType@30acc69 to QName.
Somehow it is not able to identify the NameComponent Type, the moment i try to create and initialize its values, i get the above error.
Kindly advice as to what might be happening ...
Thanks in advance,
KayGeeBee
Stump On Gettin Data Form Custom Class
hello, I created this custom class after reading some tutorials. everything works but i have no clue on how to get the data.
Q: how to get xmlList from the stage?
PHP Code:
package as3 {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
public class XmlLoader extends Sprite {
var xmlData:XML;
var xmlList:XMLList;
public function XmlLoader(address:String) {
var xmlRequest:URLRequest = new URLRequest(address);
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(xmlRequest);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
function xmlLoaded(events:Event) {
xmlData = XML(events.target.data);
[b]xmlList = xmlData.children();[/b]
}
}
}
Getting Started With Built-in Display Class
Hello all,
I have a newbie question. I just installed Flash CS3 and I'm trying to get basic functionality working. I can't seem to display anything. It's recognizing the document class (Hello.as). I can trace messages in this class but just can't display anything to stage after addChild(). The app is recognizing the flash.display.* classes and flash.text.TextField class so the default classpath is correct. I get no compile errors. Just nothing displayed.
Here's my simple test class named Hello.as in the same folder as the launch.fla:
ActionScript Code:
package {
import flash.display.*;
import flash.text.TextField;
public class Hello extends Sprite {
public function Hello() {
var txt:TextField = new TextField();
txt.text = "Hello world";
txt.x = 60;
txt.y = 25;
addChild(txt);
}
}
}
I'm creating an instance of this class in frame 1 of my launch.fla with this script:
import Hello;
var a = new Hello();
I know it's a small newbie problem I'm just not seeing. Any advice appreciated.
TIA,
Michael
Getting Started With Built-in Display Class
Hello all,
I have a newbie question. I just installed Flash CS3 and I'm trying to get basic functionality working. I can't seem to display anything. It's recognizing the document class (Hello.as). I can trace messages in this class but just can't display anything to stage after addChild(). The app is recognizing the flash.display.* classes and flash.text.TextField class so the default classpath is correct. I get no compile errors. Just nothing displayed.
Here's my simple test class named Hello.as in the same folder as the launch.fla:
package {
import flash.display.*;
import flash.text.TextField;
public class Hello extends Sprite {
public function Hello() {
var txt:TextField = new TextField();
txt.text = "Hello world";
txt.x = 60;
txt.y = 25;
addChild(txt);
}
}
}
I'm creating an instance of this class in frame 1 of my launch.fla with this script:
import Hello;
var a = new Hello();
I know it's a small newbie problem I'm just not seeing. Any advice appreciated.
TIA,
Michael
Stopping Sound Started In Timeline From A Class
I made a Class that when I click a button it goes to the next frame. Unfortunately every frame has sound and I want the sound that began in the current frame to stop when the button is clicked to go to the next frame. The sound is already setup to advance the timeline one frame when it is done, but the user will be able to advance it a frame before the sound is over, so in that case I want the sound to be stopped when the button is clicked.
Here is the code for the class that controls the button:
Code:
package lesson
{
import flash.display.*;
import flash.events.*;
public class NextButton extends SimpleButton
{
public function NextButton()
{
this.addEventListener(MouseEvent.CLICK, oneFrameForward);
}
private function oneFrameForward(evt:MouseEvent):void
{
MovieClip(DisplayObjectContainer(root)).gotoAndPlay(MovieClip(DisplayObjectContainer(root)).currentFrame + 1);
}
}
}
Here is the code that is on the timeline that plays the sound (only part of the code, the part with the necessary variable info):
Code:
var teachURL:URLRequest = new URLRequest("micRec1.mp3");
var micTeach:Sound = new Sound();
micTeach.load(teachURL);
var channel1:SoundChannel = micTeach.play();
var mySoundTransform:SoundTransform = new SoundTransform();
mySoundTransform.volume = 1;
Help Gettings Started With Flash Media Server 2.0 And The Camera Class
Hello,
I just purchased flash media server 2.0 and flash CS3. Id like to build an app that allows a user to record a video using their webcam and upload it to the server, and in turn stream / display the video on the web server.
So far this is where I'm at. I installed FMS and created a FLA that opens the users web cam and displays the video. The code is pretty basic:
// Declare Video instance on the stage
var vid:Video;
// Create a reference to the user's camera
var userCam:Camera = Camera.get();
// Attach the camera output to the Video instance
vid.attachVideo(userCam);
From here, how do I save the video as a FLV and upload it to the server? I am used to using FFMPEG - will I need this or should I use the new Flash Encoder?
I am running FMS on IIS 7.0 on the same box as my ASP.NET and IIS web server. Will I need to do any tricky configuration with IIS to allow them to run in parallel?
Also, when i open the "FMS2_Console" and try to connect I get an error. The login screen has a box for the "Server Address" and username/password. In the server field I'm typing "Localhost". It won't let me connect, even though I have the right username and pwd. Is somehting wrong?
Thanks.
Havent Got Help Yet?
Hello. I have yet to get any replys. I am not yelling. I love this how people can help everyone. Ok. I made a site on word. I uploaded them onto the internet. Problem is that I put pictures from files I have on my computer. I cant seem to get them to work on the site. What do I need to do??? Link them somehow??? PLZ I really am getting angry at myself. Thx. Detailed answers would be great but anything would help.
Thx
Jake
Havent A Clue...anyone?
Hi
Probably the stupidest question ever posted here, but you never know maybe someone can help. I have had a flash web site designed for me and have the .fla files, can anyone tell me how I can export the images from the .fla files - So as I can reuse them for eg. lets say a bog standard html site??
Thanks in advance...
Paul
Havent Got A Reply? Help
Hello. I have yet to get any replys. I am not yelling. I love this how people can help everyone. Ok. I made a site on word. I uploaded them onto the internet. Problem is that I put pictures from files I have on my computer. I cant seem to get them to work on the site. What do I need to do??? Link them somehow??? PLZ I really am getting angry at myself. Thx. Detailed answers would be great but anything would help.
Thx
Jake
Rookie Q, So Easy I Havent Seen It Answered....
Folks,
I have not found any FAQs on this but , it is step zero.
A web developer made some flash pages, he is out of contact now. These are .swf, .fla, and .html files. Pages were done in flash so the pictures on the site wouldnt be stolen.
Q: How do I modify the text for the site? I don't see text in the .html files, Is it in the .swf, .fla? I dont't own Flash, but my girlfriend just got a copy. We tried to modify an fla, I believe, and uploaded it , but no luck, Are we doing this right?
Thanks!
**Error** ActionScript 2.0 Class Scripts May Only Define Class........
**Error** ActionScript 2.0 class scripts may only define class or interface constructs.
b2.onPress = function() {
**Error** ActionScript 2.0 class scripts may only define class or interface constructs.
b3.onPress = function() {
**Error** ActionScript 2.0 class scripts may only define class or interface constructs.
b4.onPress = function() {
ok this is what i have.
1 Movie clip with links to a .as file all is working fine the above error occurs when i publish the 1 movie clip which is getting pulled into the main movie
Any idea's it does not happen when 1 movie clip is published on its own just when 1 move clip is pulled into my main movie clip.
Gettin Time
Is there a way to get the time from your computer as opposed to getting it from a server?
Gettin Jiggy With It
Hi there
Id like to get a bit of help or maybe a pointer to some tutorial explaining how to make thingg bouncy. I love this effect and would love to learn and experiment with it
I particulary like these sites for sheer bouncyness
http://www.nexuslondon.com/main.html
http://www.seven.it/
xx
Gettin The Name Of The Swf The Actions In
hey folks, is there any action or trace command that gets the name of the swf itself.
so if my swf is called "myFile.swf" can I have an action that gets "myFile.swf"
Decompiler Not Gettin All?
Alrite so I dl'd the trial version of the SoThink Decompiler and it does show me theres 40 audio clips but when I open up the flash file nothings there.
Would anyone be able to decompile a swf for me and see if their results differ?
Problem only seems to be with NO audio.
Thanks a ton, folder got deleted and only backup was a swf on the server.
EDIT: Link to swf
or can send via email
Should Be Simple But I'm Not Gettin It. HELP
Basically,
I have a button that I would like to be able to click and have it play the movie clip and stop on a designated frame but, the catch is I need to do this without putting a stop action on the frame in the timeline itself.
ie. on (press) {this.playAndStop(13);
}
of course the above doesn't work.
{gotoAndStop() doesn't help me as it jumps to and stops on the frame. I want the movie to play through and then stop on frame.
What should I do?
Thanks
d.
Gettin' Rid Of BlurFilter
this is the code i used:
ActionScript Code:
import flash.filters.BlurFilter;var Blur:BlurFilter = new BlurFilter(5, 5, 3);var unBlur:BlurFilter = new BlurFilter(0, 0, 0);greenbtn.onPress = function() { greenbg.filters = [blur];};greenbtn2.onPress = function() { greenbg.filters = [unBlur];};
problem is, when i unblur it, the whole movie felt laggy, i think it's because the blur effect stays within the greenbg.
i thnk i'm sorta like faking it by using the AS above, how do i just get rid of the blur effect?
any ideas?
Help Gettin' Me Buttons Up...
Hi -
I have a dynamic background - movie clips with elasticity. On top of them are buttons, each having a white box and some descriptive text in the 'Over' state of the btn. Even though the clips are only taking depths 0-5, I can't get these buttons over them. [No swapDepths() for btns., eh?]
Currently, the text only shows subliminally, depending on where the clip's bouncing...
Too new to keep trying,
[help]
El
[F8] NAN Error In Class
here on key UP/DOWN i get cIndex = NaN
why?? it's used as number everywhere
please help...
instance of this is created by attachMovie
because this class is linked with movieClip symbol in library
class CViewMENU extends MovieClip{
var cIndex:Number = 0;
var keyList:Object = null;
var this_mc:MovieClip = null;
//--------------------------------------------
function CViewMENU(){
trace("CViewMENU constructor");
this_mc = this;
setActive();
}
//----------------------------------------------------------
function setActive(){
trace("CViewMENU.setActive");
keyList = new Object();
keyList.onKeyDown = fOnKeyDown;
Key.addListener(keyList);
}
//----------------------------------------------------------
function setInactive(){
trace("CViewMENU.setInactive");
Key.removeListener(keyList);
}
//----------------------------------------------------------
function fOnKeyDown(){
trace("CViewMENU.onKeyDown");
switch(Key.getCode()) {
case Key.UP :
trace("onKeyDown UP");
cIndex--;
break;
case Key.DOWN :
trace("onKeyDown DOWN");
cIndex++;
break;
}
trace("cIndex = "+ Number(cIndex));
}
//----------------------------------------------------------------------
}
NAN Error In Class
here on key UP/DOWN i get cIndex = NaN
why?? it's used as number everywhere
please help...
instance of this is created by attachMovie
because this class is linked with movieClip symbol in library
class CViewMENU extends MovieClip{
var cIndex:Number = 0;
var keyList:Object = null;
var this_mc:MovieClip = null;
//--------------------------------------------
function CViewMENU(){
trace("CViewMENU constructor");
this_mc = this;
setActive();
}
//----------------------------------------------------------
function setActive(){
trace("CViewMENU.setActive");
keyList = new Object();
keyList.onKeyDown = fOnKeyDown;
Key.addListener(keyList);
}
//----------------------------------------------------------
function setInactive(){
trace("CViewMENU.setInactive");
Key.removeListener(keyList);
}
//----------------------------------------------------------
function fOnKeyDown(){
trace("CViewMENU.onKeyDown");
switch(Key.getCode()) {
case Key.UP :
trace("onKeyDown UP");
cIndex--;
break;
case Key.DOWN :
trace("onKeyDown DOWN");
cIndex++;
break;
}
trace("cIndex = "+ Number(cIndex));
}
//----------------------------------------------------------------------
}
Class Error
Hey. I am creating a simple game for school using flash. I am trying out classes since I haven't done them in flash yet. I'm getting this error:
Code:
**Error** Scene=Scene 1, layer=Actionscript, frame=1:Line 1: Classes may only be defined in external ActionScript 2.0 class scripts.
class Player
Total ActionScript Errors: 1 Reported Errors: 1
With this code:
Code:
class Player
{
// data members
var pos_x:Number;
var pos_y:Number;
var sprite_size_x:Number;
var sprite_size_y:Number;
var nam:String;
var hp:Number;
var str:Number;
// member functions
function walk(direction:Number)
{
switch(direction)
{
// up
case 0:
{
if((pos_y - 1) >= 0)
pos_y -= 1;
else
pos_y = 0;
}
// down
case 1:
{
if((pos_y + 1) < 500)
pos_y += 1;
else
pos_y = 500;
}
// left
case 2:
{
if((pos_x - 1) >= 0)
pos_x -= 1;
else
pos_x = 0;
}
// right
case 3:
{
if((pos_x + 1) < 500)
pos_x += 1;
else
pos_x = 500;
}
}
}
}
So how and where does this "external script" go? (This code is on it's own layer in frame 1).
How To Fix This AS2 Error (class Already In Use)
Does anyone has a clue on how to fix the AS2 class error that says the name of the class is in use?
Quote:
**Error** Z:CarinhosoFLApicMotions.as: Line 4: The name of this class, 'picMotions', conflicts with the name of another class that was loaded, 'picMotions'.
{
Total ActionScript Errors: 1 Reported Errors: 1
Also, I have a code like this...
PHP Code:
var aaa:picMotion = new picMotion(img, "foto2", 5);
When I update the class with and error on porpouse it doesnt tell me anything... it keeps using the "old class build" that works and does not update it...
Flash MX2004 was all good, im having !¨%@¨%# nightmares with this problema in Flash 8, anyone else here?
AS 2.0: Class Error
Hi. This is my class definition:
Code:
import flash.xml.XMLDocument;
class mngXML {
var xmlHandle:Object;
var myXML:XML;
var count;
function mngXML() {
trace('constructor');
this.myXML = new XML();
this.myXML.ignoreWhite = true;
//this.myXML.onLoad = loadData();
}
private function loadData(loaded) {
trace('load data');
if (loaded) {
trace('ok');
this.xmlHandle = this.myXML.firstChild;
this.count = this.myXML.childNodes.length;
}
else {
trace('shhhh');
}
}
public function loadFile(filename:String,count) {
this.myXML.onLoad = loadData();
trace('load file');
this.myXML.load(filename);
}
}
in 1st frame i have:
Code:
var manager:mngXML = new mngXML();
manager.loadFile("file.xml",2);
can anybody tell me what I'm doing wrong?
Help With AS2.0 Class Error In Fl8
I have spent the better part of the day writing a script that implements the new static Zigo Engine and MosesSupposes Fuses and I get almost completely finished when I get the weirdest error suddenly:
**Error** P:Web ProjectsinProgresssectionButton.as: Type mismatch.
No line number or anything. Any Suggestions? I'll post my code if need be (and risk being harrassed to death for my inept coding skills), but I was hoping that someone else had experienced this rather obtuse error and could tell me how to fix it easily.
Oh, and btw, I've tried the ASO cache clearing thing and rebooting and it didn't help.
Thanks in advance for your support,
best wishes,
jase
Class Error
G'day
I am attempting to use Lee's reflection, read the forum pages but still can't get it to work. I put the folder com in the en/first run/classes in the c-program/flash8 folder. Did not work. syntax error.
Made sure export flash8, action script 2. Went to preferences and showed it the path. Did not work.
Then put the com folder in the same folder as the fla still did not work the last error was
**Error** C:Documents and SettingsStephenMy Documentslees_reflectioncomleebrimelowutilsReflection.as: Line 1: Syntax error.
Code:
Total ActionScript Errors: 1 Reported Errors: 1
What am I doing wrong? The lees_reflection is the folder I have the fla and com folder in.
Thaks
easy
Gettin My Ass Kicked By A Preloader
Ugh. I'm having a hell of a time with a simple preloader.
I have a scene made for the preloader.
Frame 1:
stop ();
ifFrameLoaded ("Logging On", "logon4") {
nextScene ();
}
gotoAndPlay (2);
Frame 2:
gotoAndPlay (1);
This should work, right? The problem is that when this script is in the movie, I get a "THERE IS A SCRIPT IN THIS MOVIE CAUSING FLASH TO RUN SLOWLY. IF YOU LET IT RUN, YOUR COMPUTER MAY BECOME UNRESPONSIVE. ABORT?"
So, I apparently made some nasty loop, but for the life of me, I can't see what the problem is.
I'm sure it is something obvious...I just don't see it.
Thanks.
Gettin Variable From Txt Into DuplicatedMovieClip
hi,
I got a variable out of a txt file and I was able to pass it to a duplicated movie clip, but now i want to pass for each movieclip a different variable. In the txt-file they're called a1,a2,a3 and so on. And here's my problem:
when I duplicate the movieclip I count up a variable 'x' which is at first equal to 1. Then I want to pass it by using:
Code:
tellTarget ("mc"+x) { mcvariable = /:a[x]; }
but this doesn't work.
So can anyone help me please?
bye
dudenz
Gettin' Crafty With The Buttons
i am building a gallery site. in each section i have a row of buttons ( wide and only a few pixels tall, close together ). i have an invisible button controlling a MC that plays a roll over movie and a roll out movie. i am setting a variable when you mouse over the button so that it refers to the specific movies realted to that button. i am doing this to try and avoid making like 80 separate buttons. the problem is this; if you mouse over the movies slowly, then its all fine, the nice over movie and roll out movie play and i get the effect i am looking for, but if you move too fast, the buttons get stuck, i guess if flips the variable over to the next movie and leaves the previous one hanging. should i just make separate buttons for each item, or is this doable the way i am trying...
Gettin' A Variable Out Of A Function?
MX 2004, this is living on the first frame of the top layer.
I need to pass the _root.sku variable to a dymnamic text box (it has it's var set to _root.sku) That part works fine. The problem is getting the _root.dms1 variable set from the (ext.target.selectedItem.data) value. I get an 'undefined' out of the dms1 and 2 variables. I'm trying to set this value inside a function. The function is pulling the values out of some combobox's (which by the way I finally got working.....)
Any thoughts on how to set this dms1 variable so it can be used elsewhere? Thanks
<snip>
_root.sku = "636" + _root.dms1 + _root.dms2;
listener = new Object()
listener.change = function(evt){
loadMovieNum("http://somewebsite.com/flash/636/" + evt.target.selectedItem.data + ".swf",2);
trace(evt.target.selectedItem.data);
//here's were I'm trying to set the variable
_root.dms1 = (evt.target.selectedItem.data);
}
outerCombo.addEventListener("change", listener)
<snip>
Gettin Pics In Flash
anyone know how to save pics that displayed in flash, since u cant right click and save as
[as] Gettin Rid Of CreatTextField Info?
Im creating a text field via actionscript with the following code
ActionScript Code:
_root.createTextField("welcome_txt", i+1, 120, 225, 550, 20);
var welc_txt = _root["welcome_txt"];
welc_txt.html = true;
welc_txt.border = false;
welc_txt.background = true;
welc_txt.backgroundColor = 0xA5A98B;
welc_txt.selectable = false;
welc_txt.htmlText = "<font face="Verdana, Arial, helvetica, sans-serif" size="-1">Updates</font>";
I need to un load the data on a frame action, what can i use to make the text fade out progamatically or jus plain dissapear. I tried making the container tht its loaded into not be visible anymore but it didnt work - i guess the text gets loaded into flash's layer stack.... any more efficent way of gettin rid of this then jus simply settin the text fields values to nothing?
Thanks for any help ultrashock rawks!!
Class Naming Get Me An Error
hi,
i want to call my class "CompName.Components.TextFeeder",
but in my movie, when i do -
Code:
var t:TextFeeder = new TextFeeder();
i get this error -
The class 'Ts.Components.TextFeeder' needs to be defined in a file whose relative path is 'TsComponentsTextFeeder.as'.
why is that
Avi.
Weird Class Error.
I've got some code in a file called kitchenVideo.as.
The code starts as follows:code: function initialisation()
{
kitchenVideo = "kitchenVideo.flv";
...
...
There are a few insignificant lines aboe the kitchenVideo = ... line...
And there are other bits of code below.
The compiler just throws an error saying something about AS2 classes.
But... after much time and damn effort...
I've tracked down the problem to this line.
I've read Penner's book. I can't remember, but I think he mentions something about a class referencing itself or something by calling it's own name??
I've got Moock's AS2 book... just starting to read...
The problem is that even if the line kitchenVideo = ... isn't the same as the file name, it still throws an error. It's only when I call the variable a completely non related name does it stop throwing an error.
WHAT'S HAPPENING!?
Thanks.
OM
Class Error In Flash 8
I've been trying to integrate Senocular's Ease class into my SWF and when I preview the file, I get this error in the output window:
**Error** C:Documents and SettingsPhilippe DENIGERMy DocumentsProjects DriveProject FilesWork Safe For LifeflashEase.as: Line 8: Classes may only be defined in external ActionScript 2.0 class scripts.
class com.senocular.Ease {
**Error** C:Documents and SettingsPhilippe DENIGERMy DocumentsProjects DriveProject FilesWork Safe For LifeflashEase.as: Line 8: The class 'com.senocular.Ease' needs to be defined in a file whose relative path is 'comsenocularEase.as'.
class com.senocular.Ease {
Total ActionScript Errors: 2 Reported Errors: 2
Any idea what I can do to fix that?
Thanks !
Class Path Error
I'm new to AS3 and when I try to do the same package structure in AS3 as I did in AS2 it doesn't seem to work.
my swf file is in a folder called deploy.
Outside the deploy folder is another folder called source. Inside the source folder is another folder called com.
source/com
I set my claspath in the document settings like so:
file->Publish Settings->ActionScript 3.0 settings>SourcePath
I clicked the + button and added the following relative path.
../source
Inside my flash file on the first frame I try to import the class and create an instance of the class but it fails and gives me an error.
Code:
import com.TestClass;
var test:TestClass = new TestClass();
[quote]1172: Definition source.com:TestClass could not be found.
Here is my class code.
Code:
package com {
public class TestClass{
public function TestClass(){
trace("TEST WORKNG");
}
}
}
What am I doing wrong here the same structure works in AS2 but not for AS3
Actionscript 2.0 Error No Class
When I convert from Actionscript 1.0 to 2.0 I get this error message:
**Error** Symbol=room_exercise, layer=actions, frame=1:Line 1: There is no class with the name 'Number'.
var Number=0
Total ActionScript Errors: 1 Reported Errors: 1
How can I fix this?
Class Path Error
5000: The class 'todd.interactive.DisablingButton' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
I have the class path correct and the all the .as file are where they should be but for some reason I get the message. Can anyone help?
Class Properties Error
I am working on my first class and so far so good. I am on the last stretch where I need to pass properties to the class. This seems simple enough but I keep getting this error
1137: Incorrect number of arguments. Expected no more than 0.
I am following the examples I have found and not sure what could be causing that.
here is my constructor code
Code:
import com.rdm.zooms.zoomerSA
var a:String = "img.jpg"
var myzoomer:zoomer = new zoomer(a);
var zmr:Sprite = new Sprite();
zmr.addChild (myzoomer)
addChild(zmr);
and here is my class
Code:
package com.rdm.zoomas
{
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
import flash.geom.Rectangle;
public class zoomer extends Sprite {
private var _loaderHolder:Sprite = new Sprite();
var _loader:Loader = new Loader();
public var _zTogle:Boolean = false;
function zoomer (a:String) {
this.ina=a;
loadImage ("assets/images/2.jpg");
}
public function loadImage (u:String) {
_loader.contentLoaderInfo.addEventListener (Event.COMPLETE,onComplete);
var request:URLRequest = new URLRequest(u);
addChild ( _loaderHolder );
_loader.load (request);
_loaderHolder.addChild (_loader);
_loaderHolder.scaleX=.5;
_loaderHolder.scaleY=.5;
var square:Sprite = new Sprite();
square.graphics.beginFill (0xFF);
square.graphics.drawRoundRect (0, 0, 200, 200, 10, 10);
square.graphics.endFill ();
addChild (square);
_loaderHolder.mask=square;
buildBtn ();
}
function buildBtn () {
var square:Sprite = new Sprite();
square.graphics.beginFill (0xFF);
square.graphics.drawRoundRect (0, 0, 20, 20, 10, 10);
square.graphics.endFill ();
addChild (square);
square.addEventListener (MouseEvent.MOUSE_DOWN, zBtnDown);
}
private function zBtnDown (event:MouseEvent):void {
var sprite:Sprite = Sprite(event.target);
if (!_zTogle) {
_loaderHolder.addEventListener (MouseEvent.MOUSE_DOWN, mouseDown);
_loaderHolder.addEventListener (MouseEvent.MOUSE_UP, mouseReleased);
_loaderHolder.scaleX=1;
_loaderHolder.scaleY=1;
_loaderHolder.x=-100
_loaderHolder.y=-100
_zTogle=true;
} else {
_loaderHolder.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDown);
_loaderHolder.removeEventListener (MouseEvent.MOUSE_UP, mouseReleased);
_loaderHolder.scaleX=.5;
_loaderHolder.scaleY=.5;
_loaderHolder.x=0
_loaderHolder.y=0
_zTogle=false;
}
}
function mouseDown (event:MouseEvent):void {
var myRectangle:Rectangle=new Rectangle(-100,-100,100,100);
_loaderHolder.startDrag (false,myRectangle);
}
function mouseReleased (event:MouseEvent):void {
_loaderHolder.stopDrag ();
trace (_loaderHolder.dropTarget.name);
}
public function onComplete (ev:Event):void {
}
}
}
as you can see I have the function in the class set up to tage arguments. and the constructor is passing them. any help would be great.
Class Import Error (?)
Hello all. I'm having problems importing multiple classes in MX 2004. I don't have the pro version.
Whenever I try to import more than one class i get the following error:
**Error** Scene=Scene 1, layer=classes, frame=1:Line 6: The class 'node.as' cannot be imported because its leaf name is already being resolved to imported class 'tabset.as'
Where tabset is the first class and node is the second. If i try to import a third, it throws the error twice.
The class appears to load and I can use it, but I want this error to go away. Anyone else run into this??
Thanks!
Document Class Error
I am working with Windows Vista Business if that makes a difference in this question.
I am testing a class file for NoScale called NoScale.as
I have created the class file attached.
I have saved the class file in the same location as the fla file.
I put in the document.class box: NoScale
Whenever I publish, I receive the following error:
5008: The name of definition 'Main' does not reflect the location of this file. Please change the definition's name inside this file, or rename the file. C:Users\%UserName%DesktopWebsiteReference FlasNoScale.as
(Note: I have replaced my username with %UserName%)
I have attempted to put C:Users\%UserName%DesktopWebsiteReference FlasNoScale.as into the document class box and I receive an error telling me that the 's are incorrect and are not allowed.
Attach Code
package {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.StageQuality;
public class Main extends MovieClip {
public function Main() {
trace ('Main')
stage.quality = StageQuality.BEST;
stage.scaleMode = "noScale";
stage.showDefaultContextMenu = false;
stage.align = "TL";
}
}
}
Exponential Class Error
I'm trying to use this function:
function scaleUp(event:MouseEvent):void {
TweenLite.to(event.target, 1, {scaleX:1.5, scaleY:1.5, ease:Exponential.easeOut});
}
function scaleDown(event:MouseEvent):void {
TweenLite.to(event.target, 1, {scaleX:1, scaleY:1, ease:Exponential.easeOut});
}
And am getting an error on the output:
1120: Access of undefined property Exponential.
Weird Class Error.
I've got some code in a file called kitchenVideo.as.
The code starts as follows:
ActionScript Code:
function initialisation(){ kitchenVideo = "kitchenVideo.flv"; ... ...
There are a few insignificant lines aboe the kitchenVideo = ... line...
And there are other bits of code below.
The compiler just throws an error saying something about AS2 classes.
But... after much time and damn effort...
I've tracked down the problem to this line.
I've read Penner's book. I can't remember, but I think he mentions something about a class referencing itself or something by calling it's own name??
I've got Moock's AS2 book... just starting to read...
The problem is that even if the line kitchenVideo = ... isn't the same as the file name, it still throws an error. It's only when I call the variable a completely non related name does it stop throwing an error.
WHAT'S HAPPENING!?
Thanks.
OM
[as3]Error With Video Class
When I try and use the video class in as3, I get this error:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property onMetaData not found on flash.net.NetStream and there is no default value.
at com.infinity.components::ISMPlayer$iinit()
at Timeline0_d569d4230dd2142a716fd8ed9b47926/::frame1()
Any ideas?
AS2 Error Class Import
I dont have a clue
Code:
import mx.managers.DepthManager;
a_btn.onRelease = function() {
b_btn.setDepthTo(DepthManager.kTop);
var b_depth:Number = b_btn.getDepth();
trace(b_depth);
}
b_btn.onRelease = function() {
a_btn.setDepthTo(DepthManager.kTop);
var a_depth:Number = a_btn.getDepth();
trace(a_depth);
}
I get the following Error Code
Code:
Error:
C:Dokumente und EinstellungenBesitzerLokale EinstellungenAnwendungsdatenMacromediaFlash 8deConfigurationClassesmxmanagersDepthManager.as: Zeile 193: Keine Eigenschaft mit dem Namen '_topmost' vorhanden.
if ( depthFlag == mx.managers.DepthManager.kTopmost) o._topmost = true;
Anzahl der ActionScript-Fehler: 1 Gemeldete Fehler: 1
Any1 know this??
It is German but I guess it is the same on English ...
I am a bit lost, coz i reinstalled me Flash and got the same ???!!!
any help is much appreciated
Timer Class Error
I have been trying to make a gun type function and its been going really well but i have been trying to put in a reaload function and i decided to use timer class, and failed.... So i thought id ask the gurus and hers the code.
Code:
package {
//
import flash.display.*;
import flash.events.*;
import flash.utils.Timer;
import flash.utils.Timer;
//
public class InfectedScripting extends MovieClip {
public var iGun:MovieClip = new MovieClip();
private var iBulletSpeed:Number = 65;
private var bulnum:int = 1;
private var bulletOffset:Number = 0;
private var bulletLifeTimerTotal:Number = 100;
private var reloadSpeed:Number = 2;
////////////////////////
public var myTimer:Timer = new Timer(500, reloadSpeed);
private var reloadComplete:Boolean = true;
private var bulletAngle:Number;
private var randomNum:Number;
private var spawnX:Number = iGun.x;
private var spawnY:Number = iGun.y;
private var rotationDirection:Number;
private var bulletLifeTimer = 0;
public function InfectedScripting():void {
iGun = new SCAR_GUN_mc;
addEventListener(MouseEvent.MOUSE_MOVE, mouseMove_handler);
addEventListener(MouseEvent.CLICK, doSlug);
this.addChild(iGun);
iGun.x = 250;
iGun.y = 200;
iGun.cacheAsBitmap = true;
}
private function mouseMove_handler(e:Event):void {
var theX:int = mouseX - iGun.x;
var theY:int = (mouseY - iGun.y) * -1;
var angle:Number = Math.atan(theY/theX)/(Math.PI/180);
if (theX<0) {
angle += 180;
}
if (theX>=0 && theY<0) {
angle += 360;
}
iGun.rotation = (angle*-1);
}
private function doSlug(e:Event){
if(reloadComplete == true){
var iBullet:MovieClip = new MovieClip();
iBullet = new iBullet_mc
iBullet.name = "slug" + bulnum
bulnum += 1 ;
addChild(iBullet)
setChildIndex(iBullet, 0);
iBullet.rotation = iGun.rotation
iBullet.x = spawnX;
iBullet.y = spawnY;
iBullet.bulletLifeTimer = 0;
randomNum = ((Math.random()* bulletOffset)-(bulletOffset/2));
var iBulletAngle = ((iGun.rotation+randomNum-90) * Math.PI/180);
iBullet.xSpeed = Math.cos(iBulletAngle)*iBulletSpeed;
iBullet.ySpeed = Math.sin(iBulletAngle)*iBulletSpeed;
iBullet.addEventListener("enterFrame", slugz_handler)
function slugz_handler(enterFrame:Event){
iBullet.x += iBullet.xSpeed;
iBullet.y += iBullet.ySpeed;
if (iBullet.bulletLifeTimer>=bulletLifeTimerTotal) {
//removeChild(this)
trace("REMOVE ME!")
}
iBullet.bulletLifeTimer += 1;
}
myTimer.addEventListener(TimerEvent.TIMER, myFunction);
startReloading();
}
}
private function myFunction(event:TimerEvent):void {
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, gunReloaded)
trace(myTimer.currentCount);
}
private function startReloading(){
reloadComplete = false;
myTimer.start();
}
private function gunReloaded(){
reloadComplete = true;
myTimer.reset();
}
}
}
And the error i get is one ive had before but dont fully understand so yea.
ArgumentError: Error #1063: Argument count mismatch on InfectedScripting/::gunReloaded(). Expected 0, got 1.
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/flash.utils:Timer::tick()
thx guys
Weird Class Error.
I've got some code in a file called kitchenVideo.as.
The code starts as follows:
ActionScript Code:
function initialisation()
{
kitchenVideo = "kitchenVideo.flv";
...
...
There are a few insignificant lines aboe the kitchenVideo = ... line...
And there are other bits of code below.
The compiler just throws an error saying something about AS2 classes.
But... after much time and damn effort...
I've tracked down the problem to this line.
I've read Penner's book. I can't remember, but I think he mentions something about a class referencing itself or something by calling it's own name??
I've got Moock's AS2 book... just starting to read...
The problem is that even if the line kitchenVideo = ... isn't the same as the file name, it still throws an error. It's only when I call the variable a completely non related name does it stop throwing an error.
WHAT'S HAPPENING!?
Thanks.
OM
|