Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Default Flash Class Path, Please



Hehe, I accidentally deleted the default class path from my flash installation; I need somebody to just give me the exact path from theirs (it will be the same as mine). You can find the path (in windows) by opening flash, going to Edit>Preferences, clicking Actionscript from the bar on the side, clicking the button that says 'ActionScript 3', and cut-and-pasting the second path from the top (the one with app_data, or something). I messed up, and I'd really like to get back to my project's problem. Thanks!



KirupaForum > Flash > ActionScript 3.0
Posted on: 08-18-2008, 08:54 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Is It Possible To Add A Class To The Class Path Folder In Flash CS3?
Hi,

Is it possible to add a class to the class path folder in flash CS3?
What I want to do is to add a class ( TweenLite ) to the default class path folder in flash cs3, this way I don’t have to add the path to each .FLA file I create, all I need to do is import it as a native class from flash.

Is this possible? If yes, in what folder should I put my new class? I am using a mac.

Thanks,
fs_tigre

FileReference Default Path
The Flash 8 filereference documentation states: -

The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box generated by browse() and download() calls. The default location shown in the dialog box is the most recently browsed folder, if that location can be determined, or the desktop.

This is true in Windows XP but in Windows Vista the default path is ALWAYS the Documents folder, regardless of where you've browsed to recently. Has anyone noticed this? Has anyone got around this? It is a major pain if your files are located a long way away from this location and you have a lot to upload. This is likely to be a Player problem, I guess ...

1203: No Default Constructor Found In Base Class Flash.display:BitmapData
I'm trying to create a game that utilizes blitting and double buffering for performance. I have a PNG in the library called ball.png that's linked to a class called ball (seen below).

When I instantiate it, I get the following: 1203: No default constructor found in base class flash.display:BitmapData. Any way around this? I'd like to store relevant properties of the object in itself (as you can see by _posx, _vy, etc.).


ActionScript Code:
package {
    import flash.display.BitmapData;
    import flash.geom.Point;
    import flash.geom.Rectangle;
   
    public class ball extends BitmapData {
        private var _posx:Number = 0;
        private var _posy:Number = 0;
        private var _vx:Number = 0;
        private var _vy:Number = 0;
        private var _myRect:Rectangle = new Rectangle(0,0,19,19);
        private var _myPoint:Point = new Point(0,0);
       
        public function ball():void {
            trace('created ball')
        }
    }
}

Flash Class Path Confusion
ok I finally am jumping in to using classes with AS 3. I did a few tutorials and understand the concept behind packages and class paths and have things working.

But I have one question I can't seem to solve and hopefully someone can help me it's probably easy something I've totally missed.

I did this tut here> http://www.actionscript.org/resource...AS3/Page1.html

Was great. However, when you have to import flash's MovieClip class with this line:
import flash.display.MovieClip;

Now my understanding of packages means the MovieClip.as file should be in the default class path set in the AS 3.0 settings (in my case os x, $(AppConfig)/ActionScript 3.0/Classes), I should be able to find that class in ActionScript 3.0/Classes/flash/display/ right? I don't. I don't even see a folder named ActionScript 3.0

(this in users>-username->Library>Application Support>Adobe>Flash CS3>en>Configuration)

I do see a folder named Classes with fp7 fp8 fp9 etc, I see the MovieClip.as in the fp9 folder.

So I'm confused here about the path flash.display.MovieClip

What did I miss?

thanks in adavance.

Full Class Path As Eclipse Likes And Flash IDE Doesnt
For those of you who use eclipse and those of you like me thinking about converting here is an interesting debate..

eclipse likes to use full classpaths in the definition inside the class i.e.

Packagea.classA.TheClass

flash likes just TheClass name and this is what I have learnt through text books -then defining the path in the settings. If the path is defined in the class there are errors when compiling, id like to know what is best practise.

..

Default Values In A Class
Hi guys

my question is simple, if I have a create a class I can either
a. Have some values set by the class itself as default or
b. Pass values to the class object at creation

what I want to be able to do is say only specify one, two, any or none of the values/properties at creation and then have the rest which weren't passed set to a default value

Is this possible an if so how?


Zen

Modifying Default Value Of Intrinic Class's Property
Is there a quick and easy way I can re-define the default value of any XML/XMLNode's ignoreWhite property to be true, no matter what class or where in a movie an XML Object is created??

Access A MovieClip On The Stage From Default Class.
Hi how do I access a movie clip in my library (using FLash CS3), that is already on the timeline, on the stage from the Default class so I can change its properties with script ?

I have a movie clip containing an image (mcMan) that is dynamically added to the stage as below in the Default class. I added it dynamically so I could do a transition :


