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








Function Should Work.....


but doesnt

code:
function ease(endy,speed){
onEnterFrame=function(){
trace("still going");
_x += (endx-_x)/speed;
_y += (endy-_y)/speed;
if (Math.abs(this._x - this.endx)<0.5 && Math.abs(this._y- this.endy)< 0.25){
_y=endy
_x=endx
delete ease()
}
}
}



then its

code:
on(release){
_root.menu.dropdown.ease(35,4);
}




FlashKit > Flash Help > Flash ActionScript
Posted on: 10-08-2004, 05:55 PM


View Complete Forum Thread with Replies

Sponsored Links:

:: HELP ::: About Call Function First Time, Y Dont Work ? Next Time Work
http://202.57.150.77:8083/index.html

c at product click particle mdf or hdf then c animation wasnt play at first time y not ?


Code:
_root.readDB();
_root.onData = function() {
_root.selectLang();
PlayAnimate();
};




Code:
function PlayAnimate() {
for (i=1; i<=6; i++) {
if (this["obj" + i].mystate==_root.lastKeyAccess) {
deepMc = deepMc + 1;
duplicateMovieClip("theAnimate", deepMc, deepMc + 100);
this[deepmc]._x = this["obj" + i].mcx;
this[deepmc]._y = this["obj" + i].mcy;
this[deepmc]._visible = true;
this[deepmc].gotoAndPlay(1);
this[deepmc].PName = _root.lastKeyAccess;
}
}
}

View Replies !    View Related
Why Won't My Function Work?
I have created a simple function which is placed in the root of frame 1 (currently the only frame). But whenever I call it (from inside a movieclip), it doesn't work as it should do. The function is:


Code:
function notify(net, prot, elet) {
if (net=1) {
/:tneu=/:tneu+1;

net = 0;
} else if (prot=1) {
/:tpro=/:tpro+1;

prot = 0;
} else if (elet=1) {
/:tele=/:tele+1;

elet = 0;
}
}


and it is called using:
/:notify(0,1,0);

The problem is that the function always executes as if net=1, even when the arguments are (0,1,0). Thanks in advance.

Ade

View Replies !    View Related
Why Does My Function Not Work
Just getting this out the way. Please don't ask me to rearrange things or put the function in the main timeline because I have things where I want them:|

I have an MC "webloganime" and inside that I have another MC "calendar", and inside that another MC "day". Inside "day" I have a function (lets call it "function)". I put a simple trace inside funtion but when I call it from _root.webloganime.calendar.day.funtion(); it doesn't work! (I do'nt get a trace back) I can put it in the main timeline and call it from there _root.function();

But it doesn't seem to work anywhere else. I can extract variables from day and modify dynamic text etc so I don't think my path is incorrect.... It even shows up as a function when I list variables. I'm at my wits end on this. Maybe it is the way I am declaring the functino in flash mx 2004 or the player? I am doign it this way

function functionName(){
something soemthing
}

in the first frame of MC "day". Any help is appreciated!

View Replies !    View Related
Trying To Get This Function To Work.
I have a button which initiates a function called: "Handler" Like this :
on(release){
Handle(this._name);
}
The function looks like this :
function Handle(id) {
if (id == "item01") {
_root.MC1.gotoAndStop("on");
}
}

"id" is a variable for a dynamic text box, it's contents will change. But for this test the contents read "item01".

It doesn't work, can anyone offer any insight into this ??
Thanks.

View Replies !    View Related
[F8] Please Have A Look: Function Won't Work
Can anyone tell me why the following function won't work?

code:

for(var i:Number=0; i==lv.TotalNum; i++){
this["var mainMC" + i + ":MovieClip"] = this.createEmptyMovieClip("mainMC" + i, this.getNextHighestDepth());
};

View Replies !    View Related
Function Only Work For 1 Mc
hi guys,

this is a weird situation i currently face. hope you can help.

i had define a function and it works fine. my problem is when i assign it to say 3 mc, it only work with the latest mc.

Code:
function goRight(m:MovieClip){onEnterFrame=function(){m._x++;}};

goRight(mc1);
goRight(mc2);
goRight(mc3);
and only mc3 is moving. is there a way to work around it??

thanks!

View Replies !    View Related
Why Won't This Function Work Twice?
PHP Code:



n = ["saab.jpg", "polo.jpg", "golf.jpg", "x_type_estate.jpg", "jag_us.jpg", "renault_clio.jpg", "porsche.jpg", "laguna.jpg"];
function loadthumbs(x, ext, lev) {
   th = _root.createEmptyMovieClip('thumbholder'+ext, lev);
   th._x = x;
   th.createEmptyMovieClip('holder', 1);
   
   for (i=0; i<(n.length); i++) {
      ypos += 90;
      th.holder.createEmptyMovieClip(['t'+i], i);
      th.holder['t'+i].createEmptyMovieClip('img', 1);
      th.holder['t'+i].img.loadMovie('http://www.charliekassel.com/_joncox/exterior/'+n[i]);
      with (th.holder['t'+i]) {
         _y = ypos;
         _x = 10;
      }
      
   }
}
loadthumbs(0, 1, 1);
loadthumbs(300, 2, 2); 

View Replies !    View Related
Why Won't My Function Work?
hi

why won't my below script work?


the movie clip is called "blue"

and i want it to move useing a function in a function
is it posible?
--------------------------------------------------
blue.onEnterFrame = function() {
movestop(this._x, 10, 500);

// movestop function

function movestop(thing, speed, dist) {
thing += speed;
}
};
----------------------------------------------------------------

if i go

blue.onEnterFrame = function() {
this._x+=10;
}

then it works



thanks

Andrew

View Replies !    View Related
Function Won't Work
Hi all,

I'm having the weirdest thing happen (or not as the case may be). Let me start by saying I'm not proficient in Actionscript and don't even use it that much, but writing a function and telling it to run doesn't seem like it should be this hard. My code is below and my problem is basically that the function won't run. Everything seems correct, but no matter what I do I can't get anything inside the function to display.

*******************************************************

path = _root.flvLink; //Assign variable to the info we passed it from the html
//flv_path = 'test.flv'; //Use for testing, when not running from an html page

path = path.split(".");
path = path[0];

num_images = _root.slides; //Assign variable to the info we passed it from the html
num_images = 1; //Use for testing, when not running from an html page

// convert num_images into a number (I'm not sure what it comes in as, but it's not a number)
num_images = Number(num_images);

