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




MyMovieClip.onEneterframe = Foo(arg);



why can't i send the onEnterframe event handler function params?

this works (calls it repeatedly):

function foo() {
trace ("onEnterFrame called");
}
//
myMovieClip.onEnterFrame = foo;

this doesn't (calls it once):

function foo(arg) {
trace (arg);
}

myMovieClip.onEnterFrame = foo("test");

any thoughts?



FlashKit > Flash Help > Flash ActionScript
Posted on: 12-09-2002, 11:18 AM


View Complete Forum Thread with Replies

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

Mymovieclip._y , Can You Help Please ?
I am using Flash MX, here's my question.
I have one movieclip called "hope" and one botton called " stay "
both on the main page.

this is the action on botton.

on (release) {
i = "1";
b = "hope"+i;

trace(b);
trace(b._y);
trace(hope1._y);

}


can you tell me why my result are

1. trace(b) = hope1
2. trace(b._y) = undefined
3. trace(hope1._y) = 80


No. 1 and 3 are correct, My question is why number 2 is undefined ? why the result is not 80 since b = "hope1". anyone can help me ? where do i have to change to make trace(b._y) = 80 ?

Thank you so much

MyMovieClip.onRelease
hi

i used this loop to declare every movieclip in an array as a button:

for(i=0; i<theArray.length; i++){
_root["myMovieClip" add i].onRelease = function () {
_root.theReleasefunction();
}
}

but the function only appears to work on the last moieclip (i=theArray.length)

what can i do????

please help

MyMovieClip.onData
For what can be used this method?


Code:
myMovieClip.onData = function () {
trace ("onData called");
};
Thanks Jan