Code:
private function onManEveryFrame(event:Event):void
{
if (this.currentLabel == "enterMan")
{
man.removeEventListener(Event.ENTER_FRAME, onManEveryFrame);
//add man to stage
tMgr = new TransitionManager(man);
addChild(man);
man.x = 0;
man.y = 0;
tMgr.startTransition({type:Blinds, direction:Transition.IN, duration:.9, easing:None.easeOut, numStrips:20, dimension:0});
}
}
Thats fine and all but on the stage itself I have another movieclip from the library called mcTree again containing a single image I want to animate. This uses a motion tween but unfortunately is appearing on top of the mcMan movieclip above when I publish the movie.

I tried

this.setChildIndex(man, this.numChildren - 1);

to put the man at the top index but still the tree is in front of the man. I was thinking if I could access the instance object (or whatever) of mcTree on the stage I could use something like

this.swapChildren(tree, man);

At the moment I didnt give the mcTree movie on the stage an instance name as there are 3 keyframes using the same mcTree and I want to talk about the same object (mcTree). Should I give them all the same instance name? Very confused, must have missed something basic. Wasted a good few hours on it already

many thanks for any ideas or links.

Assigning Default Values For Class Properties
I am wondering about assigning default values for class properties. Is it as symbol as declaring the property and assigning a value:

public var my_property:type = value;

or is it better to declare a private property with the defualt value and then a public property with set to the default value:

private var defaultMy_property:type = value;
public var my_property:type = defaultMy_property;

Any thoughts would be great and thanks in advance.

No Default Constructor Found In Base Class Ball
i want the class BeginBall to extend Ball, but when i do so, this error shows up.
this is my code:

PHP Code:



package
{
    import flash.events.Event;
    import flash.display.MovieClip;
    
    public class Ball extends MovieClip
    {
        public var nSpeedX:Number;
        public var nSpeedY:Number;
        public var ballNr:int;
        const BALLDIAMETER = 10;
        private var nStageWidth:Number = 500;
        private var nStageHeight:Number = 400;
        
        public function Ball ( X,Y,NSpeedX:Number, NSpeedY:Number ) : void
        {
            nSpeedX = NSpeedX;
            nSpeedY = NSpeedY;
            x = X;
            y = Y;
            
            this.addEventListener ( Event.ENTER_FRAME, onEnterFrameHandler );
        }
        
        private function onEnterFrameHandler ( E:Event ) : void
        {
            this.x -= nSpeedX;
            this.y -= nSpeedY;
            
            if ( this.x >= nStageWidth - BALLDIAMETER - 16 )
            {
                this.x = nStageWidth - BALLDIAMETER - 16;
                nSpeedX *= -1;
            }
            else if ( this.x <= BALLDIAMETER + 16 )
            {
                this.x = BALLDIAMETER + 16;
                nSpeedX *= -1;
            }
            
            if ( this.y >= nStageHeight - BALLDIAMETER - 16 )
            {
                this.y = nStageHeight - BALLDIAMETER - 16;
                nSpeedY *= -1;
            }
            else if ( this.y <= BALLDIAMETER + 16 )
            {
                this.y = BALLDIAMETER + 16;
                nSpeedY *= -1;
            }
            
        }
    }//end of class
    
    public class BeginBall extends Ball
    {
        //alles over spatieknop en muisknop etc.
    }
}




i tried to do public last class Ball, butit says access identifiers are not allowed with namespace attributes.
how can i let BeginBall normally inherit Ball's constructor, or if its not possible, make a new one for BeginBall?

No Default Constructor Found In Base Class Ball
i don't even understand why this error shows up.
searched with google, but people seem to get this error for slightly different reasons

i've got 3 classes: Ball, PlayerBall and ShootBall, the last two extending Ball.
this is the Ball class:


PHP Code:




public class Ball extends MovieClip    {        public var nSpeedX:Number;        public var nSpeedY:Number;                public function Ball( X,Y,NSpeedX:Number, NSpeedY:Number):void        {            nSpeedX = NSpeedX;            nSpeedY = NSpeedY;            x = X;            y = Y;                this.addEventListener(Event.ENTER_FRAME,onEnterFrameHandler);        }

"class SomeClass Extends Some.path.to.Class" Causes Strange Compiler & Runtime Errors
Why is it that in AS3 when you extend a class and add the fully-qualified classpath to the "extends" bit of the class body:


ActionScript Code:
class SomeClass extends some.path.to.SomeClass

I get all sorts of strange compile and runtime errors completely unrelated to it?

One example: the compiler complains about "coercing unrelated types" when I try to declare a variable that is typed to its superclass:


ActionScript Code:
var superWidget:Widget = new SuperWidget()

BUT, when if the class is declared like so:


ActionScript Code:
class SomeClass extends SomeClass

It will be fine!

It's different from AS2, huh...


Any ideas?

Class Path, Button Class ?
Hello,

If possible I would like to have all objects (buttons in this case) automatically format without scripting each button to get values from the classes.

Like if I place a button on the stage and export the movie, it references the button class.

Will this work if I change the class path, if so how might I go about this?

Class Path ?
help doc said global class path was at: C:Documents and Settings<user>Local Settings Application DataMacromediaFlash MX2004<language>Configuration

but mine is at: ...Flash MX2004<language>First RunClasses

so i wonder what happened on your guys' machine ?

New To OOP. How Can I Set Class Path?
Hello,

I am new to OOP and using Flash CS3. I have a class file called myClass.as which is stored within the same directory as my FLA.


PHP Code:

// MyClass.as
class MyClass{
    