//if no slides are in the video just skip right to the video, no preloading required
if(num_images == 0 || num_images == undefined){
nextScene();trace("nextScene");
}
else {
trace("else");
i = 97;

function loadImage() {

trace("in loadImage()");
/*
//converts the number into a string, 97 is lowercase 'a'
string = String.fromCharCode(i);

// This assigns the name of the image with an identifier after it
png_path = path + '_' + string + '.png';

test=num_images+":"+png_path;

// Set the location of the content to be loaded. Examples are:
myLoader.contentPath = png_path;

// Increase i
i++;*/
}

// Create a listener object event function. The progress bar is an object so it needs an object function to work
myProgressBarListener = new Object();

// When the progress bar is complete and has preloaded the loader component content, the listener will call and run this code below:
myProgressBarListener = function (eventObject) {
trace("i: " + i);
if(i < num_images + 96) {
loadImage();
trace("test");
}
else {
// Go to the next scene
nextScene();
}
};

trace("before loadImage()");

// Call the above function
loadImage;

trace("after loadImage()");

// Finds all the images and loads them into the loader
//for (i=97; i < num_images + 97; i++) {}

// Declares a listener that detects when the progress bar component has loaded the loader component content and is complete. Then calls the function myProgressBarListener
myProgressBar.addEventListener("complete", myProgressBarListener);

// Set up the progress bar component variable to polled mode which determines the maths behind the % counter.
myProgressBar.mode = "polled";

// The location of the Loader Component
myProgressBar.source = "myLoader";

// Sets the conversion to 1. This basically means the component divides the current and total values loaded and to be loaded. Then it floors them (works out the difference between them) and displays the converted value in the label property
myProgressBar.conversion = "1";

// Set the label to display the word 'loading' followed by the percentage value loaded so far
myProgressBar.label = "LOADING %3%%";

// The direction the progress bar moves when loading
myProgressBar.direction = "right";

// The location of the label that displays the percentage loaded so far
myProgressBar.labelPlacement = "bottom";

// Stops the Playhead in the current frame until the Movie has been preloaded
stop();
}

View Replies !    View Related
How Does A Function Work?
Hallo,
sorry for the dumb question, I am no code geek unfortunately.
The question is: writing

ActionScript Code:
this.onEnterFrame = function()
{
a++;
b++;
}

is like writing

ActionScript Code:
this.onEnterFrame = a++;
this.onEnterFrame = b++;

?

That is, in this case function is solely for the purpose of grouping instructions?

And, if I write

ActionScript Code:
this.onEnterFrame = function()
  {
    a++;
    b++;
    return 1;
  }

The a and b index increasing does still occur? And, where does the '1' value go? That is, where can I fetch it?

Thank you for my basic questions, I think if I want to build a solid flash knowledge, I can't skip these. And the MM flash manual is IMHO very geeky.

m.

View Replies !    View Related
OnLoad Function Don't Work?
On the first frame of my timeline, i do

_root.InstanceName.onLoad = MoveUp;
// MoveUp is a function I created
it didn't work...

but when i do
_root.InstanceName.onRollOver = MoveUp;
it works

why is that...??
maybe, i am not so familiar with onLoad..but it's just a onClipEvent , why is it not workin'??

View Replies !    View Related
Set( ) Function, Doesn't Work Like I Want
I'm trying to make this work. . .

line 1: set(oldscore, "p"+playerno+"score");
line 2: _root.oldsegment = ("p"+playerno+"_"+number);

line 3: set("p"+playerno+"score", (s*number)+oldscore);
line 4: set("p"+playerno+"_"+number, s + _root.oldsegment);

Obviously there I tried a couple different methods to get what i wanted, none of them work *except lines 3 and 4, but those don't technically work because lines 1 and 2 are worthless. So how can i fix lines 1 and 2?

all done in Flash MX
Mark

View Replies !    View Related
Called Function Won't Work
I hope someone can help, this problem is driving me nuts. I'm hoping to make a movie where when you click on a button on the stage movie clips are attached (attachmovie) to empty movie clips on the stage. When you click on another button different movies are attached. I'm hoping to make the clips that are being replaced fade away and have the new clips fade up. The way I'm doing it is to have two buttons on the stage: one sets a global variable to 1 and the other sets it to 0. I have an empty movie clip on the stage with an 'onclipevent (enterframe)'. All it's doing is waiting to detect if the global variable is 0 or 1. So if the variable is 0 the screen will look one way and if the variable is 1 the screen will be modified slightly with new graphics. At the moment all I'm trying to do is to get the graphics to load then fade up. The code in the empty movie clip on the stage:

onClipEvent (enterFrame) {
if (environ == 1) {
_root.showcir ();
environ=3;
trace("environ"+environ);
}
}

When environ == 1 this function in the first frame of the timeline is called:
_global.environ = 0;

function showcir() {
mycir.attachMovie("cir", "cir_b", 0);
}

And of course I have another empty movie clip on the stage with an instance name of: mycir

In this movie clip I have the following code:

onClipEvent (data) {
_root.FadeIn("mycir");
}


The function this is calling is also in the first frame of the timeline:

myFade = setInterval(FadeIn, 15);
function FadeIn(mc) {
if (_root["mc"]._alpha<=100) {
_root["mc"]._alpha += 1;
} else {
_root["mc"]._alpha = 100;
clearInterval(myFade);
}
}

The problem I think is in the way that I'm calling this 'FadeIn' function. The "mycir" in the onClipEvent (data) event handler isn't being passed to the FadeIn function properly and I don't know why - I'm fairly new to Actionscript.

Thanks for your help.

View Replies !    View Related
Geturl Function Won't Work
I have tried everything I can think of to get this stupid getURL function to work on the "HClogo" on frame 50. Can someone please look at it & tell me what I'm doing wrong?

Thanks!

View Replies !    View Related
[F8] Function Doesnt Work
I have a textfield and following code doesnt work on it
please help



function setClear():vioid{
this.text = "";
}


myText.onSetFocus = setClear();

View Replies !    View Related
Function Doesn't Work
Hello, I have been working on a peice of code I made and it isnt working as expected. What it's sopposed to do is play a random movie clip in an array. Why is this not working.

Code:
function playTracers() {
var myTracers:Array = [tracer1,tracer2,tracer3];
var randomTracers:Array = [];
var randomCount:Number = 1;
var r:Number;
for (var i = 0; i<randomCount; i++) {
r = Math.floor(Math.random()*myTracers.length);
randomTracers[randomTracers.length] = myTracers.splice(r, 1);

}return randomTracers;
}playTracers();

Thanks

View Replies !    View Related
Stop Function Will Not Work...
Well like I said my stop funtion will not work. Im making a quick lil albumn that reads from a list and displays thumbnails, then when you click on it, a larger version comes up and you can browse though it.

My problem is that all my actionscript coding is in Script.as and gets included using the #include. The problem is that after the first frame it is suppose to stop. Problem is that it doesnt and just plays on to the end which is frame 5.

In my first frame I have:

#include "Script.as"
stop();

That should work, at least that is what I thought. I've added stop() even into the .as file but still no luck. Any help would be wonderful, thank you.

NeoSpawn

View Replies !    View Related
Make A Function Work Only Once
hello is there a way to make a function only work once reguardless of how many times its called after that one time?
Thanks

View Replies !    View Related
Trace Function Not Work
Hi ,

I am new in flash,

I make a movie clip in main timeline, its name circle. In circle time line, frame1 I put a variable.Then in main time line (_root) I try to trace the variable.The code is :
trace(circle.myVar)

but it doesnt work, output is : undefined.

However if I trace it using button which I put in main time line, the code is :

on(release){
trace(circle.myVar)
}

it works. So what wrong with it,

View Replies !    View Related
Function Wont Work?
Hi i am currently designing a site inwhich all the sections are loaded into an empty movieclip, all the code to control the button within each loaded movieclip and the loading of all movieclips is on the main SWF file, the code is below:


ActionScript Code:
stop();

var blank:Sprite = new Sprite();
holder.addChildAt(blank, 1);

homeBut.addEventListener(MouseEvent.CLICK, loadWeb);

