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




Simple Function Problem..



I have this following script to trace my movieclip _x value..

on the root frame i have:
function rope() {
trace(this._x);
}


on the movie clip i have:
onClipEvent (enterFrame) {
_parent.rope();
}


But it give me 0 all the way... where is my mistake?

chup



FlashKit > Flash Help > Flash MX
Posted on: 10-20-2002, 06:24 AM


View Complete Forum Thread with Replies

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

Simple Function
i have this on frame 1 of a movie:



Code:
function gearMove () {

for (i=1;i<=6;i++) {
_root.["gear"+i].gotoAndPlay(2);
}


}
basically, i want to call this function every time you click a button, this will make the different mc's start animating...

i know that _root.["gear"+i].gotoAndPlay(2); is bad syntax...

so can someone tell me the right way to state it?

thank you...

Help With (simple?) Function
I hope this isn't too much of a bonehead question, but here's the AS I'm having trouble with (which is attached to a slider MC):

onClipEvent (load) {
function onSlide(val){
return(Math.round(val*200)-100);
}

}
onClipEvent (enterFrame) {
xPos=_root.testClip.xPos;

}

I'm trying to take the results of the "onSlide" function and pass them to the "xPos" of the testClip so that the testClip will move in relation to the slidebar.

Thanks in advance to any and all for helping on this one!
Erik

Simple Function Help.
Hello,

1. I have a movie clip called "mve_Home", and I've got a dynamic text field instantiated inside that movie clip named "buttonLabel"

2. On the main time line where this movie clip ("mve_Home") resides I have some function declarations in the first frame.

They are as follows:

------ CODE BEGINS -------

//function definition
mve_Home.onLoad = function() {
this.buttonLabel = "Home";
}

//function call
mve_Home.onLoad();

------ CODE ENDS --------

This code does nothing. My text field does not change, and I do not know why. I might be missing something about function operations within a frame's actions, all on one timeline. Can someone spin me around and tell me what I'm doing so I can walk in the right direction?

Thanks in advance.

Simple Function
I've a simple if statement:


Code:
if (web == "true") {
null;
} else {
getURL("cursor:in");
}
}


how do I put this on a frame function? so when a button is clicked it calls this in?


is that the right way to do it? it wont work straight off a button cos its sending a variable to authorware

Simple Function Q
I must admit I'm a total function newbie, but from what i've picked up so far this should work.