    public var myProperty:Number = 100;
    
    public function myMethod(){
        trace("I am here");
    }
}


I am now trying to read var myPorperty and trigger myMethod:


PHP Code:

var myInstance:MyClass = newClass();

trace(myInstance.myProperty);
myInstance.myMethod();


I would appreciate it if anyone can help in pointing to myClass.as.

Thanks a lot

[AS2.0] Class Path
Hi, I got confused by Global Path and Document level,
I thought Global was in the "default Macromedia class folder"
and the document level class means class.as saved in the same folder as the FLA file, that's what I thought, but...is it right?...or there's some other explanation?...

Class Linkage...not Looking In Right Path
I have a movieclip... I click on linkage in the library and try to assign a class to it called preloader.as. The class is in the same directory. When I go to publish the file it is looking in some totally non-related path that I have never heard of like utils.tools.flash or something like that.

I can't figure out why it is doing this and why it can't find the as script file. Has anyone else run into this problem? How can I fix it?

How To Get Path Of Class Instance?
I'm creating a class which will call fscommand to request Javascript to send in some values. I want to pass the path to the class instance to fscommand so that in Javascript I use SetVariable to assign the instance values. But targetpath() doesn't work on classes or objects, only on movieclips. Is there a way that an instance of the class can determine its absolute path?

Relative Class Path
I'm building my AS 3.0 piece on two different computers, depending on where I'm working that day. How do you associate your FLA file to a relative path for my classes. The basic directory structure is the same, but the drives are not. I just want to be able to move it from one computer to another without having to update the FLA path depending on where I am.

Here is a snap shot of my AS 3.0 setting window. Anyone have any ideas?

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

Class Path Issue
I'm having a problem with a class I am building. The document class is NodeManagerClass.as. NodeManager calls instances of NodeWorker. I need to call a function of NodeManager in NodeWorker. I have tried this.myFunc(), self.myFunc(), parent.myFunc(), NodeManagerClass.myFunc() with no success. Any help would be greatly appreciated. Here is a condensed version of what am trying to do:

//NodeManagerClass.as

ActionScript Code:
package script {
    public class NodeManagerClass {
        public function addNode() {
            var node = new NodeWorkerClass;
            addChild(node);
        }

        public function hitNode() {
            trace("hitnode");
        }
    }
}

//NodeWorkerClass.as

ActionScript Code:
package script {
    public class NodeWorkerClass {
        public function selectNode() {
            //Here I would like to call NodeManagerClass.hitNode here
        }
    }
}

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 Path Papervision3d
Ok, any one familiar w/ pv3d? I have an issue w/ my class path and I cannot figure it out. I have done this before and it is fine, but for some reason on my lap top flash gives me an error saying that my classpath is wrong. It says Papervision3D.as, line1 the name of the package org.papervision does not reflect the location of the file, please change the package definition's name inside the file or move the file then it gives the path to where it is. The package is right.

Any help?

Using Ref. Class To Capture DL Path
I have written code to download a file. How can I get the location of the file that the user has just saved it to on their local machine? Do you grab it when using the select listener for the file ref. class? I am going to post it to a textfield like such:







Attach Code

results.text = "You have saved the downloaded file to this location: " + localFileAddress;
// the result will have the path to the file on the users machine

























Edited: 04/30/2008 at 12:57:45 PM by >Vee<

Class Path Question
hello there again

working on a new project i feel like using a class

now the .as file is in the same folder as my movie and works great
on the hd so i know all my identifiers are ok

i didn't had to import it, it works right away

but when i upload the swf / class.as, respecting it's position in the folders it does not work anymore

i've just overlooked lee's tutorial about custom classes
and can't find a sollution

any help is more then welcome

Class Path Problem - Please Help? I Have No Idea
Hello,

I am having a really weird problem and i have no idea how to go about solving it.

flash won't pick up the local custom class files that i have created????

They are in the same folder as the .fla and all the names i'm using to call them are correct.

Problem started because - I am now working on a new computer.

I have brought some of my old files as reference from my old computer (same platform as now).

But when i try to call my old custom class files in a newly created .fla on the new computer, i get the below error


Quote:




1046: Type was not found or was not a compile-time constant: LoaderExample.






please help because this is driving me mad!!!!!!



thanks

Scope Or Path Issue In Class
Hello again!

I just watched an OOP video on gotoAndLearn the other day. I was messing with the idea, and I think I have a scope and/or path issue in my class. The class is very bare bones, so please don't laugh too hard.

ActionScript Code:
class Preloader extends MovieClip {
    var l:Number;
    var t:Number;
    var percent:Number;
    var preloader:MovieClip;
    var bar:MovieClip;
    //
    public function Preloader(url:String, level:MovieClip) {
        //
        var shell:MovieClip = level.createEmptyMovieClip("shell", level.getNextHighestDepth());
        var shell2:MovieClip = level.createEmptyMovieClip("shell2", level.getNextHighestDepth());
        shell.loadMovie(url);
        trace(level.preloader); // traces fine
        trace(typeof (level.preloader.bar)); //trace movieclip
        level.preloader._visible = false; // movieclip can be targeted here
        shell2.onEnterFrame = function() {
            l = shell.getBytesLoaded();
            t = shell.getBytesTotal();
            percent = (l/t)*100;
            if (t>4) {
                if (percent>0) {
                    level.preloader._visible = true; // can NOT taget clip here
                    level.preloader.bar._xscale = percent;
                }
                if (percent == 100 && shell._width>0) {
                    delete shell2.onEnterFrame;
                    shell.removeMovieClip();
                    shell2.removeMovieClip();
                    level.preloader._visible = false;
                    loadMovieNum(url, 0);
                }
            }
        };
    }
}
level.preloader._visible = true; // can NOT taget is where I have problem. I can traget the MC right away in the constructor but not here. Any ideas?

As always, Thanks

_Me.

Tween Class & Motion Path
Is there any way to use the Tween Class to animate a clip along a motion path, or some such equivalent?

Packages And Class Path Root
Hi,

Is it possible to make a package and place it in the root of the classpath? I.e. put it in AS3.0/Classes/myClass.as ? I couldn't get it to work until I put the myClass.as in a folder with the same name as the package name but I wonder if it is possible to place a package directly in the root? What would you name it?

Thanks!

How To Add Parameters To Component W/class Path
Hi, I'm new to Flash 9 and I don't know how to add parameters to a Flash 9 component I create via the Component Definition dialog box if my component uses a class file.

The second I enter a class path for the component, it wipes out any created variables. I'm trying to create a simple label component that's not based on the fl.core.UIComponent class. I just want to see what's the simplest component I can create.

All I want the component to do is display a colored background with a text field on top whose value I can change from the inspector. It doesn't need to resize, change state or anything. I figured I could do this without the overhead of the UIComponent, more as a learning exercise, but I've had no luck and would appreciate any help.

I assume if I were basing this on UIComponent, I could take advantage of the Inspectable metadata structure, but I suspect I don't have that route.

Thanks,

Jennifer

Using Path Class: Move Object To 50%?
Yesterday I asked how to find the midpoint of a curved line and I was pointed to the excellent Path class:
http://www.kirupa.com/forum/showthread.php?t=224668

But I'm still stumped. I can trace the current location of an object to see that it's x percent of the way through the line, but I want to calculate in the other direction. I want to be able to say "put this object at 50% and put this other object at 75%".

I'm sure this is possible, but I'm not understanding how in the docs. Anyone have experience with this?


Thanks,
Jon

Setting Class Path On Server
Hello

I have a probelm with setting the class path on server. I am using papervision3d and on my local machine I have set the class path using Flash>Edit>Preferences> ActionScript 3 and so on here is a line that sets the class path on my local machine.

C:Papervision3dranchesGreatWhitesrc

Can you please tell me how can I set this parth on server please i really need to upload this site tonite so any help will be greatly appreciated. thanks

[AS2] Senocular Path Class Problem
I'm using Senocular's Path class which is fantastic but I'm running into some issues that are really holding me up. First, here is the code:


ActionScript Code:
#include "as/anim-prot.as"
 
// This draws the path of the road.
myPath = new Path(187,14);
myPath.lineTo(518,14);
myPath.circleCWTo(548,44,.25);
myPath.lineTo(548,120);
myPath.circleCCWTo(578,150,.25);
myPath.lineTo(627,150);
myPath.circleCWTo(657,180,.25);
myPath.lineTo(657,284);
myPath.circleCWTo(627,314,.25);
myPath.lineTo(187,314);
myPath.circleCWTo(157,284,.25);
myPath.lineTo(157,44);
myPath.circleCWTo(187,14,.25);
 
// Variables showing what point in the
// animation is each stop
var tMovies = .04;
var tBldg1 = .195;
var tBldg2 = .265;
var tCasino = .395;
var tClub = .43;
var tAirport = .555;
var tBldg3 = .625;
var tLibrary = .73;
var tSchool = .795;
var tDance = .86;
var tBldg4 = .935;
 
var speed:Number = .005;
var t = .0;
 
// Function to determine which direction around the track is the shortest
function FindDirection(begin:Number,end:Number):Void {
    var cw:Number = 1-begin+end; // calculates clockwise distance
    var ccw:Number = 1-end+begin; // calculates counter clockwise distance
    if (cw>1) {cw-=1};
    if (ccw>1) {ccw-=1};
    if (cw < ccw) {
        speed = Math.abs(speed);
    } else if (cw > ccw) {
        speed = -Math.abs(speed);
    }
}
 
function MoveCar(begin:Number,end:Number):Void {
    FindDirection(begin,end);
    myMovieClip.onEnterFrame = function(){
        if (Math.abs(t)!=end) {
            //trace("t = " + t);
            //trace("end = " + end);
            t += speed;
            if (t>1) t=0;
            myPath.traverse(this, t, true);
        } else {
            trace("Stopped");
            delete this.onEnterFrame;
        }
    }   
}
 
MoveCar(t,.1);


Basically what I'm trying to do is simulate an overhead view of a fictional town and there is one curvey street (that loops). I'm trying to add a car that when clicked on certain spots on the path, the car will move there, then stop.

Problem #1: I cant seem to get it to realize when the object has arrived at it's destination. It should be when "t" and "end" equal each other, the object has arrived, and should now stop moving. But it doesn't. This problem is then compounded by the fact that I seem to be getting floating point errors. The object is supposed to be only moving in increments of .005, however once the position gets to around .7, it then moves to a number such as .705000001, which totally throws off my comparison check.

Problem #2: When going in reverse, the path points get reversed also. So .6 position changes in the path when going forwards and backwards.

I could really make it simple by removing reverse functionality, but it doesn't seem logical to have the car move all the way around the track just to get to a point that is .025 distance behind the starting point.

Any feedback is appreciated.

Setting Class Path On Server
Hello

I have a probelm with setting the class path on server. I am using papervision3d and on my local machine I have set the class path using Flash>Edit>Preferences> ActionScript 3 and so on here is a line that sets the class path on my local machine.

C:Papervision3dranchesGreatWhitesrc

Can you please tell me how can I set this parth on server please i really need to upload this site tonite so any help will be greatly appreciated. thanks

Problem With Errors Re Path To Class Files
I am trying to fix the installation of Flash 8 on my machine at a large corporation. The app was installed remotely. First time around, no class files were installed. On the second try, I think they were installed, but I don't understand how the path settings work (under Preferences/Actionscript) and am getting nowhere.

I want to learn how to use the transition and tween classes.

Here's a sample error message:

**Error** C:Documents and Settingssm87191Local SettingsApplication DataMacromediaFlash 8enConfigurationClassesFP8MovieClip.as: Line 51: The class or interface 'flash.geom.Transform' could not be loaded.
var transform:Transform

I think that the files needed are in the First Run directory, not in Configuration.Both First Run and Configuration directories have been installed in "en" (above). I tried adding that class path under preferences (by browsing to the directory), but am not really sure about the exact directory I should be aiming for. There are several directories in First Run. Do I need to add all of the paths? Do I need both FP8 and mx directories? The error messages include both, so I am guessing the answer is YES.

I was getting 19 error messages. Then I accidentally deleted the absolute global classpath from Actionscript preferences... and I only got 11 errors!

I am really confused!

Path Class V2 - Draw And Follow AS Paths
I've updated my path class to ActionScript 2 (and an ActionScript 3 version is available as well).

The Path class saves a collection of line drawing commands to represent a path. Using the path class you can draw all of or a segment of that path in a movie clip or get locations and orientations along the path to have objects follow it.

Note: People using Flash MX 2004 will have to use a custom flash.geom.Point class; one has been provided with the download. Just rename the flash_ifUsingFlash7 folder to flash in the AS2 directory.

Simple example drawing the word "fun" provided (uses two lines drawing out segments of the word with a trangle shape following its path).

PrintJob Class - Send Data To A Specified Printer Path?
I've perused a lot of threads on the printJob class which can be very helpful for what I need to do, however I didn't find any info (not even in the AS Bible)on whether or not you can specify a printer...does the printJob class only send to the whatever default printer is setup on that computer?

I'm not really sure how the client-end printer setup is layed out at this point, but I wonder how to use it for a kiosk situation where the printer is on another computer?

Additionally, what about bypassing the print dialogue? Is it possible to send the print job straight into the queue without user interaction?

Any comments would be helpful, thanks in advance!

PrintJob Class - Send Data To A Specified Printer Path?
I've perused a lot of threads on the printJob class which can be very helpful for what I need to do, however I didn't find any info (not even in the AS Bible)on whether or not you can specify a printer...does the printJob class only send to the whatever default printer is setup on that computer?

I'm not really sure how the client-end printer setup is layed out at this point, but I wonder how to use it for a kiosk situation where the printer is on another computer?

Additionally, what about bypassing the print dialogue? Is it possible to send the print job straight into the queue without user interaction?


Any comments would be helpful, thanks in advance!

AS3 F9 - How To Have Main Class Path Without Carring Around Instance Refer?
I spent my holyday in studing new Flash 9, very good, powerfull but I doesn't find anymore my root, in teory is transformed in stage.root but it doesn't work.

I want to understand if I make a mistake in my code or in my approach.

I make a simple example with a few object containers.
In the firsts lines of the constructor of the mail class I create the style class named tf and then the interface class called interf

Here is my class

Code:
package test {
import flash.display.Sprite;
import test.tf;
import test.interf;
public class mystarter extends Sprite{
public function mystarter() {
mytf = new tf();
myInterface = new interf();
addChild(myInterface);
}
}
}
Now in tf class I create this tf1:TextFormat:

Code:
package test {
import flash.display.Sprite;
import flash.text.TextFormat;
public class tf extends Sprite{
public var tf1:TextFormat;
public function tf() {
tf1 = new TextFormat();
with (tf1) {
font = "Arial";
size = 24;
color = 0x000000;
leading = -2;
leftMargin = 1;
rightMargin = 0;
}
}
}
}
This is the interf class

Code:
package test {
import flash.display.Sprite;
import test.td;
public class interf extends Sprite{
public function interf() {
label0 = new td(100, 100, "Bella")
addChild(label0)
}
}
}
Now in interf class I drow the text with td class

Code:
package test {
import flash.display.Sprite;
import flash.text.TextField;
public class td extends Sprite {
//[Embed(source="C:WINDOWSFontsATMFolderHOOG0555.TTF", fontFamily="myFont")]
public var myText:TextField
public function td(x, y, t) {
myText = new TextField();
//myText.embedFonts = true;
//myText.antiAliasType = AntiAliasType.ADVANCED;
myText.border = true
myText.x = x;
myText.y = y;
//HERE IS THE TROUBLE
//myText.defaultTextFormat = stage.root.mytf.tf1;
//
myText.selectable = false;
myText.text = t;
myText.width = myText.textWidth+9;
myText.height = myText.textHeight+4;
addChild(myText);
}
public function getValue() {
return myText.text
}
}
}
HERE IS THE TROUBLE, how to get the tf1 Object that as to be in stage.root.mytf.tf1 as some documentation say?
If you doesn't comment that line you have an error.

Obviously you can carry with you the object because is a small object with a few nidification but It seems to me very very bad for performance and code.

Tween Class/360vr Tour/path Problem.
I'll start off by saying I'm using Flash 8, Actionscript 2.0, and exporting as FlashPlayer 6.

I'm trying to do this long landscape with a movie clip labeled, "mainMovie", let's say it's approximately 3600 x 600, while the stage/document dimensions are 800 x 600 .

I have script on it so that moving the cursor to the left or right edge of the stage, the entire movie clip shifts left or right and through the rest of the landscape, similar to the 360 vr tours you see for some real estate sites online.

On the main stage, I have that movie clip called, "mainMovie". Inside "mainMovie", is another clip called, "singleStrip", and inside that clip, I have other smaller movie clips through the landscape which are labeled and consist of random stuff, like shapes and items and stuff.

Everything works fine. The extra step that I am attempting is that I want the user to be able to scroll through the clip, "click" on an item, and then that item zooms into the front center stage and plays a small animation about that item. These items that are found throughout the landscape are movie clips themselves with script on them to be recognized as buttons.

My problem with that is even though the center of my stage would be x=400, y=300, since my mainMovie on the stage scrolls from left to right, when I put in code to tween the item to a center position, that position is only set to the inside of the movie clip and not the center of the stage. I need to center a movie clip within two other clips to the stage.

An example of the path of any of those items would be sort of like,
_root.mainMovie.singleStrip.book


... and the tween script I have inside the "singleStrip" movie clip, where all these items are reads as:

function tweenbook() {
easeType = mx.transitions.easing.Regular.easeOut;
var beginx = 74;
var beginy = 93;
var endx = 400;
var endy = 300;
var time = .75;
var mc = book;
var begin_xscale = 40;
var begin_yscale = 40;
var end_xscale = 100;
var end_yscale = 100;
bookTween = new mx.transitions.Tween(mc, "_x", easeType, beginx, endx, time, true);
bookTween = new mx.transitions.Tween(mc, "_y", easeType, beginy, endy, time, true);
bookTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin_xscale, end_xscale, time, true);
bookTween = new mx.transitions.Tween(mc, "_yscale", easeType, begin_yscale, end_yscale, time, true);

}