function loadWeb(evt:Event):void {
    trace("web 1 loaded");
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Main.swf");
    var swf:MovieClip;
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

    function imageLoaded(evt:Event):void {
        //removeChild(homeBut);
        holder.addChildAt(pageLoader.content, 1 );
        holder.removeChildAt(2);
        swf = evt.target.content;
       
        var button:MovieClip = swf.paper2.websiteBttn;
        var button2:MovieClip = swf.paper3.vidBttn;
        var button3:MovieClip = swf.homeBttn;
        button.addEventListener(MouseEvent.CLICK, openWeb);
        button2.addEventListener(MouseEvent.CLICK, openVids);
        button3.addEventListener(MouseEvent.CLICK, loadWeb);
    }
    function openWeb(e:Event):void {
        var pageLoader:Loader = new Loader();
        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Web.swf");
        var swf:MovieClip;   
        pageLoader.load(pageURLReq);
        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
       
               
        function imageLoaded(evt:Event):void {
            holder.addChildAt(pageLoader.content, 1 );
            holder.removeChildAt(2);
            swf = evt.target.content;
       
        var button:MovieClip = swf.web2.pacBttn;
        var button3:MovieClip = swf.homeBttn;
        button.addEventListener(MouseEvent.CLICK, openPac);
        button3.addEventListener(MouseEvent.CLICK, loadWeb);
       
        }
        function openPac(evt:MouseEvent):void {
        var pageLoader:Loader = new Loader();
        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Pac Images.swf");
        var swf:MovieClip;   
        pageLoader.load(pageURLReq);
        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
               
        function imageLoaded(evt:Event):void {
            holder.addChildAt(pageLoader.content, 1 );
            holder.removeChildAt(2);
        }
    }
}
function openVids(e:Event):void {
        removeChild(homeBut);
        var pageLoader:Loader = new Loader();
        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Vids.swf");
        pageLoader.load(pageURLReq);
        var swf:MovieClip;
        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
       
               
        function imageLoaded(evt:Event):void {
            holder.addChildAt(pageLoader.content, 1 );
            holder.removeChildAt(2);
            swf = evt.target.content;
            var button4:MovieClip = swf.homeBttn;
            button4.addEventListener(MouseEvent.CLICK, loadWeb2);
           
                 function loadWeb2(evt:Event):void {
       
        swf.R8Vid.ns.pause();
        loadWeb(); 
           
        }
    }
   
    }
}

As you can see in the last function "loadWeb2" which is activated via the ideo section i want the video to stop playing and then the top function of "loadWeb();" to be re-inizialized, but some some reson i cannot run that "loadWeb();" function again i just get this error:


ActionScript Code:
ArgumentError: Error #1063: Argument count mismatch on FlashAS3Portfolio4_fla::MainTimeline/loadWeb(). Expected 1, got 0.
    at MethodInfo-14()

I have been trying to solve the stopping of this video for quite some time now with no success and its really doing my head in now so i would really appreciate any help that can be given thanks.

View Replies !    View Related
Loadmovie Won't Work Within A Function
I'm trying to load an external movie using the loadmovie function. When I do this by placing the code directly on the timeline it works without a problem, however, whenever I try I do it by placing the the loadmovie code in a function and call that function in the next frame it doesn't load. Any ideas why?

This works:


ActionScript Code:
loadMovie("files/movies/movie1.swf","_root.page.firstmovie");

This doesn't work

Frame 1:

ActionScript Code:
function show_movie ()
{
loadMovie("files/movies/movie1.swf","_root.page.firstmovie");
}

Frame 2:

ActionScript Code:
show_movie();

View Replies !    View Related
Trace Function Won't Work But Why?
Okay, I used to use Flash MX+ and AS1 & AS2 alot and am now ramping up to AS 3.0. This sounds simple and dumb, but I cannot for the life of me get the trace() function to work. If I put this into a new .fla:

function hello(){
trace('Hi');
}

hello();

I get nothing. Blank. Nothing in Output or anywhere. Can anyone tell me why? I know trace() should be simple and I used to use it a ton. Please help!

Thanks in advance!

View Replies !    View Related
[MX] Cant Make Function Work
I was reading Kirupa Chinnathambi's function tutorial and I was trying to make my own function, but it's not working! Here it is:


Code:
move = function (finalX, finalY, k) {
cX = this._x;
cY = this._y;
difX = cX-finalX;
difY = cY-finalY;
setProperty(this, _x, cX-(difX/k));
setProperty(this, _y, cY-(difY/k));
}

_root.btn.onRelease = function() {
_root.ball.move ("200", "200", "5");
}
thanks for the help!

View Replies !    View Related
Why Does Trace Function Not Work?
hi,

ive just started actionscripting instead of tweening so be gentle!

i use mx 2004 but i cant get the trace function to work.., here is the code form a kirupa tutorial...

_global.myvar=5;
trace (_global.myvar);

why does this not work? i thought it shud display 5.

ta, Billy

View Replies !    View Related
My Function Wont Work
would someone help me? please? i'm stuck.
I have been trying for hours to figure out how to use this function to change an objects alpha from 1 to 100 to make it fade in.
the object is named 'box',
there is a button which calls the function.

function fadein(){
z = 1;
while ( z < 100 ){
_root.box._alpha = z;
z = z+1;
}
}

why wont this work? any ideas anyone, im a newbie to scripting.

here is the fla http://www.sullyworld.co.uk/flash/fader.fla

View Replies !    View Related
Function Wont Work?
Hi i am currently designing a site inwhich all the sections are loaded into an empty movieclip, all the code to control the button within each loaded movieclip and the loading of all movieclips is on the main SWF file, the code is below:


ActionScript Code:
stop();var blank:Sprite = new Sprite();holder.addChildAt(blank, 1);homeBut.addEventListener(MouseEvent.CLICK, loadWeb);function loadWeb(evt:Event):void {    trace("web 1 loaded");    var pageLoader:Loader = new Loader();    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Main.swf");    var swf:MovieClip;    pageLoader.load(pageURLReq);    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);    function imageLoaded(evt:Event):void {        //removeChild(homeBut);        holder.addChildAt(pageLoader.content, 1 );        holder.removeChildAt(2);        swf = evt.target.content;                var button:MovieClip = swf.paper2.websiteBttn;        var button2:MovieClip = swf.paper3.vidBttn;        var button3:MovieClip = swf.homeBttn;        button.addEventListener(MouseEvent.CLICK, openWeb);        button2.addEventListener(MouseEvent.CLICK, openVids);        button3.addEventListener(MouseEvent.CLICK, loadWeb);    }    function openWeb(e:Event):void {        var pageLoader:Loader = new Loader();        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Web.swf");        var swf:MovieClip;                pageLoader.load(pageURLReq);        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);                                function imageLoaded(evt:Event):void {            holder.addChildAt(pageLoader.content, 1 );            holder.removeChildAt(2);            swf = evt.target.content;                var button:MovieClip = swf.web2.pacBttn;        var button3:MovieClip = swf.homeBttn;        button.addEventListener(MouseEvent.CLICK, openPac);        button3.addEventListener(MouseEvent.CLICK, loadWeb);                }        function openPac(evt:MouseEvent):void {        var pageLoader:Loader = new Loader();        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Pac Images.swf");        var swf:MovieClip;                pageLoader.load(pageURLReq);        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);                        function imageLoaded(evt:Event):void {            holder.addChildAt(pageLoader.content, 1 );            holder.removeChildAt(2);        }    }}function openVids(e:Event):void {        removeChild(homeBut);        var pageLoader:Loader = new Loader();        var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Vids.swf");        pageLoader.load(pageURLReq);        var swf:MovieClip;        pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);                                function imageLoaded(evt:Event):void {            holder.addChildAt(pageLoader.content, 1 );            holder.removeChildAt(2);            swf = evt.target.content;            var button4:MovieClip = swf.homeBttn;            button4.addEventListener(MouseEvent.CLICK, loadWeb2);                             function loadWeb2(evt:Event):void {                swf.R8Vid.ns.pause();        loadWeb();                        }    }        }}