In a frame on my main timeline:
function startthislounge (track) {_root.movieclip[track].gotoAndPlay(2);

...and on an external swf loaded from the main timeline:

_root.startthislounge (lounge10);


...what's wrong with it?

BTW sometimes I see actionscript code posted in what looks like quotes but isn't - how's that done ?

Simple Function
I created this function:
function slotColor(eData:String,clipName:String){
if (eData==1) {
clipName.gotoAndStop("bs");
} else if (eData==2) {
clipName.gotoAndStop("bfs");
} else if (eData==3) {
clipName.gotoAndStop("nbs");
} else if (eData==4) {
clipName.gotoAndStop("nbfs");
}
}

And I am passing its values here:

var ext_data:LoadVars = new LoadVars();
s1_mc.onEnterFrame=function(){
slotColor(ext_data.s1,s1_mc);
};
ext_data.load("status.txt");

FlashMX is giving the following error:
**Error** Scene=Scene 1,
layer=actions,
frame=1:Line 14: There is no method with the name 'gotoAndStop'.clipName.gotoAndStop("bs");
What I am doing wrong? Flash is not "seeing" that my movie clip is created at the time the frame is loaded. I have another function on the same frame. The difference is that on this other function the movie clip is already on the stage.

Simple Function
I am trying to write a simple function on the root timeline that tells a movie clip on that timeline to play. Each movie clip is named sequentially (mc1, mc2, mc3, etc.). I want the function's parameter be the mc's number ( function intro(2);) I have tried this a bunch of ways but it doesn't seem to work. Any help would be appreciated, thanks,
chris

Simple Function
Hi,
I have four MCs on the root timeline, box1, box2, box3, and box4. I want to write an efficient function that says "when box(x), starting with box1, reaches frame 15, play box(x+1) and to stop after box4 plays." I hope I described this well enough. I can make it work but I know I am being really sloppy and cumbersome. Thanks,
ix

Simple Function
On Flash MX:

Hi, I entered this code:

MovieClip.onEnterFrame = function()
{
this._rotate += 5;
};


OK, this function rotates the "MovieClip", but doesn't it should only rotate once (5 degrees)?
It's rotation never stops, I have only 1 frame (I tried to put others, but the result is the same).
Viewing on Flash Player, I stoped "loop", but it keeps rotating.

Thanks for the help!

Regards,

pedro

[AS2] Simple If Function
so i have a dynamic text box on the first frame and it is a display name box, i used this code to load the data to the box and that works fine.
///this code /
var my_so:SharedObject = SharedObject.getLocal("displayname", "/");
_root.disname = my_so.data.txt;
///
Now i want flash to say ok he's been here before, go right on to frame 2 sir, i tried:
if (disname.text == undefined){
gotoAndStop(1);
}else{
gotoAndStop(2);
}
also tried with a false if statment after the else:
}else{
if (disname.length < 1){
gotoAndStop(2);
}
Also added function signin(){ at top aswell with extra } at bottom but none of these work. im gonna guess i need to use a diffrent method becuase im loading in to the dynamic text box aswell and thats what i want to detect.
Thanks in advance Astano

Help With Simple Function
Code:
var i:Number = 1;
function attachM(mov:Number) {
new mx.transitions.Tween([this], "_x", mx.transitions.easing.Strong.easeIn, 0, 70, 1, true);
new mx.transitions.Tween([this], "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 1, true);
}
onEnterFrame = function () {
if (i<=20) {
i++;
var moo:MovieClip = attachMovie(mov, mov+i, i);
moo.onEnterFrame = _root.attachM;
trace(i);
}
};

Help With A Simple Function?
ActionScript Code:
function fadeOut(mc, speed) {
    mc.onEnterFrame = function () {
        if (this._alpha > 0) {
            this._alpha -= speed
            } else {
                this._alpha = 0;
                delete this.onEnterFrame;
            }
        }
}

so i have this code contrlling the fade outs in my movie. just need a little help modifying it.

I want mc to be any variable I call but im not sure how to go about that because its mc.onEnterFrame

for instance, i have a function

ActionScript Code:
var getinfo:Function = new Function (function() {
    siteinfo = "map."+district+"."+infotype;
})

so for testing purposes, i made a button call district = "dist1" and infotype = "info1"

i trace siteinfo on another button and its map.dist1.info1, which is a movieclip that i have, and yet when i use fadeOut (siteinfo, 15) i wont do anything, i suppose its looking for a movieclip called siteinfo so how can i make the function accept the variable name??

Some Simple Function Help
Hello everyone,

I've had AS'ing block and I need some help what my problem is im trying to use a function inside a MovieClip from outside of it its litterally inside the movie clip not like saying click to view actionscript on the movieclip but its inside its area how would one use a function inside a frame inside a movie clip outside of it?

One Simple Function
can I write this in one simple function?


container1.onPress = function() {
slide.loadMovie("1.jpg");
}
container2.onPress = function() {
slide.loadMovie("2.jpg");
}
container3.onPress = function() {
slide.loadMovie("3.jpg");
}
container4.onPress = function() {
slide.loadMovie("4.jpg");
}
container5.onPress = function() {
slide.loadMovie("5.jpg");
}
container6.onPress = function() {
slide.loadMovie("6.jpg");
}

tks!

Help With A Simple Function.
Well I am trying to get a silly onResize Stage.addListener full flash browser site to work but content isn't moving when I resize the window.

I have done these before but I never ran into this problem and it is causing headaches. I will attach the FLA... please someone help me figure it out.

Simple Function Call?
Hi guys,

have a very simple problem....i can't call functions????!!!. can tell em what am i doing wrong here??? isn't working....puzzled!


code on main time line
*******************
namevar = "0";
area = 0;
_root.one.name();
_root.one.Circle(10);
trace ("name="+namevar);
trace ("area="+area);
********************


code on the timeline of mc one, instance name is also one
*********************
function name () {
_root.namevar = "mayavi";
}


function Circle (radius) {
this.radius = radius;
this.area = Math.PI*radius*radius;
_root.area = this.area;
}
************************

works fine when function has been defined inside the maintimeline??? is my function reference wrong? what??

cheers
mayavi

Problems With Simple Function
hi there!
in my main timeline i have a mc called "funcMC" and on his first frame i have the function:

function test(){
var1 = "hi ";
trace (var1);
}

when i call this function from the first frame of the main timeline like this:

_root.funcMC.test();

NOTHING HAPPENS!
what do i do wrong? i'd really like to understand the mistery of defining functions...
thanks for any help and peace, kolt
[Edited by kolt siewerts on 11-01-2001 at 11:17 AM]

Simple Function Causes IE To Crash?
Hi evereybody,

I've had a navigation problem wich I solved using an array (asStack) and asfunction.
The function plays an animation in the main timeline, unfolding a window, and then stops to load a movie. Where that movie starts to play is retreived from the "asStack" array.

This all woks fine in the preview, online in Netscape and IE on mac, but in IE on a windows machine it crashes the program. I don't know if this is a hidden leathal combination or something, but it seems to come down to the function.

I uses the asfunction alot with no problms and the array's seem to work fine in other parts so I ran out of ideas.

I used:
<A href= 'asfunction:_root.runRoot,omfi_what'>, to point to the function and

function runRoot (frame) {
asStack.push([frame]);
_level0.gotoAndPlay("gowindow");
}

thanks

Very Simple Function Question
How do?

I'm new to programming of any description and am muddeling through it.

My problem:
I have a load of Functions named "thumb1", "thumb2", "thumb3" through to "thumb33"

Basically I have a variable called "thumb_no" which is an integer.

If "thumb_no" is equal to 7, I want to call the function "thumb8 ()" when clicking on a button.

I have tried stuff like

on (release) {
["thumb"&&thumb_no+1] ();
}


If anyone can help I'd be very grateful (it's no doubt very easy and I'm being stupid).

Tom.

Simple Function Question
Here is the code:

form_mc.onData = function(){
form_mc._visible = false;
};


this is in the first frame on my root timeline. There is a form_mc movieclip in that same frame. in that movieclip is a form that is connected to a php script. when the submit button is clicked the form calls the php script and it returns text that goes into a text box. this all works fine. I want a script that will see the php has passed a variable back to flash and will make the form disappear. I thought this bit of code would work, but it doesn't. any suggestions?

eric

Function Question (simple I Think)
Hey guys,
i have a question about this function that I made. It simulates movement. The way I have it set up is as follows:
function move(movie, location){

movie._x=movie._x+(location._x-movie._x)/10;
movie._y=movie._y+(location._y-movie._y)/10;


}


is it possible, to get those two commands within the function to run over and over again until the movie reaches the location. I tried messing with some while statements but to no avail. Any help would be very much appreciate.d Thanks everyone
Don

How To Write A Simple Function?....
Hi,

This may sound completely ridiculous... but could someone please explain to me how to write a simple function. (so that I can get the basic idea of functions and variables..)

Any help much appreciated.

Thanks

Simple Function Question, Anyone Please
Hey, I figure this is simple, but how can I reference local variables in a function relative to the movie that is calling the function? I tried something like this but it didn't work. It just returned "undefined":

function whatever(nameofmovie){
trace (_root[nameofmovie].attribute1)
}

In short, how can I reference a variable that is local to the movie calling the function?

thanks,
greg

Simple MC Stop Function
Is there a way to stop an MC externally through a button?
Thank You for your time.

Simple Function Headache
This is my first function i've created in flash. It is in the frame 1 of the main timeline and takes 1 parameter. I'm trying to call this function from a movieclip located in: _root.options

If I place a trace in on of the functions nothings happens so which means the function is not engaging. Thanks for your time!

Here is the main timeline actionscript (frame1):

PHP Code:



_global.button_hit = function(item)
{
     actions here and make use of the item parameter
}

_global.button_rollover = function(item)
{
     actions here and make use of the item parameter
}





Here is the movie clip actionscript:

PHP Code:



on (release)
{
    button_hit('wheels');
}
on (rollOver)
{
    button_rollover('wheels');
}

One Simple Function Question
I wonder how exactly does the "synchronise frames" function work?>

thx

Simple Print Function
All i need to know is how to print one certain frame. I know how to set up the boundary, and designated my frame with a #p label, I need to know the action that is nessesary for my print button. If you can, please include the actual script! BIG HELP! thanks!

Simple Function Question
Hey guys,
i have a very simple question. Or at least i think it is

I have two functions, one called create the other call createit. I want to call createit so that it initiates movement but if i nest it within an onenterframe command it seems to not work when done inside of a function. Any ideas.
Thanks so much


_global.create=function(){
_root.ball._x+=(_root.marker1._x-_root.ball._x)/12;
}

function createit(){
this.onEnterFrame=function(){
create();
}
}

Simple Button Function...
I've done this before with MX and now I'm running into trouble
I just want the most simple- click and get URL function. Here's what I have:

<not set yet>.onPress = function() {
getURL(http://www.yahoo.com);

}

The <not set yet> is highlighted in red-- what is not set yet?

Simple Function On A Button
I created this function of the main timeline:

MovieClip.prototype.maskMove = function(direct){
if(direct == 1){
if(this._y <= 500){
this._y = this._y + 5;
}
}
if(direct == 2){
if(this._y >= 75){
this._y = this._y -5;
}
}
}

and on a button on the main timeline I place this script:

on(press){
_root.attachMovie("Mask","newMask",2,{_x:30,_y:75} );
_root.attachMovie("StartMov","newMov",1,{_x:30,_y: 75});
_root.newMask.maskMove(1);
}

Why doesn't my movie "newMask" move when I press the button? I am using Flash MX 2004.

Thanks
Jay

Simple Function Not Working
I feel kind of silly asking this, but can anyone tell me whats wrong?

code:

function overButton (ClipName) {
trace("workingOver " +ClipName);
ClipName.submenu.surroundings.heading.colorTo("0x0 099FF",.2,"easeInOutSine");
ClipName.submenu.surroundings.heading.tween("_x",5 ,.2,"easeInOutSine");
ClipName.submenu.surroundings.back.alphaTo(100,.2, "easeInOutSine");
trace("workingover complete");
}




Say ClipName is "commercial" the trace comes out fine with commercial inserted. Even when i replace ClipName with "commercial" and hard code it in, the function works! but not with the parameter.

Can anyone tell me where im going wrong?

Cheers!

EDIT: Added [ as ] tags - jbum

How To Write A Simple Function?
(unanswered post from Macromedia's ActionScript Forum--please help)
Dear Users:

I have glanced at a couple of tutorials and tried to write my own function but can't seem to get it to work.
What am I doing wrong? Following is the function I wrote and the error in the Output Window.


----script in frame 1 of main timeline----
function myMove(myParam:String){
myParam.this._x=_xmouse;
myParam.this._y=_ymouse;

}

myMove(myObj_mc);

----OUTPUT WINDOW----

**Error** Scene=Scene 1, layer=actions, frame=1:Line 2: Expected a field name after '.' operator.
myParam.this._x=_xmouse;

**Error** Scene=Scene 1, layer=actions, frame=1:Line 3: Expected a field name after '.' operator.
myParam.this._y=_ymouse;

Total ActionScript Errors: 2 Reported Errors: 2

This function is attempting to recreate the startDrag() function. I'm testing to see if I can write one so that I can emplioy some new techniques for other stuff I want to do.

Thanks in advance for any help.

Simple Function Call
Think I'm going nuts, but I'm just trying to run a function in a nested movie. I even tested something really simple, and it doesnt seem to work.

-On my root timeline is a MC instance named newMovie.

-In newMovie here is the function.
function thisIsMine() {
trace("doing");
}

on the root timeline, I have this script:
newMovie.thisIsMine();

Its not running the function. I've also tried calling it with an absolute target, _root.newMovie.thisIsMine();
and it didn't seem to work.

Simple Function And If Statement
This should work, but it doesn't:
I have two buttons, and it seems that the variable for 'activebutton' -
IS NOT BEING RECOGNIZED. Am I referencing my variable correctly and expressing the IF statement correctly ??

// Button 1
this.buttonsoa.button1.onRelease = function() {
_global.activebutton = "oabenson";
buttonhit();
loadVariables("data/contentoa_benson.txt", "");
};
// Button 2
this.buttonsoa.button2.onRelease = function() {
_global.activebutton = "oadeeks";
buttonhit();
loadVariables("data/contentoa_deeks.txt", "");
};
//abstract and keyfindings are buttons- that I want to be effected differently
depending on what the variable 'activebutton' is.

if (activebutton == oabenson) {
this.content_mc.abstract.onRelease = function() {
loadVariables("data/contentoa_benson.txt", "");
_root.contentoa.content_mc.onstates.gotoAndStop(1) ;
};
this.content_mc.keyfindings.onRelease = function() {
loadVariables("data/contentoa_benson_key.txt", "");
_root.contentoa.content_mc.onstates.gotoAndStop(2) ;
};
} else if (activebutton == oadeeks) {
this.content_mc.abstract.onRelease = function() {
loadVariables("data/contentoa_deeks.txt", "");
_root.contentoa.content_mc.onstates.gotoAndStop(1) ;
};
this.content_mc.keyfindings.onRelease = function() {
loadVariables("data/contentoa_deeks_key.txt", "");
_root.contentoa.content_mc.onstates.gotoAndStop(2) ;
};
}

Very Simple Login Function
I'm trying to create a simple login function to a (not-so) secret area of a flash site.

There are 2 parts to the login - both number based.
A user needs to enter a code such as:

1845 / 125

the first half needs ANY 4 numbers, no less than 4 though.
The second half needs any 3 numbers from 001 to 260, no less than 3 though.

At the moment I have 2 seperate text input boxes (limited to number imput only) but have no idea how to get it to work.

The actions once logged in are simply to go to different frames of the movie (one which contains a "go away" style message. The other holds the
secret area of the site.

Can anyone point me in the direction of a suitable tutorial or have any pointers to help?

Very Simple Function() Question
I have a function on _root (main timeline) called dropAll
and i have a movie clip on my timeline.

I want to use my function for a button inside my movie clip. What shall i write in my button ?

thanks.

function dropAll(width,height)

[F8] Really Simple Function Question
I'm making a game where i need a function like so;

MakeEnemy("armyDude", 550, 400, 100, 2, 300);
MakeEnemy(enemyInstanceName, xPos, yPos, health, speed, ammo);

but i want to be able to do something like;

MakeEnemy("helicopter", -50, 500);
MakeEnemy(enemyInstanceName, xPos, ammo);

How can i do this with the same defined function?

is it just do something like;

MakeEnemy("helicopter", xPos:-50, ammo:500);

?


Thanks for your help!

Simple Function - Move MC To X,y
Hi,

is it possible to call a function, ie.

_root.myMC.MoveTo(x,y,speed);

hereby moving myMC from whereever it may be towards x,y with a defined speed until it reaches x,y?

cheers,

Mads

[F8] Simple Function Problem?
If I do the following it doesn't start the instance playing, but does trace the "checking blog content":

Quote:




function check_blog_content() {
trace("checking blog content");
instance.gotoAndPlay("fade in");
}

check_blog_content();




If I put the same action on a button and click it, it works just fine?


Quote:




button.onRelease = function() {
instance.gotoAndPlay("fade in");
}




What am I missing or not getting here? How can I have a function as above that "activates" upon the movie loading as well as being useful later on?

Thanks for any help!

[F8] Simple Function Letting Me Down
Hi all!

i am creating a menu whereby the buttons fade in with a delay relative to the top left mc.

this is the code i used for individually setting each button:

PHP Code:




gallery_menu.wildlife_but.fadeIn(3,linear, (Math.sqrt (
  Math.pow((gallery_menu.wildlife_but._x-start_posX),2) +  Math.pow((gallery_menu.wildlife_but._y-start_posY),2)))/75);







**start_posX and Y variables are the position of the top left mc**

This is a bit tenuous so i created a function to do the job, though i cannot get it to work when i call it:


PHP Code:




function galleryFade(posX:Number,posY:Number):Void {
    this.fadeIn(3,linear, (Math.sqrt   (   Math.pow((this._x-posX),2) +  Math.pow((this._y-posY),2))  )/75);
}







and calling it:


PHP Code:




gallery_menu.wildlife_but.galleryFade(start_posX,start_posY);







please help!

Cheers

[F8] Simple Function Not Working?
Code:
var objects = Array("bg.person1", "bg.person2");
function checkForCollisions(){
var collision:Number = 0;
for (i=0; i<objects.length; i++){
//if the user collides with of the objects in the array...
if (_root.zack.hitTest(_root.objects[i]) == true){
trace("collision with " + objects[i]);
}else{
trace("no collision with " + objects[i]);
}
}
trace(collision);

}


for some reason it ALWAYS returns "no collision with blablabla" even when the mc zack is hitting an object specified in the array.

Really need help with this one guys.
Thanks.

Simple Delay Function?
Is there a simple script to delay the playback head for a specific ammount of time?
for example; If I have a movie clip for a character's eye blink and rather than layout 100 frames to create a big loop I'd like to drop a script in the last frame that just delays the playback for a few seconds, or better yet a possibly random ammount.

I've hacked my own script but it invloves a three frame gotoAndPlay loop that feels inelegant:

Frame1:
//blink delay script--set blink interval in milliseconds
this.delay =(getTimer()+random(3000)+3000);

Frame2:
//blink delay script--loop frame
play();

//blink delay script--if delay time is reached,then play.
this.time=getTimer();
if(this.time>this.delay){
this.play();
}else{
prevFrame();
}

What I'd rather have is a simple function:

Frame 1:

fnDelayBlink(1);

that would pause the movieclip for 1 second.
but I have no idea how to pause the playback within a function...

any help?

Simple Function Question...
Hi I wanted to know what the difference is between the following ways of writing a function....

1. function createScroll(){

2. createScroll = function (){

At the moment I am using them whenever the moment takes me but I am sure I will get in a pickle one day! Can someon explain?!

Thanks

Simple Math Function?
Hi
I have 4 txt boxes that will have 0 or 1 depending on a collision or not.

I want to set another txt box to be the total number in those 4 boxes.

ie if the boxes are 0,0,1,1 then the total box would say 2.

I dont know how to do it actionscript but i guess it would be something like this:

total_txt.text = txtbox1 + txtbox2 + txtbox3 + txtbox4

please can someone help?

Thanks,
Dan

(not:-( ) Simple Function Question
I tried to modify my code ( photo gallery with XML ) all day through this forum and others...still tonight I am stucked. So may'be I will de-stuck tonight...
I am desesperatly trying to create a function for next and previous buttons.
I can not figure out what I have to do.
I will not make it heavy with all the script but be selective on the concerned and potentially important parts of it :

- Load and read the xml
xmlPhotos.onLoad = function() {
for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo;
initThumb.titre = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild);
initThumb.count = (xmlPhotos.firstChild.childNodes[i].childNodes[1].firstChild);

- The object InitThumb ( the thumb scroller) that "calls" my big pic :
initThumb.onRelease = function() {
mcLargePhoto.loadMovie("images/travel/"+this.photo+"");
txtCount.text = this.count;
txtDesc.text = this.titre;

The 2 buttons to go to previous and next image are already on stage with instance names.
Voila.
I stuck there. I tried "2000 things" , from other scripts, from my own but nothing works.
Any tip or guideness or explanation will ease my pain . I am really stucked there.
Thank you !!!!

Simple Problem With Function?
ok so i have a function to control fadeIn's instaed of making the timeline do such things and calling flagged frames


ActionScript Code:
var fadeIn:Function = new Function (function (mc, speed) {
    mc.onEnterFrame = function () {
        if (this._alpha < 100) {
            this._alpha += speed
            } else {
                this._alpha = 100;
                delete this.onEnterFrame;
                }
            }
})

and on my main stage i have some code:

ActionScript Code:
var tab = "none";

topbuttons.gplBtn.onRelease = function () {
    if (tab != "none") {
        fadeOut(tab, 5);
        tab = "gplTab";
        fadeIn(tab, 5);
    }
    else {
        tab = "gplTab";
        fadeIn (tab, 5);
    }
}

i want the button to fadeIn the tab variable since its always going to be changing but its not working

when i type fadeIn (gplTab, 5) which is the actual tabs name, it works fine, how come it wont recognize the variable instead of just the movie name??

Should Be VERY Simple Function Call
I am new to AS3 and I know this is probably obvious but...

I want to call a function I defined on the main timeline from inside a movie clip instance.


here is my function:

function imAFunction():void
{
trace("I am a function wheeeee!");
}

inside the timeline of a movie clip I have tried to call it in all sorts of ways

root.imAFunction();
this.stage.imAFunction();
this.parent.imAFunction();
etc etc


but I keep getting this error:

1061: Call to a possibly undefined method imAFunction through a reference with static type flash.displayisplayObject.

Simple Slideshow Function?
Hi all.

I´m pretty new to scripting, but this should be easy stuff for all you coders out
there:

I have a strip of pictures, a "bar" around 7 times wider than the width of
the stage.

Now, i when the mousepointer is to le left of the screen, i want the
pictures to accelerate
to the right, and vice versa. The movement should only be activated when the
mousepointer
is at the side, and there should be 75% room for mousemovement without the
pictures moving.

A good example of what i mean is http://www.manhattanloft.co.uk/mlc/.
(Type a name to get past the yellow screen).

How´s that done?

Thanks,
Jan R.

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