If (myMovieClip = Null){ ?
I have been using this code for a while now and simply list all animated movie clips in a function like this...


ActionScript Code:
if (myMovieClip != null){
myMovieClip.stop();

I also make another function to play each movie clip.

The problem I am having now is I THINK when the movie clip isn't present at the beginning of the scene (Where the above code is) I get an "Access of undefined property" error. I dont know why I am getting this because I was hoping that if myMovieClip is null then it would ignore the rest of the if statement and go onto the next, but I could be wrong. Can anyone explain exactly what is going on here.

Cheers

MyMovieClip ._framesloaded
http://www.macromedia.com/support/fl...ionary522.html


Does anyone know a good tutorial to explain this? I'd like to use this over the depracted ifFrameLoaded....


Thanks.

MyMovieClip ._framesloaded
http://www.macromedia.com/support/fl...ionary522.html


Does anyone know a good tutorial to explain this? I'd like to use this over the depracted ifFrameLoaded....


Thanks.

MyMovieClip.hitTest(target)?
Hi,
Can "target" be a MC?
According Macromedia's tutorial, "The target usually represents a button or text-entry field". My target is a MC. Is it possible to use the hitTest()?
I want to detect the collision of two objects.

Please help. Thanks!

MyMovieClip.onLoad = Function () {
Can someone tell me if this is meant to work in this way
drop_down.dropContent.onLoad = function() {
trace("anything");
}
like in flash 5 you had
onClipEvent (load) {
trace("anything");
}
Am I loosing my mind or this is not working in my MX
I have used the
drop_down.dropContent.onEnterFrame = function() {
trace("anything");
};
and this works.

MyMovieClip.onLoad = NOT WORKING
I have a movie clip on my stage called "displayMC", on the first frame I place the following

Code:
displayMC.onLoad = function(){
this.nextLetter = 0;
trace("Next Letter is " add this.nextLetter);
};


I get NOTHING in the output window and when I try to use the value in an onEnterFrame it is undefined so the code continues to execute well after the desired effect has taken place.

What's strange (at least to me) is that if I change the onLoad to onEnterFrame, the trace executes and shows in the output window.
<font color = "red">EVEN MORE STRANGLY, </font>if I select the movie clip and attach the code in the old way

Code:
onClipEvent(load){
nextLetter = 0;
trace("Next Letter is " add this.nextLetter);
}


That works.

Can anyone see what I am doing wrong?

MyMovieClip.gotoAndPlay(frame)
i don't understand...on the guide i'ts written:

myMovieClip.gotoAndPlay(frame)


but it doesn't work...

i tried even

_root.myMovieClip.gotoAndPlay(fotogramma)

nothing....

why????






thanx

MyMovieClip.enable=false ?
I'm trying to use this code on a button to disable an MC.
I created an MC, gave it a name for action script linkage, and placed the code myMoviClip.enable=false on my button.

Nothing!!! it doesn't work! What am I missing?

Thanks

Coccinelle

Loop On A MyMovieClip.loadVariables(url)
Hi

I am trying to make a flash program that manages a list of online people in real time (in a List Flash component)

To load the list, I use an empty movieclip that gets the data (named "datavault"). When the datavault.loadVariables(url) is finished, a procedure datavault.onData = function () { ... } is called and that one manages to add the people to the list. After that, I want that function to launch a loadVariables again, to have a permanent loop on that loading. I might add some delay on that later on, but that's not the matter.

With the TRACE, I can see the only onData that is loaded is the first one, and after that the script stops.

Hereunder is the script I used :


Code:
url_get_userlist = "http://"+_root.phpserver+"/index.php?action=getuserlist";
_root.datavault.loadVariables(url_get_userlist);

_root.datavault.onData = function()
{
global url_get_userlist;
trace(_root.datavault.sv_userlist);

/* the user list is shaped that way : user1<!>user2<!>user3<!> */
array_userlist = _root.datavault.sv_userlist.split('<!>');

for(i = 0; i <= array_userlist.length; i++)
{
if(array_userlist[i].length)
{
_root.chat_userlist.addItem(array_userlist[i]);
}
}

_root.datavault.loadVariables(url_get_userlist);
}

MyMovieClip.onLoad Not Being Called
Code:
bonusRound.onLoad = function()
{
trace("onLoad called");
};
this is in my action layer, yet isn't being called. my bonusRound.onEnterFrame calls just fine.....any suggestions?

Mymovieclip.onMouseUp = Function()
Hi Guys,
I have just developed a simple xml photo gallery. Below is the code that I have used to generate the gallery:


Code:
var gallery = createEmptyMovieClip("galleryImage",0);
for (i=0; i<total; i++) {
cur_item = gallery.attachMovie("mainImage","spec"+i, i);
cur_item.loadMovie(thumb[i], "mainImage");
cur_item.onMouseUp = function() {
getURL(javascript:openWindow("products/"+id+"/"+image[i]));
};
}
I am having difficulties to make each movie clip generated into a button that will call the javascript button:


Code:
cur_item.onMouseUp = function() {
getURL(javascript:openWindow("products/"+id+"/"+image[i]));
};
What i want to do is to allow the user to click on the movie clip and it will call javascript and open the image in a html window. For some reason I can't get it to do anything. Am i using the correct code to do this?

Please advise

Much appreciated

Daniel

Question About MyMovieClip.onLoad
myMovieClip.onLoad = function () {
trace ("onLoad called");
};

it not works

thx for any helps

MyMovieClip.onRelease Vs. On(release)
What are some advantages to using one over the other?

Mymovieclip._visible = False // Won't Work
could somebody tell me wy this action suddenly fail :


Code:
mymovieclip._visible = false


Instead I used setproperty(...,...,..)
and this works

I'm getting really mad !!!
News

MyMovieClip.loadMovie("image.jpg")
this can be possible in Flash MX?
in the reference looks like can be possible but i try and i can't..
the image doesn't appears

myMovieClip.loadMovie("image.jpg")

i'm loading the path of the image from a xml
if i view it in flash player 8 the image appears... but i need it for player 6

please help...

MyMovieClip.gotoAndPlay("frame")
thats the syntax i need....when i click a button on the main timeline, i want it to goto a certain frame in a certain movie clip and play. the exact syntax is

on (release) {
mainstage.gotoAndPlay("bio");
}

contains no errors....dunno what to do.

help?
please?
PLEASE?
hah....

thanx

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