As you can see in the last function "loadWeb2" which is activated via the ideo section i want the video to stop playing and then the top function of "loadWeb();" to be re-inizialized, but some some reson i cannot run that "loadWeb();" function again i just get this error:


ActionScript Code:
ArgumentError: Error #1063: Argument count mismatch on FlashAS3Portfolio4_fla::MainTimeline/loadWeb(). Expected 1, got 0.    at MethodInfo-14()


I have been trying to solve the stopping of this video for quite some time now with no success and its really doing my head in now so i would really appreciate any help that can be given thanks.

View Replies !    View Related
[MX] Cant Make Function Work
I was reading Kirupa Chinnathambi's function tutorial and I was trying to make my own function, but it's not working! Here it is:


Code:
move = function (finalX, finalY, k) {
cX = this._x;
cY = this._y;
difX = cX-finalX;
difY = cY-finalY;
setProperty(this, _x, cX-(difX/k));
setProperty(this, _y, cY-(difY/k));
}

_root.btn.onRelease = function() {
_root.ball.move ("200", "200", "5");
}
thanks for the help!

View Replies !    View Related
Why Does Trace Function Not Work?
hi,

ive just started actionscripting instead of tweening so be gentle!

i use mx 2004 but i cant get the trace function to work.., here is the code form a kirupa tutorial...

_global.myvar=5;
trace (_global.myvar);

why does this not work? i thought it shud display 5.

ta, Billy

View Replies !    View Related
My Function Wont Work
would someone help me? please? i'm stuck.
I have been trying for hours to figure out how to use this function to change an objects alpha from 1 to 100 to make it fade in.
the object is named 'box',
there is a button which calls the function.

function fadein(){
z = 1;
while ( z < 100 ){
_root.box._alpha = z;
z = z+1;
}
}

why wont this work? any ideas anyone, im a newbie to scripting.

here is the fla http://www.sullyworld.co.uk/flash/fader.fla

View Replies !    View Related
Can't Get .onload Function To Work
here's my code

ActionScript Code:
Btest.loadMovie("images/photo1.jpg", 1);
Btest.onLoad = function() {
    trace("onLoad called");
};


Can anyone give any clues?

View Replies !    View Related
Why Does This SetFocus Function Not Work?
This works when I test it locally, but when I upload the .SWF to the server and test it online the cursor is not in the box.....??? Any ideas??? Thanks in advance.....


Selection.setFocus("_root.content_mc.name_txt");

View Replies !    View Related
Trigger Function... Will This Work? (code)
-------------------------------------
function Trigger(type) {
if ((type == "door")) {
}
if ((type == "npc")) {
}
if ((type == "object")) {
}
}

-------------------------------------
Im trying to create a function that I can insert
wherever I need a trigger in my code. I want
to use type as the type of trigger... so when I call
the function I want to do something like this:
-------------------------------------
function Trigger(door);
-------------------------------------
will this work?

Regards,
Tyler

PS (why dont I just try it? Well that would involve a lot of work
and I want to know If i start working on this function if it will work when its done.)

View Replies !    View Related
Function Call From String (cannot Get It To Work)
I have got this small problem. For example I ve got the following code:

function test()
{
trace("it works");
}

y = "test()"; // y is a string containing the name of the test() function

Now I want to call the function test from the string y.

test(); //does work
eval(y); //does not work

x = test();
x; //does work

How can I call the function test() from the string y???

Thank you in advance,

GD

View Replies !    View Related
Seeminly Simple Function Does Not Work
Why doesn't this work?!


Code:
cdate = new Date();
//creates a new date object
chour = cdate.getHours();
cmin = cdate.getMinutes();
csec = cdate.getSeconds();
//gets dates
function addzero(me) {
if (me<10) {
me = "0"+me;
}
}
//the function that actually checks for two digits
addzero(chour);
addzero(cmin);
addzero(csec);
//makes sure there is always two digits
The above code works if the function is done individually (not as a part of a function), but as soon as I put it in the function, it doesnt work. It's simply supposed to add a "0" to any number below 10 (the number being h/m/s of a clock).
What am I doing wrong?


sina
london

View Replies !    View Related
Grrr... How Do I Make This Function Work?
Hi, tis me again ... I have the following function :
code:
function Spray() {

for (i=0; i<=10; i++) {
duplicateMovieClip(particle, particle+i, i);
scale = random(150)+50;
yVel = random(7)+1;
xVel = random(20)-10;
_root.particle._xscale = scale;
_root.particle._yscale = scale;
peak = 50;
drop = false;
_root.particle._x += xVel;
//above here is what needs to initilize, and below is what need to constantly reapply
if (!drop) {
_root.particle._y -= yVel;
trace("systems nominal");
if (_root.particle._y<=peak) {
drop = true;
}
}
if (drop) {
_root.particle._y += yVel;
trace("la la la");
}
}
}

Spray();


anyway, I tried a couple of ways to make the veriables initialize diffrently for each duplicate, and then constantly applaying the bit of code that makes the particle go up and down, and compact all this in a single function.
can anyone tell me how to do this?
thanks in advance.

View Replies !    View Related
Why Doesn't This Fading Function Work?
I wrote this function hoping to fade an mc in and out on rollover of a btn. The mc's instance name is "panel"... I just want to fade the panel mc in and out. here's the script:

Code:
this.but1.onRollOver = function() {
this.panel.clientTxt.text = "TEXT HERE....";
this.panel.yearTxt.text = "YEAR GOES HERE";
this.panel.descTxt.text = "Text and more text, text text text, blah blah blah blah blah blah...";
startFadeIn();
};
//---------------------
this.but1.onRollOut = function() {
startFadeOut();
};
//---------------------
//---------------------
// Holds the interval ID, used to remove the interval
var intervalID;
// Interval in ms (50ms equals 1/20 seconds)
var interval = 50;
// Speed of fade, bigger number -> faster fading
var fadingPower = 8;
// Start the fading
//---------------------
function startFadeIn() {
intervalID = setInterval(doFadeIn, interval);
}
//---------------------
function startFadeOut() {
intervalID = setInterval(doFadeOut, interval);
}
//---------------------
// Function is called when the fading happens
function doFadeIn() {
if (this._alpha<100) {
this._alpha += fadingPower;
} else {
clearInterval(intervalID);
}
}
//-------------------
function doFadeOut() {
if (this._alpha>0) {
this._alpha -= fadingPower;
} else {
clearInterval(intervalID);
}
}
any ideas what i did wrong?... or a better way to accomplish the same thing? Any help would be appreciated. TIA

View Replies !    View Related
[Problem]: Else Function? Should Work Fine
Ok so I have this game, and the enemy sits on the left side of the screen and goes up and down. I do this by deltaY *= -1 wich is set to 10 ((The speed of the enemy ship)). The problem is, is that im trying to get him to stop if his y position is equal to the ship's why position. This is the code I have on the enemy ship, it should work perfect I have no idea what the problem is!


Quote:




onClipEvent(load) {
deltaY=10;
}
onClipEvent(enterFrame) {

//THE PROBLEM STARTS HERE
if(this._y==_root.ship._y) {
trace("shot");
} else {
this._y+=deltaY;
}
//THE PROBLEM ENDS HERE

if(this._y<=50) {
this.deltaY *= -1;
}
if(this._y>=390) {
this.deltaY *=-1;
}
}




I dont know if it makes a difference, but im using flash 8.

Thanks
-Joey-

View Replies !    View Related
Why Doesn't This (simple) Function Work?
Hi Guy, I'm missing something obvious - I try hard to code but often get the fundamental stuff wrong.

I am trying to remove having to fully code all my buttons with a lot of code, move that code into a main function on the root timeline, and then call it with parameters within the button. The code works before I convert it into a function when I target each button and use non-generic code without the function.

Here is the function on the main timeline that doesn't work (this is in Flash 8):

function doButton(
butLoc,butTweenLoc,txtTweenLoc,
txtTitle,txtColor,
releaseLabel
)
{
import mx.transitions.easing.*;
import mx.transitions.Tween;

butLoc.title_mc.title_txt.text = "Home";
butLoc.title_mc.title_txt.textColor = 0x00ffff;

butLoc.onRelease = function() {gotoAndPlay("home");};

butLoc.onRollOver = function() {
bgTween = new Tween(butTweenLoc, "_alpha", Regular.easeOut, butTweenLoc._alpha, 50, .5, true);
titleTween = new Tween(txtTweenLoc, "_x", Regular.easeOut, txtTweenLoc._x, 15, .2, true);};

butLoc.onRollOut = function() {
bgTween = new Tween(butTweenLoc, "_alpha", Regular.easeOut, butTweenLoc._alpha, 100, .5, true);
titleTween = new Tween(txtTweenLoc, "_x", Regular.easeOut, txtTweenLoc._x, 5, .2, true);};
};

And here is what I put around (not on the button, but in the same frame number):

butLoc="this.gal0GoHome1"
butTweenLoc="this.bg_mc"
txtTweenLoc="this.title_mc"
txtTitle="Home";
txtColor="0x00ffff";
releaseLabel="home";
doButton();



FWIW this works but I need the full code for each button instance:

import mx.transitions.easing.*;
import mx.transitions.Tween;

this.home0.title_mc.title_txt.text = "Galleries";
this.home0.title_mc.title_txt.textColor = 0x00ffff;
this.home0.onRelease = function() {gotoAndPlay("galleries");};
this.home0.onRollOver = function() {
bgTween = new Tween(this.bg_mc, "_alpha", Regular.easeOut, this.bg_mc._alpha, 50, .5, true);
titleTween = new Tween(this.title_mc, "_x", Regular.easeOut, this.title_mc._x, 15, .2, true);};
this.home0.onRollOut = function() {
bgTween = new Tween(this.bg_mc, "_alpha", Regular.easeOut, this.bg_mc._alpha, 100, .5, true);
titleTween = new Tween(this.title_mc, "_x", Regular.easeOut, this.title_mc._x, 5, .2, true);};

Any help with my stupidity here would be greatly appreciated...

Shawn

View Replies !    View Related
[Fuse] Function Agrument Does Not Work.
Hello

I have this function i would like to use on my buttons.

To save lines of code, i wanna use arguments. Here is my code:


Code:
menuText1.btnNews._alpha = 0;


menuText1.btnNews.onRollOver = function(){
rollOverBtn ("menuText1.btnNews");
}
menuText1.btnNews.onRollOut = function(){
rollOutBtn ("menuText1.btnNews");
}
menuText1.btnNews.onPress = function(){
getURL("mailto:h75@vmgcomputers.com?subject=");
}

//button functions
function rollOverBtn (targetMc){
var f:Fuse = new Fuse();
f.push({target:"+targetMC+",alpha:100,seconds:0.2,ease:'easeInOutCubic'});
f.start();
trace (targetMc +" is active");
}
function rollOutBtn (targetMc){
var f:Fuse = new Fuse();
f.push({target:"+targetMC+",alpha:0,seconds:0.5,ease:'easeInOutCubic'});
f.start();
}
When i roll over my button and fire the function with the argument "menuText1.btnNews" fuse does not "find" this! When i trance "targetMc" it works fine!

Why cant fuse hande my argument?

Cheers

Richard

View Replies !    View Related
Date Function Doesn't Work :( Again
could anyone help me out of this
I've made 6 clocks like this, each of them show 1 specific time of 1 specific area in the world.

but dont know why date function doesnt work. they all display 1 date only, which is Jun 26

Thank you
P.


// I couldnt attach the file, sorry.....

stop();
my_time_function = function(message){
now = new Date();
nMonth = now.getUTCMonth();
thisDate = now.getUTCDate();
thisYear = now.getUTCFullYear();
nHour = now.getUTCHours()+7; //get GMT+7 Hanoi
nMinutes = now.getUTCMinutes();
if(nMinutes < 10){
nMinutes = "0"+nMinutes;
}
nSec = now.getUTCSeconds();
if(nSec < 10){
nSec = "0"+nSec;
}
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
my_date.text = months[nMonth]+"-"+thisDate + ", " +thisYear;

};

time = setInterval(my_time_function, 1000);

View Replies !    View Related
ScrollBar Can't Work Within Onload Function()
I suceed in populating my holder_mc empty movie clip with my xml. Within my xml file, i got all my attribute and i also suceeded acessing them into my flash.

Now the problem is i got to make a scrollbar that will scroll my holder_mc which is popluated with my xml. I realise that i can sucessfully populate my holder_mc when not within the xml.onLoad = function(). But when within, my contentHeight is not consistant.

I try to explain but i guess it might be hard to understand what i mean , so i upload my file and let you guys see.

The first one is one that have its contentHeight inconsistent. The second(2ndMM_content.fla) is one that is populated not within the xml.onLoad = function.

Please help, head exploding!

View Replies !    View Related
Return Value Of Function After EVENT Does Not Work
Hi again,

I made a game and put it into one function. And i want the score given back to my main program: (here only as a trace)


ActionScript Code:
trace(MyGame());

and this is my game (not original... is too long to insert here)


ActionScript Code:
function MyGame ():int {

  ...

  var example:int;

  var myTimer:Timer = new Timer(10, 1000);
  myTimer.addEventListener(TimerEvent.TIMER, fu);
  myTimer.start();

  fu(){
    increases example++ a few times;

    trace("test");
  }

return example;
}

now let me explain: when the "fu" function starts, everthing is fine, but when the Timer ends, the "fu" functions will not be left so that the "MyGame" functions does not return the "example" integer...

When i insert a trace with a text, ("test") the trace is printed, but the function will not be left... so i never get my example-int back out of the MyGame function....

why???

View Replies !    View Related
Getting Sample Imagegallery To Work As A Function
I'm trying to use flash's sample image gallery in my own page, but instead of it coming up at the start, I want it to come up when the user presses a button. Here's the code;