This obviously moves the book to the center an x and y position for "singleStrip", and not the stage. The line of code I want to alter is the "var endx" and "var endy", and this is where I get confused with what I need to do, or whether it's possible. I at one time, tried something like,


var endx = stage.width._x / 2;
var endy = stage.height._y / 2;

That didn't work. It shifted it to a different position, not being the center of the stage.

At another point, I tried to fake it out, placing a movie clip of a red ball on the main timeline in the center of the stage, and changed my code to:

var endx = _root.centerBall._x;
var endy = _root.centerBall._y;


This didn't work, either.

Can anyone help me or have any suggestions to try... ? I do have other code that affects the motion scroll of the mainMovie from left to right, but I don't think this is the problem, I could be wrong.

Any help is GREATLY appreciated.

Thanks in advance.

Mx.utils.Delegate Error With Carousel Tut 2 (class Path)
Somehow I think I have messed up my class path or something :?
When I test the .swf I get the following on my output monitor.

DataMacromediaFlash 8enConfigurationClassesmxutilsDelegate.as: Line 14: The name of this class, 'mx.utils.Delegate', conflicts with the name of another class that was loaded, 'mx.utils.Delegate'.
class mx.utils.Delegate extends Object

Call Function In A Class From LoadVars With Relative Path Needed. Please Help
Hi all, i´m new here. I´ve been searching an answer to my problem but haven´t found it yet. If someone can help, i´ll be really grateful!

I need to call a function defined inside a class i´ve created, but the function must be called from an loadVars.onLoad(success) object nested inside another function from the same class.

The problem is i can´t use the absolute path from the _root since i use more than one instance of the class.

Using _parent won´t work even if i try to do this:
loadVarsName._parent = this;
This statement works when the loadVars is not inside a class, but when i put it inside my class it stops working.

here is the code on my example.as file.

class example extends MovieClip {
}
public function callNewFunction() {
trace ("function called");
}
public function loadArds() {
var loadedTxt:LoadVars = new LoadVars();
loadedTxt.load("file.txt");
loadedTxt.onLoad = function(success) {
if (success) {
callNewFunction(); //here is my problem!!! no relative path can get me there.
}
}
}
}
//End Class


please help!!!!!!!!!! Thanks!

Tween Class/360vr Tour/path Problem - W/source.
I'll start off by saying I'm using Flash 8, Actionscript 2.0, and exporting as FlashPlayer 6.

I'm trying to do this long landscape with a movie clip labeled, "mainMovie", let's say it's approximately 3600 x 600, while the stage/document dimensions are 800 x 600 .

I have script on it so that moving the cursor to the left or right edge of the stage, the entire movie clip shifts left or right and through the rest of the landscape, similar to the 360 vr tours you see for some real estate sites online.

On the main stage, I have that movie clip called, "mainMovie". Inside "mainMovie", is another clip called, "singleStrip", and inside that clip, I have other smaller movie clips through the landscape which are labeled and consist of random stuff, like shapes and items and stuff.

Everything works fine. The extra step that I am attempting is that I want the user to be able to scroll through the clip, "click" on an item, and then that item zooms into the front center stage and plays a small animation about that item. These items that are found throughout the landscape are movie clips themselves with script on them to be recognized as buttons.

My problem with that is even though the center of my stage would be x=400, y=300, since my mainMovie on the stage scrolls from left to right, when I put in code to tween the item to a center position, that position is only set to the inside of the movie clip and not the center of the stage. I need to center a movie clip within two other clips to the stage.

An example of the path of any of those items would be sort of like,
_root.mainMovie.singleStrip.book


... and the tween script I have inside the "singleStrip" movie clip, where all these items are reads as:

function tweenbook() {
easeType = mx.transitions.easing.Regular.easeOut;
var beginx = 74;
var beginy = 93;
var endx = 400;
var endy = 300;
var time = .75;
var mc = book;
var begin_xscale = 40;
var begin_yscale = 40;
var end_xscale = 100;
var end_yscale = 100;
bookTween = new mx.transitions.Tween(mc, "_x", easeType, beginx, endx, time, true);
bookTween = new mx.transitions.Tween(mc, "_y", easeType, beginy, endy, time, true);
bookTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin_xscale, end_xscale, time, true);
bookTween = new mx.transitions.Tween(mc, "_yscale", easeType, begin_yscale, end_yscale, time, true);

}


This obviously moves the book to the center an x and y position for "singleStrip", and not the stage. The line of code I want to alter is the "var endx" and "var endy", and this is where I get confused with what I need to do, or whether it's possible. I at one time, tried something like,


var endx = stage.width._x / 2;
var endy = stage.height._y / 2;

That didn't work. It shifted it to a different position, not being the center of the stage.

At another point, I tried to fake it out, placing a movie clip of a red ball on the main timeline in the center of the stage, and changed my code to:

var endx = _root.centerBall._x;
var endy = _root.centerBall._y;

(This didn't work, either).


If you look at the .swf, you'll see that if you move your mouse pointer to the left or right of the movie, your landscape shifts in that direction. For now, I threw in letters as placeholders to give you the idea of what I'm trying to do.

My intention is when you click on the item, in this case the letter, it will zoom up to the center of the stage and a movie clip animation will then play about that object.

I do have a red ball sitting in the middle of the .fla stage as a guide layer just to show around the area I want the item to appear.

Also, because I want that internal animation to play, I figured I'd throw on a second frame on the main timeline for the scrolling landscape to just "hold" while the object animation plays. When it's finished, I plan to get it back to where it was on frame 1.

The only thing I was having trouble with as I mentioned previously, centering the individual item movie, (in this case, the letter), to the center of the stage. I was having a hard time with it because it's inside a movie clip that is already shifting around the stage left to right.

Can anyone help me or have any suggestions to try... ? I do have other code that affects the motion scroll of the mainMovie from left to right, but I don't think this is the problem, I could be wrong.

Any help is GREATLY appreciated.

Thanks in advance.

How Can I Un-default Flash 4.0
Power point attachments received via e-mail are appended with .swf. If I double click to open the attachment, Flash 4.0 attempts to open it, but fails. So does Power point.
If I save the attachment as "All Files", then I can open with Power Point and save it as a .pps without the swf. Same with .jpg files.
I also have the same problem downloading Flash 5 which is an .exe file, again it is also
appended with .swf. Consequently I cannot install Flash 5.0.
So how do I rid my computer of Flash 4.0. So far uninstalll/remove attempts have failed.

Flash Default Components
is it possible to add a changeHandler in the default ComboBox provided by FlashMX 2004?

also, i have created a email form which uses text fields, 3 combo boxes and 2 radio buttons. I am using PHP to send the email. I am able to get the text fields in my email but I do not know how to properly get the data from the radio buttons and combo boxes. Any help would be greatly appreciated.

here is what I am using for the PHP email:


PHP Code:



<?

    $recipient = "me@me.com";
    $subject = "Form";
    $message = "You have received an inquiry"
                . "
Business: " . $Business
                . "
Individual: " . $Individual
                . "
Company Name: " . $CompanyName
                . "
First Name: " . $FirstName
                . "
Last Name: " . $LastName
                . "
Title: " . $Title
                . "
Position: " . $Position
                . "
Age: " . $Age
                . "
Address: " . $Address
                . "
City: " . $City
                . "
State: " . $State
                . "
ZipCode: " . $ZipCode
                . "
Phone: " . $Phone
                . "
Fax: " . $Fax
                . "
Email: " . $email
                . "
Email Verify: " . $emailVerify
                . "
Website: " . $Website
                . "
Style: " . $Style
                . "
Favorite Colors: " . $FavColors
                . "
Favorite Brands: " . $FavBrands
                . "
Subject: " . $Subject
                . "
Comments: " . $Comments;
    $headers = "From: Form <me@me.com>
";
    $headers .= "X-Sender: <me@me.com>
";
    $headers .= "X-Mailer: PHP
";
    $headers .= "X-Priority: 1
";
    $headers .= "Return-Path: <me@me.com>";

mail( $recipient, $subject, $message, $headers );

?>




thanks in advance!
kei

Flash In Dreamweaver Needs A Default..
hello all

i have a flash file embeded in dreamweaver and want the file to have a 10 second default before it enters the site where can i find out how to do this ...? is this something i can do in flash??

also is there anyway that if i create a button in flash can i make it work in dreamweaver..??

Flash Default Editor
Hi,

Im having probs with my default flash
editor. I recently bought Nero and its
made the whole suit default for every
thin.

I use fireworks to change my flash
pic's but Nero is now my default editor.
I cant find the way to change it back
any where! Can some one please let
me know its driving me nuts,

cheers

Default Fonts On Flash?
hi everyone,

This is a 2 part question

1. Can anyone tell me what this font is?


I'm guessing (because i see it everywhere) that its a default font in webdesign. But I want to use it in a Flash however i dont know what font it is (its outlined in a black box). How am I able to get a hold of this font? Do I have to purchase it?

2. The second is how do I get fonts to look so crisp? When I publish my swf file... the fonts dont look very crisp but somewhat blurry around the edges. I heard I may have to embed my fonts in my swf file... which in turn will increase my file size.

This site for example has a very crisp looking font on the 2 text boxes below. http://www.jeedub.com/ But if you notice the top fonts, in the title arent as crisp.

Now one other question regarding this site above.... how do the yellow scroll boxes look so crisp as well? I mean Ill make a rectangle in flash and publish it... but it wont look that sharp around the edges.



thanks so much guys.




kevin

Set Default To Flash Player 6?
Hi Guys just wondering if there is a way u can set up mx2004 to always publish as flash player 6?

Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved