1172: Definition Fl.events Could Not Be Found.
I've tried putting in the simple code (into the 1st keyframe of a layer) shown below but it gives me 2 "1172: Definition fl.events could not be found." errors. I also get 1172 errors if i try to import any of the other fl. classes. Code:import fl.events.*;import flash.events.*;var asCircle:MovieClip = new My_Circle();asCircle.x = asCircle.y = 100;addChild(asCircle);var xVel:Number = 20;addEventListener(Event.ENTER_FRAME, onLoop, false, o, true);function onLoop(evt:Event):void {asCircle.x += xVel;}If i comment out "import fl.events.*;" and the "addEventListener(Event.ENTER_FRAME, onLoop, false, o, true);" it does create the My_Circle at (100,100) so its not a problem with that as far as I can tell. This also shows that the "import flash.events.*;" statement works fine. I've also tried putting the code into a .as file and accessing as the Document file but it just gave the same errors.I have trawled the net and can't find anything that works. I've even tried changing the ActionScript 3.0 Classpath without any success even though i set to read the right paths as described here for the fl classes: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000388.html I can't understand why it won't work as the code is so simple. The fact import statements don't work even though they come up blue makes me think its an installation problem but i haven't fiddled with any of the install settings and I have uninstalled and reinstalled 3 times. I'm using a copy of Adobe Flash CS3 Professional trial version. Any help would be greatly appreciated. It seems it should be such a simple thing to fix but nothing seems to work.Edited: 07/27/2008 at 04:24:21 AM by BrightSpark817
Adobe > ActionScript 3
Posted on: 07/27/2008 04:23:19 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Definition _ Not Found 1172 Error
I've put this to Tech Support, but I might as well post here.
import fl.controls.ProgressBar
or import fl.controls.*
does not work for me anymore.
all files are AS3. All fl.controls packages are where installer put them.
I have one program where the progress bar works, no problem importing class definition.
another program with same code doesn't import. can't find definition.
I've tried at least 10 variations. Even when I strip it down to a class that has nothing but the package/ class / constructor function and one fl.controls import statement, it will not compile. it imports the flash.display packages fine.
what gives?
has anyone hit this problem?
1172:Definition Flash.sampler:pauseSampling Could Not Be Found
Hi Guys,
I have just basic knowledge of Flash. Few months ago my company outsourced a Flash Project. Now I need to make a very minor change to it. After making the change when I publish, it shows me the following error:
1172 Definition flash.sampler(colon)pauseSampling could not be found
To me it looks like I'm missing some class in Flash? I looked up the search engines and I found this is something related to Flex? Please advise what do I need to to do.
Thanks very much.
"1172: Definition Fl.video Could Not Be Found."?
Hi,
I'm trying to add a VideoEvent.COMPLETE listener to an flv and I keep getting an error saying: "1172: Definition fl.video could not be found."
As a result I imported the video class:
Code:
import fl.video.VideoEvent;
and I also tried import fl.video.*; but the error still persists.
This seems pretty straight forward to me and I can't figure out why the compiler can't find the definition. Could it be a problem with my flash installation? I'm using Flash CS3 on a mac.
Thanks for any advice.
Definition The:Greeter Could Not Be Found
when i import with "import Greeter;" then the code below works. the file was saved as Greeter.as
Code:
package
{
public class Greeter
{
public function sayHello():String
{
var greeting:String;
greeting = "Hello World!";
return greeting;
}
}
}
However, in the code above, when i added the word "the" in front of the word package then i get the error Definition the:Greeter could not be found. the file was saved as the.Greeter.as
i imported it as "import the.Greeter;"
Why am i getting this error?
Definition Flash.controls... Could Not Be Found
Hi everyone,
I can't figure out why I keep getting these errors "1172: Definition flash.controls:RadioButtonGroup could not be found." and "1172: Definition flash.controls:RadioButton could not be found."
Code:
import fl.controls.RadioButton;
import fl.controls.RadioButtonGroup;
Looks really straight forward but it isn't working.
I'm trying the tutorial on creating a Quiz using classes.
Thanks.
Import Weirdness. Definition Not Found.
Okay, I'm stumped.
I'm trying to work with the ProgressBar.
I have one setup working fine. I did it at home, worked at home. brought it to work, it worked fine.
NOW, I've redesigned my structure, and am redoing the ProgressBar portion.
this time it doesn't work. Not even the livedocs example works.
I've got three "programs" open in flash. GallerV2, GallerV, LiveDocsProgressBarExample.
GallerV compiles fine. ProgressBar works fine.
GallerV2 won't compile. errors are above.
LiveDocsProgressBarExample won't compile, same errors.
error messages:
1046: Type was not found or was not a compile-time constant: ProgressBar.
1172: Definition fl.controlsrogressBar could not be found.
1172: Definition fl.controlsrogressBarMode could not be found.
Import Mx.video.* // Definition Could Not Be Found
Wow.... AS3 has turned out to be a total pain in my ***!! Seems like they turned the most simple things into much more code intensive...
With that said, I am trying to make it so that when a FLV is done playing, it executes my function. The problem is, is when I render the movie, I get:
Quote: TypeError: Error #1006: addEventListener is not a function
HUH!? A main AS function is saying it's not a function? I've been googling for about 2 hours now trying to figure out the proper code and/or what I'm doing wrong. I just can't seem to find the info I am looking for.
So heres my AS 3:
ActionScript Code:
Original
- ActionScript Code
import fl.video.FLVPlayback;
var my_flvPb:Object = new Object();
my_flvPb.contentPath = "iFOB_HookVid3_HQ.flv";
var listenerObject:Object = new Object();
listenerObject.complete = function():void {
fscommand("exec","iFOB_Presentation.exe");
fscommand("quit");
};
my_flvPb.addEventListener("complete", listenerObject);
import fl.video.FLVPlayback;var my_flvPb:Object = new Object();my_flvPb.contentPath = "iFOB_HookVid3_HQ.flv";var listenerObject:Object = new Object();listenerObject.complete = function():void { fscommand("exec","iFOB_Presentation.exe"); fscommand("quit");};my_flvPb.addEventListener("complete", listenerObject);
and what this does is, when the FLV reaches its end, it executed the fscommand.
So I figured maybe I didnt have the class imported, so when I try:
Actionscript Code:
Original
- Actionscript Code
import mx.video.*;
import mx.video.*;
I get Quote: 1172: Definition mx.video could not be found. Im stumped! I've spent hours looking for the solution, my browsing history for today has quadrupled from my average activity.
Any help is _greatly_ appreciated.
A Definition For The Document Class Could Not Be Found In The Classpath...
I'm a newbie, just started with the help of the "foundation actionscript 3" book.
Whenever i add a document class in the property inspector i get this error:
"a definition for the document class could not be found in the classpath..."
I checked preferences, the default path is still there, so i don't understand what's wrong. please help!
Thanks.
The Definition Of The Base-class UIComponent Was Not Found
Hello,
I try to run the Lisp Interpreter in AS3 form here http://www.solve-et-coagula.com/?p=8
I load the fla-source into a fresh CS3.
When I want to publish it I get:
1017: The Definition of the base-class UIComponent was not found
import fl.core.UIComponent;
public class Console extends UIComponent =>This line throws the error
The help-file say that the keyword 'extends' in only allowed for publishing with Actionscript 2 ?
But setting it to 2 throws a whole bunch of other errors.
So what do I wrong?
I contacted also the developer Nate Lokers, but he told me that he has no problems to compile it.
(And that I must leave it under AS3)
Hans-Peter
Definition Of Base Class Movie Clip Not Found
i wrote this code and i dont know what happened
heres the code i wrote:
hello.as
Code:
package
{
import flash.display.Sprite
public class hello extends MovieClip
{
public function hello()
{
trace('Hello Ryland');
}
}
}
and heres what my terminal spit out:
Code:
ryland@ryland-desktop:~/Desktop$ mxmlc hello.as
Loading configuration file /usr/local/flex/frameworks/flex-config.xml
/home/ryland/Desktop/hello.as(5): col: 32 Error: The definition of base class MovieClip was not found.
public class hello extends MovieClip
^
ryland@ryland-desktop:~/Desktop$
what happened
Error: The Definition Of Base Class MovieClip Was Not Found
i wrote this code and i dont know what happened
heres the code i wrote:
hello.as
Code:
package
{
import flash.display.Sprite
public class hello extends MovieClip
{
public function hello()
{
trace('Hello Ryland');
}
}
}
and heres what my terminal spit out:
Code:
ryland@ryland-desktop:~/Desktop$ mxmlc hello.as
Loading configuration file /usr/local/flex/frameworks/flex-config.xml
/home/ryland/Desktop/hello.as(5): col: 32 Error: The definition of base class MovieClip was not found.
public class hello extends MovieClip
^
ryland@ryland-desktop:~/Desktop$
what happened
1017: The Definition Of Base Class MovieClip Was Not Found
I imported
flash.display.*;
then used
dynamic public class Anonymous extends Movieclip
{
//Other codes
}
But error is occuring showing
1017: The definition of base class MovieClip was not found.
I am working in a project & it includes a lot of as classes & it is one of them. Please reply what can be the problem?
"Definition Fl.controls Not Found"
I can't find anything about this in the documentation, but when I put the command "import fl.controls.*" into my class package, along with the other import commands, it returns the error "Definition fl.controls not found".
Other classes I import work fine. The import of fl.controls works fine in another file, but not in the one I am currently working on.
What causes an import command to fail? I thought it was very straightforward.
On edit: this is weird. I tried actually placing a button instance on the stage in my project, and using the "import fl.controls.Button" command, on the assumption that, with a Button instance on the stage, the import command would be redundant, and I couldn't get an error message. This worked fine. Then I deleted the button from the stage and from the library as well. Now the movie works fine with the "import fl.controls.*" command. Is this just a bug?
Edited: 01/09/2009 at 02:54:27 PM by MarkBorok
"Definition Mdm Could Not Be Found"
I get this problem trying to use Zinc with Adobe CS3 ActionScript3 Code, visit the following link to get the answer...
http://www.mdmforum.com/forum/index....092;Components
1) Copy the mdm.swc file into this folder:
C:Documents and Settings[USERNAME]Local SettingsApplication DataAdobeFlash CS3enConfigurationComponents
Note: i change the last folder by C:Program FilesAdobeAdobe Flash CS3enConfigurationComponents
2) When you have done this and opened Flash CS3, the "{mdm} Script v2 AS3 library for Flash CS3" component will appear in the components panel. Drag this component into the Library.
3) Now you can use mdm Script as normal. Remember that you need to initialise mdm script first e.g
import mdm.*
mdm.Application.init(this)
button.addEventListener(MouseEvent.CLICK, openDialog)
function openDialog(event:MouseEvent):void {
mdm.Dialogs.prompt("The SWC is finally here!")
}
Register Classes - Mc Events Vs Button Events
I'm experimenting with register classes today, and wasn't careful typing the code with only button events for my custom movie clip class.
First I wrote
Code:
CustomClass.prototype.onMouseDown = function(){
this.gotoAndStop("blue");
}// end onMouseDown
Then all the mc-buttons in my movie went to the blue state. (.fla provided)
When I realised the error, I corrected it, and now it works.
I just don't understand what happened.
Do Movie Clip events turn out to be class methods (don't know what to call it in Java script, only used to Java), while button events stay instance events??
Hope somebody have the time - it's not about life and death, but it would be really nice to know how these things work.
MX UI Definition
Can anyone help me clarify about the definition of the FlashMX IDE - UI icon definitions?
Thanks a lot.
Definition
hi!
can someone explain me what means this syntax in simply words?
Code:
rich = Math.round(Math.random()*2-1);
and how to know when it is true of false like
if(rich == true) {
do_something
} else {
do_nothing
}
suggestions?
thanx in advance!!!
Ref: Url Definition
In the following code segment, where is "clip" defined?...
function preload(clip) {
picture.loadMovie(clip);
Apparently syntax is:
loadMovie("url",target [, method]) does this mean that the "url" is clip?If so....where is clip spceified?
Thanks.
Gradient Definition Bar Is Gone Please Help
Okay, I've been having a headache over this, and I was wondering if anyone can help. I couldn't find any info on this.
Whenever I open the color mixer using "linear" in FLASH MX, the "gradient definition bar" used to appear. But for some odd reason it dissappeared all of a sudden and I can't get it back up. (See image below)
Is this a known issue or a bug? Is there anyway to fix it? Or do I have to reinstall FLASH MX everytime this happens?
Please help. I would greatly appreciate this. Thanks.
Code Definition
what means: this.onRollOut = function()
and what is the diference with: bg.onRollOut = function()
XML In A Class Definition
Hi all...
I'm loading XML directly into a class definition for the first time. My problem is that when I run the code below, the results I want traced come up as blank..nothing. It's loading the file, but obviously not parsing or reading it properly. Any help is very much appreciated. Thanks...
Code:
class rotator {
private var rotatorXML:XML;
private var XMLPath:String;
function rotator() {
}
public function init(XMLPath:String):Void {
rotatorXML = new XML();
rotatorXML.ignoreWhite = true;
rotatorXML.load(XMLPath);
rotatorXML.onLoad = function(success) {
if (success) {
trace(rotatorXML.firstChild);
} else {
trace("this ain't workin");
}
}
}
}
Script Definition?
Could someone please explain what this script means?
ActionScript Code:
myMovieClip.onEnterFrame = function() {
this._x += (xMove1-this._x)/easeSpeed;
};
Component Definition
I am looking at code from a book example. A symbol is called from the library and used on the stage. The class appears to be dynamic because a reference to a variable called cardface appears out of nowhere in the as file (fla is set to STRICT). When debugging, the variable doesn't exist until the line where it is used. After this the variable can be seen. I am thinking to myself that the library right-click option "Component definition" would allow me to set the variable so that it is available in the Class. Unfortunately there is no guidance in the help system on this. I am required to endlessly search to try and get help (not yet found). Why does Adobe not give us this essential help - i.e. how to use their dialog boxes? I am such a fan of Flash (AS3) but there are some part of the system still painfully inadequate.
Any pointers would be appeciated.
High Definition
On vimeo.com, they compress uploaded high definiton video to high def flv...
youttube use ffmpegg to convert uploaded video to flv.
Do vimeo also use ffmpeg, but just change the ffmpeg compression to match the hd video being uploaded.
In other words does anyone know how to convert uploaded hd video into a hd flv?
kind regards J.
Component Definition
I am looking at code from a book example. A symbol is called from the library and used on the stage. The class appears to be dynamic because a reference to a variable called cardface appears out of nowhere in the as file (fla is set to STRICT). When debugging, the variable doesn't exist until the line where it is used. After this the variable can be seen. I am thinking to myself that the library right-click option "Component definition" would allow me to set the variable so that it is available in the Class. Unfortunately there is no guidance in the help system on this. I am required to endlessly search to try and get help (not yet found). Why does Adobe not give us this essential help - i.e. how to use their dialog boxes? I am such a fan of Flash (AS3) but there are some part of the system still painfully inadequate.
Any pointers would be appeciated.
Path Definition
if i have a button in a movie clip, how do i direct it to affect the main timeline?
Hit Area Definition
Hey guys!
New project - was having fun with it `til now!
http://www.geocities.com/steve_kitch/vega.htm
My problem, is the buttons' hit areas.
If you hover above the nav bar (left) it rollsover the button further down.
This is due to the fact I have a mc. on the "over" part of each button.
In this Mc. I have a large picture of fire moving behind a mask (text) to give the effect of the text burning. I have a feeling this is what is pushing the hit area out of place
Is there anyway of manually defining the hit area? Or anyway I can hide the Mc.'s parts from interferring? I tried creating a rectangle on the "hit" action in a button, but it doesn`t seem to work...any ideas?
Thanks very much for your time,
~STEVE
[AS 2.0] Var Definition Clarification
hey guys:
what, functionally, is the difference between:
Code:
var someVar:Number;
and
Code:
var someVar:Number = new Number();
i'll sometimes use them interchangably in a script without any seeming ill effect, so i just wondered what the difference was from a functional point of view. and yes, it's late and i'm waxing philosophical... must be the flat Coke Zero...
one thing i do know, is that the second version allows you to set some properties right off the bat, rather than use a second or third line to do it:
Code:
var someOtherVar:String = new String('bananas');
... but other than that... ?
danke mein volks!
WR!
What Is A Symbol Definition?
Okay,
I was using the "movie explorer" to find a particular symbol in my flash. I typed in the name of the symbol, since I couldn't find it in my library.
The movie explorer returned no results. So i clicked on "customize which items to show"... I put a checkmark in symbol definitions and the symbol i was looking for finally appeared.
I was able to find other symbols with that unchecked, but for this specific symbol... it doesn't appear in the movie explorer unless i put a check on "Symbol definitions".
I did a google search, but can't seem to find anything that talks about this. Kind of confusing.
Thank you in advance to all those who reply.
Class Definition
i want to make a class and then use it in a script
the scriptfile goes something like this:
class Image{
var m_name:String;
-- bla bla ---
}
and tghen i try to include this class in my flash file using this line:
#include "classes/Image.as"
and when i try to run the flash file i am getting this message:
**Error** ..classesImage.as: Line 1: Syntax error.
class Image{
Total ActionScript Errors: 1 Reported Errors: 1
what am i doing wrong ? please help
Class Definition (AS 2.0)
Hi guys,
I have experience with programming in Java so i thought id give AS2 a try to see how i like it.
I was gonna write a mortgage calculator for practice but I'm stuck at the first step.. lol
I have this in mortCalculator.as
ActionScript Code:
class mortCalculator {
var price:Number;
var percentdown:Number;
var propertytax:Number;
}
this in mortCalc.fla
ActionScript Code:
#include "mortCalculator.as"
and THIS is my error
**Error** C:WINDOWSDesktopmortCalculator.as: Line 1: Classes may only be defined in external ActionScript 2.0 class scripts.
class mortCalculator {
Total ActionScript Errors: 1 Reported Errors: 1
i would really appreciate it if someone can point me in the right direction .. its probably something simple that im missing.. thank u kindly in advance
ASBroadcaster : The Definition
In layman's terms (non dev speak) can someone describe to me what exactly ASBroadcaster is?
I've read a few posts here and visited chattyfig...but it's still a bit sketchy to me. I have an idea of what it is but not a concrete definition.
Can someone help?
GetBounds Definition
Hi,
i am working on a nested menu ...
my problem is when i copy the menu..i don't know how to redefine my boundaries for each menu in my code...
Code:
//--------
b01.onRollOver = panelOver;
b02.onRollOver = panelOver;
b03.onRollOver = panelOver;
b04.onRollOver = panelOver;
function panelOver() {
this.gotoAndPlay(2);
this.onEnterFrame = getBoundaries;
delete this.onRollOver;
}
var b = b01.stroke.getBounds(_root);
function getBoundaries() {
if (_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.gotoAndPlay(7);
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
}
//--------
enclosed the .fla which is probably more explicit..
if someone can help me...
+ Sign Definition
Code:
trace("this is execution "+i);
is this + sign for concatenation operation?
if yes, why there's concatenation operator assigned as add | String concatenation (formerly &) in the Operator List of Flash Context Help?
Component Definition - Nothing In Helpfiles?
Hi everybody,
In Flash 5 there was SmartClips, and in Library there was a window called "Define Clip Parameters". In this window were three columns: Name, Value, and Type.
Now in Flash MX we have a new thing, Components, which replaces old SmartClips. In Library is a similar window called "Component Definition" , but this time with four columns: Name, Variable, Value, and Type.
Anybody knows, what is this new "Variable" column for?
I tried to find a description of it in helpfile (offline), but it seems that there's nothing about it! I found only a help docs for the simple things, like how to use Components, but nothing about creating them or using this window.
Please give some info if you can or at least an URL to document describing this window.
Thanks in advance!
Text Definition On The Screen (Help)
For some reason that I don´t know, everything that I wrote in Flash 5 apears with very low resolution in comparition to html, on the screen. Can some one give me a clue of what am I doing wrong?
Functions Within A Class Definition?
I'm trying to make a basic drawing tool using classes. In one class (rectangle) I'm going to have a function, startDraw(), that invokes when the mouse is pressed and draws a square to the mouse _x and _y position, and then stop drawing when the mouse is released. The problem is I'm getting confused by class scope and functions. Here's my code, focused down to the problem:
Code:
class Rectangle {
var intervalID;
var mc;
function Rectangle(objectName, depth, currentX, currentY) {
mc = _root.createEmptyMovieClip(objectName, depth);
mc._x=currentX;
mc._y=currentY;
}
function startDraw() {
trace(mc._name);
intervalID=setInterval(drawBox,100);
function drawBox() {
trace(mc._name);
//plan on doing a - with(mc) { draw rectangle }
}
}
}
In my FLA, if I create a new Rectangle object (i.e. "box"), and do box.startDraw(), the first trace command works, but the second doesn't (the one within the drawBox() interval call. Can I not have a function, within a function, in a class?
If anyone has any suggestions, I'd greatly appreciate it. Thanks.
Error Message Definition
can anyone tell me what i can do to fix this error message? it comes up when i test my swf movie and i do not know why.
Scene=Scene 1, Layer=Layer 2, Frame=1: Line 1: Mouse events are permitted only for button instances
on (release) {
thanks for any help.
[F8] Why Does The Variable Lose Definition?
I done tried and tried to fix this thing, but for some reason, activating my navigation renders my reference variables (goalX and goalY) “undefined.” I would post these files, but they have confidential data. If necessary, I can replace the bmps with garbage. Hopefully, if I give the code and the debug output, someone can crack this puzzle.
There are four containers holding SWFs in this movie. One container (nav) holds the navigation, another (dataFile) holds an Excel spreadsheet bmp (this SWF delivers the values for the x and y arrays), another (head) holds the column headings, and a forth container holds tab buttons. The nav container includes navigation with four buttons, one for each direction. An _root array for x and another for y holds the various positions for head and dataFile (loaded from the dataFile container) .
Here is the _root code:
Code:
var i:Number = 0;
var u:Number = 0;
var goalY:Number = 150;
var goalX:Number = 0;
var myXArray:Array = new Array;
myXArray=[u];
var myYArray:Array = new Array;
myYArray=[i];
nav._alpha=35;
nav.onRollOver=function(){
nav._alpha=100;
};
nav.onRollOut=function(){
nav._alpha=25;
};
//Loading the first container++++++++++++++++++++++++++++++++++++++++++++++++++
this.createEmptyMovieClip("dataFile", this.getNextHighestDepth());
var mc1Listener:Object = new Object();
mc1Listener.onLoadInit = function(_loadedMC1:MovieClip) {
if (_loadedMC1 == _root.dataFile){
_loadedMC1._x = 0;
_loadedMC1._y = 150;
trace(dataFile._y);
}else{
trace("I'm afraid _loadedMC1 didn't load, or is not defined!" + _loadedMC1);
}
};
var MCdata:MovieClipLoader = new MovieClipLoader();
MCdata.addListener(mc1Listener);
MCdata.loadClip("Summary.swf",this.dataFile);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Loading the second container++++++++++++++++++++++++++++++++++++=
this.createEmptyMovieClip("head", this.getNextHighestDepth());
var mc2Listener:Object = new Object();
mc2Listener.onLoadInit = function(_loadedMC2:MovieClip) {
if (_loadedMC2 == _root.head){
_loadedMC2._x = 0;
_loadedMC2._y = 0;
}else{
trace("I'm afraid _loadedMC2 didn't load, or is not defined!" + _loadedMC2);
}
};
var mcHead:MovieClipLoader = new MovieClipLoader();
mcHead.addListener(mc2Listener);
mcHead.loadClip("SummaryHead.swf",this.head);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Loading the third container++++++++++++++++++++++++++++++++++++=
this.createEmptyMovieClip("tabs", this.getNextHighestDepth());
var mc3Listener:Object = new Object();
mc3Listener.onLoadInit = function(_loadedMC3:MovieClip) {
if (_loadedMC3 == _root.tabs){
_loadedMC3._x = 0;
_loadedMC3._y = 514;
}else{
trace("I'm afraid _loadedMC3 didn't load, or is not defined!" + _loadedMC3);
}
};
var mcTabs:MovieClipLoader = new MovieClipLoader();
mcTabs.addListener(mc3Listener);
mcTabs.loadClip("TabControl.swf",this.tabs);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Loading the forth container++++++++++++++++++++++++++++++++++++=
this.createEmptyMovieClip("nav", this.getNextHighestDepth());
var mc4Listener:Object = new Object();
mc4Listener.onLoadInit = function(_loadedMC4:MovieClip) {
if (_loadedMC4 == _root.nav){
_loadedMC4._x = 300;
_loadedMC4._y = 20;
//_loadedMC4.swapDepths(_root.getNextHighestDepth());
}else{
trace("I'm afraid _loadedMC4 didn't load, or is not defined!" + _loadedMC4);
}
};
var mcNav:MovieClipLoader = new MovieClipLoader();
mcNav.addListener(mc4Listener);
mcNav.loadClip("NavController.swf",this.nav);
Here is the code loaded from the dataFile SWF:
Code:
Stage.align="TL";
_root.myXArray=(0, -34, -81, -128, -176, -162, -223, -273, -323);
_root.myYArray=(150, -264);
Here is the code loaded from the nav container’s SWF:
Code:
//This file loads to one of four containers on the main timeline. This file allows the user
//to move the dataFile container holding the spreadsheet data rows. The onEnterFrame function
// references a root an array on a file loaded to the dataFile container. Each time the user
//click an arrow, the variable for array position changes the goalY or goalX variable on the main timeline.
//These two variables control the scroll functionality for both the dataFile and the head containers.
function slideY() {
_root.dataFile.onEnterFrame = function() {
_root.dataFile.diff = Math.abs(_root.dataFile._y-_root.goalY);
if (_root.dataFile.diff<1) {
_root.dataFile._y = _root.goalY;
_root.head._y = _root.goalY;
delete _root.dataFile.onEnterFrame;
} else {
_root.dataFile._y += (_root.goalY-_root.dataFile._y)*.3;
_root.head._y += (_root.goalY-_root.head._y)*.3;
}
}
};
function slideX() {
_root.dataFile.onEnterFrame = function() {
_root.dataFile.diff = Math.abs(_root.dataFile._x-_root.goalX);
if (_root.dataFile.diff<1) {
_root.dataFile._x = _root.goalX;
_root.head._x = _root.goalX;
delete _root.dataFile.onEnterFrame;
} else {
_root.dataFile._x += (_root.goalX-_root.dataFile._x)*.3;
_root.head._x += (_root.goalX-_root.head._x)*.3;
}
}
};
//These functions set the goal variables and activates scrolling (above)
downM.onRelease = function() {
_root.myYArray[i++];
_root.goalY = myYArray;
slideY();
};
upM.onRelease = function(){
_root.myYArray[i--];
_root.goalY = myYArray;
slideY();
};
rightM.onRelease = function() {
_root.goalX = _root.myXArray[u++];
slideX();
};
leftM.onRelease = function(){
_root.goalX = _root.myXArray[u--];
slideX();
};
//These functions animate the arrows to give the user notice of function
//I initially nested this code with the arrows symbol, but there was some
//conflict preventing that from working. Instead of figuring it out, just moved
//them to this timeline. The negative: 8 functions instead of 2. The positive: this works.
leftM.onRollOver=function(){
leftM.play();
}
leftM.onRollOut=function(){
leftM.gotoAndStop("home");
}
rightM.onRollOver=function(){
rightM.play();
}
rightM.onRollOut=function(){
rightM.gotoAndStop("home");
}
upM.onRollOver=function(){
upM.play();
}
upM.onRollOut=function(){
upM.gotoAndStop("home");
}
downM.onRollOver=function(){
downM.play();
}
downM.onRollOut=function(){
downM.gotoAndStop("home");
}
Head carried no script.
I have attached the debug output after I’ve clicked on the buttons. Obviously, the containers do not move as intended. But why?
Externally Visible Definition
i keep getting the error following error:
5007: An ActionScript file must have at least one externally visible definition.
the scenario is a simple fla file that includes an external actionscript file. If i copy the code from the external actionscript file into the frame where the include code is, there is no change, i still get the error. the external actionscript file doesn't have any packages or classes, just a few functions and other stuff like that
Method Definition Outside Of Classes
This is more of a stylistic thing...Is there a way to declare all the methods within a class, and then define those methods outside of the class?
So instead of
Code:
class person{
function Talk()
{
///...insert many lines of code
}
function Walk()
{
//...insert many lines of code
}
function Examine()
{
//...insert many lines of code
}
}
Is there something like this? (Obviously the syntax below isn't correct assuming there even is one).
Code:
class person{
function Talk();//declare functions here
function Walk();
function Examine();
}
//define methods here
person.Talk()
{
//insert many lines of code
}
person.Walk()
{
//many lines of code
}
person.Examine()
{
//many lines of code
}
Or is the best thing I can do is Interfaces?
Something Strange With Variable Definition...
Hello actionscript people
I have a problem with something I really don't understand with actionsrcipt
Have a look at the following code:
Code:
{var t:Number=10
_level0.func3=function(){return(t)}
}
//here the variable t is defined locally in the braces
trace(_level0.func3())
// this gives 10.
//The function func3() seems to have remembered the value of t
{var t:Number=11
_level0.func4=function(){return(t)}
}
trace(_level0.func4())
// this gives 11.
// Once again the function seems to have remembered the value of t
trace(_level0.func3())
// Now I don't understand. This do not give 10 anymore but 11!!!
//the variable t=11 has been defined ONLY locally in braces
//that do not contain the function func3!
var t:Number=14
trace(_level0.func3())
// now this gives 14. I am not sure to understand this result,
// given that the function seemed not to remember the variable
//but the value inside the variable...
Somebody can explain me this strange result?
Is Package A Must With A Class Definition ?
hi all,
i'm still learning new concepts of AS3, here comes my first question:
is it a must to use package keyword with class definition like this ?
ActionScript Code:
package
{
class TestClass
{
//
}
}
can we define a class without package keyword anyway as below ?
ActionScript Code:
class TestClass
{
//
}
thanks.
For Loop Button Definition
hi there,
this is a for loop problem which i cant solve. can anyone show me "the way of the master"?
in this example i want to use a for loop to quickly define my 3 buttons. what i want is simple. i want a way to id each button upon click.
so i have 3 buttons with the instance name "thumb1", "thumb2", "thumb3"
then i put the following code on frame 1.
for (i=1; i<3; i++) {
this["thumb"+i].onRelease = function() {
trace(i);
};
}
i get the trace result "3" no matter which button i click. i realise the for loop goes thru once and the last digit thru the loop will be displayed.
i don't want this. i want to click on thumb1 and get "1". click on thumb2 to get result "2" etc.
the only way i know is to use this way with trace (this).
for (i=1; i<3; i++) {
this["thumb"+i].onRelease = function() {
trace(this);
};
}
but i get "_level0.thumb1" when i click on thumb1. then i will have to substring this string back to "1". this is a hassle and not to mention probably a lame way to do this. how can i simplify what i want without going thru the unnecessary steps? anyone? thanks
raskol
Class Definition Problem
Hi all...
I want to call a function from within a mouse event in a class definition. It doesn't work. Somebody please help! (i'm got a deadline coming fast). Here's an abstract example of what I mean...
Code:
class someClass() {
public function someClass(from:MovieClip, to:MovieClip){
from.onRelease = function() {
drawLine(from, to);
}
}
private function drawLine(from:MovieClip, to:MovieClip) {
//function does something here//
}
}
I can't get the function named drawLine to run from the onRelease event. If anyone knows what I'm doing wrong, please let me know as soon as possible. Thank you for your time.
Site Definition Via Flash?
Hello Flash People of the Universe,
I'm a multimedia design looking for a technique to create an index SWF page in Flash.
I have heard it through the grapevine that a 100% Flash-based homepage will load much, much faster than a HTML index page
calling for the SWF file.
Is this a myth or true? If it is true, how can I create an index SWF page in flash. Should I use cold Fusion ect..
Please help with this concept.
Camera.activitylevel Definition
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary120.html
In the above link the activitylevel property of the camera object is described. This is said to be a number between 0 and 100, where 100 means that a large amount of motion is being detected. Could anyone tell me what is meanth by 'a large amount'? Does this mean that all pixels are different than in the previous frame? What exactly does this number mean?
I need this information because I am currently doing a research at the Technical University Delft, using Flash and a webcam.
Thanks in advance for a reply.
Joost van der Schee.
|