function imageGallery()
{

trace("called it");


//Begin Image gallery code by macromedia
//****************************************************************************
//Copyright (C) 2005 Macromedia, Inc. All Rights Reserved.
//The following is Sample Code and is subject to all restrictions on
//such code as contained in the End User License Agreement accompanying
//this product.
//****************************************************************************

/*
Dynamic Movie Clips Example
The Flash gallery is created at runtime from an XML file.
Images are scaled to 20% of their original size,
but you can see the full size image by clicking an image and keeping the mouse button pressed.
*/

// Import the transitions classes so you can add a fading effect when the images load to the Stage.
import mx.transitions.*;

// Set the starting X and Y positions for the gallery images.
_global.thisX = 30;
_global.thisY = 70;

/* Set static values for the Stage's width and height.
Using Stage.width and Stage.height within the code results in
strangely positioned full images when testing in the Flash environment
(but the problem doesn't exist when published to a SWF file). */
_global.stageWidth = 600;
_global.stageHeight = 400;


// Create and configure the XML instance which is used to load the list of gallery images on the fly.
var gallery_xml:XML = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success:Boolean) {
try {
/* if you are able to successfully load and parse the gallery from a remote XML file,
parse out the image names and add them to an array. */
if (success) {
var images:Array = this.firstChild.childNodes;
var gallery_array:Array = new Array();
trace("loaded");
for (var i = 0; i<images.length; i++) {
gallery_array.push({src:images.firstChild.nodeValue});

}
/* call the displayGallery function which handles loading in each
of the gallery images and placing them on the Stage. */
displayGallery(gallery_array);
} else {
throw new Error("Unable to parse XML");
}
} catch (e_err:Error) {
trace(e_err.message);
} finally {
delete this;
}
};

// load the gallery.xml file from the current directory.
gallery_xml.load("gallery_tween.xml");

/* create a function which loops through the images in an array,
and creates new movie clips on the Stage. */
function displayGallery(gallery_array:Array) {
var galleryLength:Number = gallery_array.length;
// loop through each of the images in the gallery_array.
for (var i = 0; i<galleryLength; i++) {
/* create a movie clip instance which holds the image. We'll also set a variable,
thisMC, which is an alias to the movie clip instance. */
var thisMC:MovieClip = this.createEmptyMovieClip("image"+i+"_mc", i);

/* load the current image source into the new movie clip instance,
using the MovieClipLoader class. */
trace(gallery_array.src);

var good:Boolean = mcLoader_mcl.loadClip(gallery_array.src, thisMC);
trace(good);
// attach the preloader symbol from the Library onto the Stage.
preloaderMC = this.attachMovie("preloader_mc", "preloader"+i+"_mc", 5000+i);

/* set the preloader's bar_mc's _xscale property to 0%
and set a default value in the progress bars text field. */
preloaderMC.bar_mc._xscale = 0;
preloaderMC.progress_txt.text = "0%";

// set the _x and _y coordinates of the new movie clip.
thisMC._x = _global.thisX;
thisMC._y = _global.thisY;

// set the position of the image preloader.
preloaderMC._x = _global.thisX;
preloaderMC._y = _global.thisY+20;

// if you've displayed 5 columns of images, start a new row.
if ((i+1)%5 == 0) {
// reset the X and Y positions
_global.thisX = 20;
_global.thisY += 80;
} else {
_global.thisX += 80+20;
}
}
}

// define the MovieClipLoader instance and MovieClipLoader listener Object.
var mcLoader_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadStart = function() {
trace("onloadstart");
};

// while the content is preloading, modify the width of the progress bar.
mclListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
var pctLoaded:Number = Math.round(loadedBytes/totalBytes*100);
trace("loading");
// create a shortcut for the path to the preloader movie clip.
var preloaderMC = target_mc._parent["preloader"+target_mc.getDepth()+"_mc"];
preloaderMC.bar_mc._xscale = pctLoaded;
preloaderMC.progress_txt.text = pctLoaded+"%";
};

// when the onLoadInit event is thrown, you're free to position the instances
mclListener.onLoadInit = function(evt:MovieClip) {
evt._parent["preloader"+evt.getDepth()+"_mc"].removeMovieClip();
/* set local variables for the target movie clip's width and height,
and the desired settings for the image stroke and border. */

var thisWidth:Number = evt._width;
var thisHeight:Number = evt._height;
var borderWidth:Number = 2;
var marginWidth:Number = 8;
evt.scale = 20;
// draw a white rectangle with a black stroke around the images.
evt.lineStyle(borderWidth, 0x000000, 100);
evt.beginFill(0xFFFFFF, 100);
evt.moveTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.endFill();

/* scale the target movie clip so it appears as a thumbnail.
This allows users to quickly view a full image without downloading it every time,
but unfortunaltey also causes a large initial download. */
evt._xscale = evt.scale;
evt._yscale = evt.scale;
// rotate the current image (and borders) anywyhere from -5 degrees to +5 degrees.
//evt._rotation = Math.round(Math.random()*-10)+5;
/* when the target_mc movie clip instance is pressed, begin to drag the current movie clip
and set some temporary variables so once you are finished rescaling and positioning
the full image, you can return the instance to its original position. */
evt.onPress = function() {
// start dragging the current clip.
this.startDrag();
/* set the _xscale and _yscale properties back to 100% so the image appears full sized.
You're also storing the original X and Y coordinates so you can return the image where you found it. */
this._xscale = 100;
this._yscale = 100;
this.origX = this._x;
this.origY = this._y;
// find the depth of the current movie clip, and store it within the movie clip.
this.origDepth = this.getDepth();
/* :TRICKY: swap the depth of the current movie clip, with the next highest movie clip of the _parent.
Effectively this makes the current movie clip the top of the "stack". */
this.swapDepths(this._parent.getNextHighestDepth());
// try and center the current movie clip on the Stage.
this._x = (_global.stageWidth-evt._width+30)/2;
this._y = (_global.stageHeight-evt._height+30)/2;
// apply a transition to the movie clip which makes the movie clip flicker for a split second.
//mx.transitions.TransitionManager.start(this, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty});
};
/* when the movie clip instance is released, stop dragging the movie clip.
Reset the _xscale and _yscale properties as well as the _x and _y coordinates. */
evt.onRelease = function() {
this.stopDrag();
this._xscale = this.scale;
this._yscale = this.scale;
this._x = this.origX;
this._y = this.origY;
};
// if the mouse cursor was released outside of the movie clip, call the onRelease handler.
evt.onReleaseOutside = evt.onRelease;
}
mcLoader_mcl.addListener(mclListener);
mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String, status:Number) {
trace("Error loading image: " + errorCode + " [" + status + "]");
};

}


I've added a few trace statements as you can see to try and narrow down the problem and it seems that it rests in the line
var good:Boolean = mcLoader_mcl.loadClip(gallery_array.src, thisMC);
in the displayGallery function since good always returns false. I have a sneaking suspicion that it has something to do with loadClip not working unless the url specified is relative to the movie at level 0. Unfortunately I am somewhat new to flash and I don't really understand what that means.
Any help would be appreciated.
Thanks
Nick

View Replies !    View Related
Function Fails To Work After One Execution
Hi,
I have made a flash file that doesn't need mouse to use. This is the code for the movement by arrow keys:
[as]
var velden:Array = new Array(anaam_txt, vnaam_txt, straat_txt, nr_txt, pc_txt, plaats_txt, email_txt, v1_ja, v2_ja, v3_ja, submit);
var selectionCounter:Number = 0;
Selection.setFocus(velden[selectionCounter]);
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DOWN) && selectionCounter<10) {
selectionCounter++;
Selection.setFocus(velden[selectionCounter]);
} else if (Key.isDown(Key.UP) && selectionCounter>0) {
selectionCounter--;
Selection.setFocus(velden[selectionCounter]);
}
};
Key.addListener(keyListener);
[/as]
However the first time it works perfectly.. the second time he skips when navigating trough my textfields.. I tried deleting some vars if clicked on OK but it doens't help? HELP! I need to put this online by tommorow!!
I tried delteing this
[as]
delete keyListener;
delete focusListener;
delete selectionCounter;
delete velden;
[/as]
Thnx
Seba

PS Complete code attached







Attach Code

stop();
txtkader1_mc._visible = false;
txtkader2_mc._visible = false;
txtkader3_mc._visible = false;
a1._visible = false;
a2._visible = false;
a3._visible = false;
a4._visible = false;
/*anaam_txt.tabIndex = 1;
vnaam_txt.tabIndex = 2;
straat_txt.tabIndex = 3;
nr_txt.tabIndex = 4;
pc_txt.tabIndex = 5;
plaats_txt.tabIndex = 6;
email_txt.tabIndex = 7;
//v1_nee.tabIndex = 8;
v1_ja.tabIndex = 8;
//v2_nee.tabIndex = 10;
v2_ja.tabIndex = 9;
//v3_nee.tabIndex = 12;
v3_ja.tabIndex = 10;
//v4_nee.tabIndex = 14;
//v4_ja.tabIndex = 11;
submit.tabIndex = 11;*/
stat = "Gebruik de pijltjes om te navigeren!<br>Utiliser les flêches pour naviguer!";


border1 = 0x000000;
border2 = 0xFF0000;
bgKleur1 = 0xFFFFFF;
bgKleur2 = 0xFFFFFF;
fontKleur1 = 0x000000;
fontKleur2 = 0x000000;

function kleurkill(wat) {
wat.onKillFocus = function() {
wat.borderColor = border1;
wat.backgroundColor = bgKleur1;
wat.textColor = fontKleur1;
};
}

function kleurset(wat1) {
wat1.onSetFocus = function() {
wat1.borderColor = border2;
wat1.backgroundColor = bgKleur2;
wat1.textColor = fontKleur2;
};
}
v1_ja.setStyle("themeColor","haloOrange");
v2_ja.setStyle("themeColor","haloOrange");
v3_ja.setStyle("themeColor","haloOrange");
v4_ja.setStyle("themeColor","haloOrange");

submit.setRGB(0xFF0000);
kleurkill(anaam_txt);
kleurset(anaam_txt);
kleurkill(vnaam_txt);
kleurset(vnaam_txt);
kleurkill(straat_txt);
kleurset(straat_txt);
kleurkill(nr_txt);
kleurset(nr_txt);
kleurkill(pc_txt);
kleurset(pc_txt);
kleurkill(plaats_txt);
kleurset(plaats_txt);
kleurkill(email_txt);
kleurset(email_txt);

var velden:Array = new Array(anaam_txt, vnaam_txt, straat_txt, nr_txt, pc_txt, plaats_txt, email_txt, v1_ja, v2_ja, v3_ja, submit);
var selectionCounter:Number = 0;
Selection.setFocus(velden[selectionCounter]);
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DOWN) && selectionCounter<10) {
selectionCounter++;
Selection.setFocus(velden[selectionCounter]);
} else if (Key.isDown(Key.UP) && selectionCounter>0) {
selectionCounter--;
Selection.setFocus(velden[selectionCounter]);
}
};
Key.addListener(keyListener);

var focusListener:Object = new Object();
focusListener.onSetFocus = function(oudeFocus, nieuweFocus) {
trace("oudeFocus: "+oudeFocus+", "+"nieuweFocus :"+nieuweFocus);
if (nieuweFocus == submit) {
stat = "Druk op spatiebalk om te bewaren.<br><i>Presser barre d'espacement pour sauvegarder.</i>";
txtkader1_mc._visible = false;
txtkader2_mc._visible = false;
txtkader3_mc._visible = false;
} else {
if (nieuweFocus == null) {
stat = "U kan enkel nog naar boven voor wijzigingen.<br><i>Vous ppuvez seulement monter avec les touches flêches pour changer.</i>";
} else {
stat = "Gebruik de pijltjes om te navigeren!<br><i>Utiliser les flêches pour naviguer!</i>";
}
if (nieuweFocus == v1_ja) {
stat = "Druk op spatiebalk om aan te vinken<br><i>Presser barre d'espacement pour marquer.</i>";
txtkader1_mc._visible = true;
} else {
txtkader1_mc._visible = false;
}
if (nieuweFocus == v2_ja) {
stat = "Druk op spatiebalk om aan te vinken<br><i>Presser barre d'espacement pour marquer.</i>";
txtkader2_mc._visible = true;
} else {
txtkader2_mc._visible = false;
}
if (nieuweFocus == v3_ja) {
stat = "Druk op spatiebalk om aan te vinken<br><i>Presser barre d'espacement pour marquer.</i>";
txtkader3_mc._visible = true;
} else {
txtkader3_mc._visible = false;
}
}
};
Selection.addListener(focusListener);


submit.onPress = function() {
var emailadres:String = email;
var v1:String;
var v2:String;
var v3:String;
var v4:String;
if (vnaam == null || vnaam == "") {
stat = "Geef uw voornaam in aub.<br><i>Votre prénom svp?</i>";
} else if (anaam == null || anaam == "") {
stat = "Geef uw achternaam in aub.<br>Votre nom svp?";
} else if (straat == null || straat == "") {
stat = "Geef uw straat in aub.<br>Votre rue svp?";
} else if (nr == null || nr == "") {
stat = "Geef uw straatnr in aub.<br>Votre numéro de rue svp?";
} else if (postcode == null || postcode == "") {
stat = "Geef uw postcode in aub.<br>Votre code postal svp?";
} else if (plaats == null || plaats == "") {
stat = "Geef uw woonplaats in aub.<br>Votre ville svp?";
} else if ((emailadres.indexOf('@') == -1) || (emailadres.indexOf('.') == -1)) {
stat = "Geef uw emailadres in aub.<br>Votre Email svp?";
} else {
if (v1_ja.selected == true) {
a1._visible = false;
a1.text = "ja";
var anta:String = a1.text;
} else {
a1._visible = false;
a1.text = "nee";
var anta:String = a1.text;
}
if (v2_ja.selected == true) {
a2._visible = false;
a2.text = "ja";
var antb:String = a2.text;
} else {
a2._visible = false;
a2.text = "nee";
var antb:String = a2.text;
}
if (v3_ja.selected == true) {
a3._visible = false;
a3.text = "ja";
var antc:String = a3.text;
} else {
a3._visible = false;
a3.text = "nee";
var antc:String = a3.text;
}
if (v4_ja.selected == true) {
a4._visible = false;
a4.text = "ja";
var antd:String = a4.text;
} else {
a4._visible = false;
a4.text = "nee";
var antd:String = a4.text;
}
//loadVariablesNum("processForm.asp",0,"post");
delete keyListener;
delete focusListener;
delete selectionCounter;
delete velden;
anaam = "";
vnaam = "";
email = "";
straat = "";
nr = "";
postcode = "";
plaats = "";
v1_nee.selected = true;
v1_ja.selected = false;
v2_nee.selected = true;
v2_ja.selected = false;
v3_nee.selected = true;
v3_ja.selected = false;
v4_nee.selected = true;
v4_ja.selected = false;
gotoAndPlay(14);
}
};
Selection.setFocus("anaam_txt");
//var lengte:Number = anaam_txt.text.length;
//Selection.setSelection(lengte,lengte);

View Replies !    View Related
Function Doesnt Work The 2nd Time
this is the xml




code:
Code:

<?xml version="1.0" ?>
- <images>
- <Branch name="1">
<Leaf text="bilder/1/ersie.jpg" url="bilder/1/ersie.jpg" width="300" height="500" />
<Leaf text="bilder/1/gbook.jpg" url="bilder/1/gbook.jpg" width="100" height="19" />
<Leaf text="bilder/1/map.jpg" url="bilder/1/map.jpg" width="300" height="500" />
<Leaf text="bilder/1/minime.jpg" url="bilder/1/minime.jpg" width="300" height="500" />
<Leaf text="bilder/1/ztourist.jpg" url="bilder/1/ztourist.jpg" width="300" height="500" />
</Branch>
- <Branch name="2">
<Leaf text="bilder/2/ersie.jpg" url="bilder/2/ersie.jpg" width="300" height="500" />
<Leaf text="bilder/2/map.jpg" url="bilder/2/map.jpg" width="300" height="500" />
<Leaf text="bilder/2/minime.jpg" url="bilder/2/minime.jpg" width="300" height="500" />
<Leaf text="bilder/2/tourist.jpg" url="bilder/2/tourist.jpg" width="300" height="500" />
</Branch>
- <Branch name="3">
<Leaf text="bilder/3/ersie.jpg" url="bilder/3/ersie.jpg" width="300" height="500" />
<Leaf text="bilder/3/gbook.jpg" url="bilder/3/gbook.jpg" width="100" height="19" />
<Leaf text="bilder/3/map.jpg" url="bilder/3/map.jpg" width="300" height="500" />
<Leaf text="bilder/3/minime.jpg" url="bilder/3/minime.jpg" width="300" height="500" />
</Branch>
</images>






this my main-as




code:
Code:


//include tween extension
#include "lmc_tween.as"
//
_global.SITE = "http://archiv/sites/flash/";
var data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
if (success) {
trace("done loading");
makeArray(this);
slider(Menu_array);
} else {
trace("error");
}
};
function makeArray(_xml) {
if (!_global.pic_array) {
_global.pic_array = new Array();
}
this._xml = _xml;
var rootNode = _xml.firstChild;
//bilderchanger
var theNode = rootNode.childNodes;
var len = theNode.length;
var theSubNode = rootNode.firstChild.childNodes;
//array für bilderchanger
_global.Menu_array = new Array(len);
_global.Active_array = new Array(len);
//array für jedes unterbild
for (i=0; i<Menu_array.length; i++) {
var sublen = theNode[i].childNodes.length;
Menu_array[i] = new Array(sublen);
//array für die daten jedes bildes
for (j=0; j<Menu_array[i].length; j++) {
Menu_array[i][j] = new Array(3);
}
}
//fertiges array durcharbeiten
// anzahl der bilderchanger
var tmp_xpos = "0";
for (i=0; i<=Menu_array.length; i++) {
//erzeuge unterbilder
for (j=0; j<theNode[i].childNodes.length; j++) {
var cur = _level0.attachMovie("square", "sq"+i+"_"+j+"_mc", _level0.getNextHighestDepth(), {_y:ypos+50*j});
loadMovie(String(SITE+theNode[i].childNodes[j].attributes.url), cur);
//pos and scale
var cur_xpos = tmp_xpos;
cur._x = cur_xpos;
//erste bild zeigen rest nicht ;
if (j == 1) {
//cur._alpha = "100";
Active_array[i] = cur;
} else {
//cur._alpha = "0";
}
//menu array erstellen
Menu_array[i][j]['path'] = String(SITE+theNode[i].childNodes[j].attributes.url);
Menu_array[i][j]['mcname'] = cur;
Menu_array[i][j]['xscale'] = String(theNode[i].childNodes[j].attributes.width);
}
tmp_xpos = Number(tmp_xpos)+Number(spacer)+Number(Menu_array[i][0]['xscale']);
//trace(Number(tmp_xpos) + Number(spacer) + Number(Menu_array[i][0]['xscale']));
}
}
function callback() {
trace("callback_tween_out");
}
function acallback() {
trace("callback_tween_in");
}
function slider(array) {
//random picture group
changer_num_1 = random(array.length);
//fadeout old picture
fade_out_mc = Active_array[changer_num_1];
trace("fadeout-->"+fade_out_mc);
fade_out_mc.tween("_alpha", 0, 4, "linear", 0, callback);
//set the active pic of a pic group and show it
tween_in_mc = array[changer_num_1][random(array[changer_num_1].length)]['mcname'];
//set the new active array of a group
Active_array[changer_num_1] = tween_in_mc;
//fadein the new picture
trace("fadein-->"+tween_in_mc);
tween_in_mc.tween("_alpha", 100, 4, "linear", 1, acallback);
}
// alle 2000 ms einen bildwechsels durchführen
setInterval(function () {
slider(Menu_array);
}, 10000);
//
data_xml.load(SITE+"directory.php");





Homepage and main discussion thread of this tween extension http://proto.layer51.com/d.aspx?f=1142

want i would like to do ?
the picture of the xml should be shown in group.(in this case 3).
in each group are x subpictures


if the user loads the script, the three group should be shown with one picture (active), after some seconds one of the group change the subpicture by using the "alpha_to" prototype.


the problem is that i can see 3 pictures but nothing happens (no change)

thx

View Replies !    View Related
Does The StartDrag Function Not Work In MX2K4?
I've been trying to get the hover caption thing to work for a while. I can get it to appear and re-appear, but it won't follow the mouse. Is there a conflict with the startDrag function from MX with the new MX2004 version?


Otherwise anyone have any hints?

View Replies !    View Related
UnloadClip Function Doesn't Work
this.dots_btn.onRelease = function() {
myMCL.loadClip("dots/interiordots.swf",1);
}

this.dots_btn.onPress = function() {
myMCL.unloadClip("homeimage.swf");
}



I have this on frame 10. THe loadclip function works, but the unloadclip function does not. Is this not how unloadclip works, or how you are suppose to right it? The button is on the main stage and the "homeimage.swf" was loaded on frame 1 into level 2.

THANKS!!!

View Replies !    View Related
GetURL Function Doesn't Work
Hi I'm trying to launch a new browser window from flash to open up a pdf document. This is the script I am currently using:

on(release){
getURL("pdfs\timetable.pdf", _blank);
}


This works fine in IE but for some reason does not work in Mozilla Firefox (which I'll need it to work in as well). Does anyone know a solution to this?

Thank You

View Replies !    View Related
Why Doesn't This Simple Function Work?
Check out this simple attachment. You got your as
my_btn.onRelease = function() {
trace("It worked");
}

The Instance Name on the button is my_btn. Ok, why does it work if the as is on the same frame as the button but not if you move the button over a frame. I thought the point of using a function was that you only need to write it once. I don't want to put this function on every frame where the button is located.

What am I missing here?

View Replies !    View Related
Why Would F8 Function Work Locally But Not Remotely?
Does anyone know why a f8 blur or get pixel would work in a swf in an html page locally but when uploaded and viewed online the functions dont work?

this is happening with a couple of projects at the moment?? I have flash player 9 is installed in firefox & safari.

thanks

View Replies !    View Related
Why Doesn't This Function Call Work ?
a = true;
if (a) {
trace("a is true");

function ab () {
trace("fun ab()");
};

};

ab();

//
I really want to learn why ab() does not trace "fun ab()".
Even when you call ab from a button click, it does not trace.
Simply Why ?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved