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








Check Code


I keep getting errors in my code, but I can't figure out whats wrong.

This is the message I get in the output box:

Code:
Scene=Scene 1, Layer=Layer 22, Frame=124: Line 32: ';' expected
If (success) {

Scene=Scene 1, Layer=Layer 22, Frame=124: Line 34: 'else' encountered without matching 'if'
} else {
Here is my code:

ActionScript Code:
// //////////////////////// LOAD ID txt FILE //////////////////////////////////
MyLoadCID = new loadVars();
MyLoadCID.load("CdTypes/ID.txt");
MyLoadCID.onLoad = function(success) {
    if (success) {
        trace("done loading");
        FDR = MyLoadCID.ID;
        ID.text = FDR;
        // trace(FDR)
        info(FDR);
    } else {
        trace("not loaded");
    }
};
// ////////////////////////// START FUNCTION INFO ////////////////////////////////
function info(myVar) {
    MyLoadVars = new loadVars();
    MyLoadVars.load("CdTypes/"+myVar+"Campaign.txt", "mp3");
    MyLoadVars.onLoad = function(success) {
        if (success) {
            trace("done loading");
            // Name.name.text = this.Name0;
            mp3.mp3name.text = this.mp3File0;
        } else {
            trace("not loaded");
        }
    }
// load mp3 sound file
    mySound = new Sound();
    mySound.loadSound("TestVB/" + this.mp3File0 + "", true);
    mySound.onLoad = function(success) {
        If (success)  {
            trace("mp3 loaded");    
        } else {
            trace("mp3 failed");
        }
    };
};




ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 08-01-2003, 01:15 PM


View Complete Forum Thread with Replies

Sponsored Links:

[F8] Loading And Unloading External SWF Code Issues, Code Check Please
Okay, I'm still clumsy with AS and I'm having problems loading and unloading external SWFs. I have SWFs created by others in Captivate that need to be controlled by a main menu. I created the menu and buttons and have been trying to code it so that with the button click, the appropriate external SWF loads in an empty movie clip, plays, and then closes at the final frame and returns to the menu. So far, I can get it to load, but then I'm stuck as I'm not sure what I'm missing as far as it reading the frame numbers.

Here's the code I've written. I can't seem to get my idea for the onEnterFrame function checking the frames to work.

What am I missing? Can anyone offer any suggestions or guidance? Thanks!


Code:
this.createEmptyMovieClip("clip1", 1);

myfirst_btn.onRelease = function() {
clip1.loadMovie("externalswf1.swf");
}

mysecond_btn.onRelease = function() {
clip1.loadMovie("externalswf2.swf");
}

mythird_btn.onRelease = function() {
clip1.loadMovie("externalswf3.swf");
}

clip1.onEnterFrame = function() {
if (clip1._currentframe == clip1._totalframes) {
// remove move clip1 and return to menu
clip1.removeMovieClip();
}
}

View Replies !    View Related
[F8] Help. Integrate Cpu Check Code With Preloader Code
Hi, guys!

I was looking for a way to do a cpu check over the userīs computer and then, based on the userīs cpu speed, redirect his browser towards one of two different versions of the same flash movie (letīs say, a "light" one without effects and a "full" one with all the effects). Iīve already got a fine working preloader, and Iīve found a nice cpu check code here in this forum. The problem now is that I am not able to put them together. Something like, after a mouseclick, perform the cpu check and after that load a movie based on the previous cpu check...

I am posting my fla and the original cpu check fla that Iīve found here to show what Iīve got so far.

Thanks in advance!

View Replies !    View Related
Can Check This Code For Me Please?
Hello chaps.

I am trying to get a flash swf embedded in an html document to pull up a new html page (e.g. mypage.htm) and specify the browser dimensions and no toolbar, and all that guff.

I have the following code, but it doesn't seem to work. any ideas? I kinda need this one quickly!


on (release) {
getURL ("javascript:window.open('http://www.yourdomain.com/yourpage.html','windowName','width=400,height=160, top=0,left=0,toolbar=no,scrollbars=no,resizable=no ,menubar=no,status=no,directories=no,location=no') ; void(0);");
}


Cheers.

Chris.

View Replies !    View Related
Code Check Please
What's wrong with the if and else actions below? I know I'm missing something easy...
--------------------------------------

on (rollOver) {
gotoAndStop(12);
}
on (rollOut) {
gotoAndPlay(11);
}
on (release, releaseOutside, keyPress "p") {
ifFrameLoaded ("profile", 16);
gotoAndPlay("profile", 1);
} else {
gotoAndPlay ("interface", 28);
}
}

View Replies !    View Related
:: Check My Code ::
Im having trouble with a form in flash. I have everything setup but it doesnt work. It uses an external .php3 file and i think something might be wrong.

If someone knows how to create these forms could I send you my fla and .php3 for some help?

thanks
n

View Replies !    View Related
Please Check My Code.
Hi.
Im trying to make buttons that alphatween on mouse
over. "But1" is my mc with the alpha tween. I've checked this
a dozen times and must be missing something stupid.


Heres my bot script.

onClipEvent (enterFrame) {
if (but==1) {
tellTarget ("_root.but1") {
gotoAndPlay (2);
}
} else if (but==2) {
tellTarget ("_root.but1") {
prevFrame ();
}
}
}

View Replies !    View Related
Can Someone Check Out This Code?
The following code puts a mouses X value in a dynamic text field and works fine as an independant .swf......when I try to load this .swf into another, the code no longer works. I'm assumsing there is something wrong with path structure when its "included", thats why I included the "this"'s...maybe not? Could use help.

Thanks in advance.

this.onEnterFrame = function () {
this.stageX = _root._xmouse;
this.stageY = _root._ymouse;
};

this.xText_mc.mytext.text = stageX;

View Replies !    View Related
Code Check Please
I am using MX and I am loading a variable from a cgi with load variable. I have a check inplace so I make sure that the variable is loaded before it gets to this frame with this code on it.

if (bgs==1) {
gotoAndStop("5");
} else if (bgs==2) {
gotoAndStop("15");
} else if (bgs==3) {
gotoAndStop("25");
} else if (bgs==4) {
gotoAndStop("35");
} else if (bgs==5) {
gotoAndStop("45");
}

I must be missing something here because it goes to this frame with this code and just stops. I have tried using frame labels also but with no luck. I look in the debugger and list the variables and the bgs variable is comeing in with it being a 5 so it should goto and stop on frame 45 but it does nothing at all

View Replies !    View Related
Check Code
I keep getting errors in my code, but I can't figure out whats wrong.

This is the message I get in the output box:

Code:
Scene=Scene 1, Layer=Layer 22, Frame=124: Line 32: ';' expected
If (success) {

Scene=Scene 1, Layer=Layer 22, Frame=124: Line 34: 'else' encountered without matching 'if'
} else {

Here is my code:

Code:
//////////////////////// LOAD ID txt FILE //////////////////////////////////
MyLoadCID = new loadVars();
MyLoadCID.load("CdTypes/ID.txt");
MyLoadCID.onLoad = function(success) {
if (success) {
trace("done loading");
FDR = MyLoadCID.ID;
ID.text = FDR;
// trace(FDR)
info(FDR);
} else {
trace("not loaded");
}
};
// ////////////////////////// START FUNCTION INFO ////////////////////////////////
function info(myVar) {
MyLoadVars = new loadVars();
MyLoadVars.load("CdTypes/"+myVar+"Campaign.txt", "mp3");
MyLoadVars.onLoad = function(success) {
if (success) {
trace("done loading");
// Name.name.text = this.Name0;
mp3.mp3name.text = this.mp3File0;
} else {
trace("not loaded");
}
}
// load mp3 sound file
mySound = new Sound();
mySound.loadSound("TestVB/" + this.mp3File0 + "", true);
mySound.onLoad = function(success) {
If (success) {
trace("mp3 loaded");
} else {
trace("mp3 failed");
}
};
};

View Replies !    View Related
Can U Check My Code, Pls
stop();

function whnpress(num) {
newname = "drag"+String(num);
a = getProperty(_root[newname], _x);
b = getProperty(_root[newname], _y);
_root[newname].startDrag("");
}

z = 0;
for (i=1; i<=6; i++) {
}
function whnrelease(num) {
newname = "drag"+String(num);
dropname = "drop"+String(num);
if (_root[newname].hitTest(_root[dropname])) {
setProperty(_root[newname], _x, getProperty(_root[dropname], _x));
setProperty(_root[newname], _y, getProperty(_root[dropname], _y));
_root[newname].nextFrame();
stopDrag();
} else {
setProperty(_root[newname], _x, a);
setProperty(_root[newname], _y, b);
stopDrag();
}
if (z == 6) {
_root.continuar5._visible = true;
} else {
_root.continuar5._visible = false;
}
}

I'm working in a drag&drop action, and in the same scene i have a actionbutton and it is disable, whem i make a first move (drag) the button is activate and stay enable.

But now i want do something better, i want enable the actionbutton only after 6 drags, i try everything but i cant do this ... whats wrong with my code?

View Replies !    View Related
Code Check
Would somebody mind having a look at my fla please?

I’m having trouble getting the preloader to run. I’ve added the preloader code on frame 1, on frame 2 is a stop command and on frame 3 is a gotoandplay(4) command. The main site content should then load but when I test the movie nothing happens.

The fla can be downloaded from the link below in zip format -

Thanks
DT
here

View Replies !    View Related
Please Check My Code
Hi

I'm using the following code for a preloader:

/:loaded = _root.getBytesLoaded();
/:total = _root.getBytesTotal();
if (Number(/:loaded) == Number(/:total)) {
tellTarget ("_root") {
nextFrame();
}
} else {
/:result = (Number(/:loaded)*100)//:total;
/ercentage = (Math.ceil(/:result))+"%";
setProperty("_root.symbol 271.symbol 274", _x, _level0:markposition + (((Number (/:loaded)*100) / /:total) * 1.67));
_root.gotoAndPlay("transition");
}

Symbol 274 (nested in symbol 271) contains a dynamic text field with the variable name /ercentage. It's supposed to display the percent loaded.

Can anyone see why it isn't working?

cheers!
jen

View Replies !    View Related
Check Code Help.
I am using my preloader code to load an swf. I have different preloaders for different swfs but only one of my preloaders seem to work, is there something in the code that would prevent the other swfs from working. Each preloader has its own Html page which loads the preloader swf which inturn should load the swf I want to play, but it is not working.



ActionScript Code:
this.reelmc._visible = false;
this.loadbar._visible = false;
percent_display = "";
//create a new movieclip to load
//the external movie into
this.createEmptyMovieClip("container",10);
//load the external movie into the new movieclip
container.loadMovie("Agribusiness.swf");
//trace(container)
//check the download status of the external
//movie once every frame
this.onEnterFrame=function(){
    //trace the percentage of the movie that has loaded
    //trace(percent);
    percent=(this.container.getBytesLoaded()/this.container.getBytesTotal())*100;

    if(!isNaN(percent)){
        if (percent == 0) {
            percent_display = "";
        } else {
            trace(percent);
            percent_display = Math.ceil(percent) + "% LOADED.";
        }
        this.loadbar._visible = true;
        this.loadbar._xscale = percent;
        if (percent > 1) {
            this.reelmc._visible = true;
        }
        container.stop();
    }
    if(percent == 100){
        delete this.onEnterFrame;
        this.reelmc._visible = false;
        percent_display = "";
        this.loadbar._visible = false;
        loadMovieNum("Agribusiness.swf", 0);
    }
};
stop();

View Replies !    View Related
Check Out This Code, Please
i have this code for a widget i am making.

var arrWords:Array = new Array
("random quote");

//Define button function:
myButton.onRelease = function() {
var i:Number = Math.round(Math.random()*(arrWords.length-1));
this._parent.myText.text = arrWords[i];
};
stop();

this code is on frame 25 of a 25 frame timeline. it is supposed to play some random quotes when it gets to that frame, but it isn't. any help is appreciated. sorry about the newb question.

View Replies !    View Related
Code Check Plz ;)
Howdy, I am in the process of empiracally figuring out Flash MX and have come up with the following experiment:

http://www.netwiz.net/~cheez/drawbox.html

*caution: a tiny bit buggy, sometimes browser window becomes unresponsive*

// UPDATE I removed a button graphic that seemed to freeze the browser on rollover. I removed it and reposted swf. The *.fla below does have this code still in it for anyone who wants to take a look. Thx - cheez

This is not meant to be a site-check however. My questions are:

1. how can I incorporate a "clear" button to totally clear the drawing at some particular point. Browser refresh works quite well but wanted something integrated. Can one make an html call from within FLASH to make the browser refresh?

2. I can't quite figure out why, but occasionally the browser freezes. Also, when playing the movie from MX, it sometimes freezes. I assume I am creating a monster clip by not refreshing frequently enough and this is tying up the cpu. I don't know...

3. the "rollover" hints section is kind of jumpy. Can I do anything about that? It also erases "temporarily" the drawing underneath, but it does comeback by single-clicking the erases area.

4. What difference would beginFill/endFill have if I decided not to employ at every new line. Maybe I wait till 4 lines are drawn, have an automatic 5th line close the polygon, and then fill?

Thanks,
Cheez

View Replies !    View Related
Code Check Pls
Before I start I have spent hours searching the forums and cant figure this out so please dont ask me to search! I know its been asked hundreds of times but I just cant get it working. ... its another javascript popup (woohoo!)

On me button
getURL ("javascript:spawnWindow('page.html','myWindow','t oolbar=no,location=no,status=no,menubar=no,scrollb ars=no,resizable=no,width=410,height=340')");

In me html:
<script language="JavaScript">
<!--
function spawnWindow(URL,Name,features) {
window.open(URL,Name,features);
}
//-->
</script>

it just wont work. Can the path be relative or does it have to be full?

View Replies !    View Related
Can Someone Check This Code?
What I am trying to achieve is an "active" button state. I have six buttons. When one is clicked, i need it to change to a color which denotes that it is the active button.

someone provided me with this code, but I can't seem to get it to work. I followed the directions precisely.
The directions were as follows:


One thing I think you could do is create another invisible layer of buttons above all your other buttons. You could make them all invisible, unless a button is clicked.

Let's say your original layer of buttons is called a_but, b_but, and c_but.

Then you could have another invisible layer of buttons called invA_but, invB_but, and invC_but. This layer of buttons would each be the color you want displayed while the button is selected. The code would look something like-

invA_but._visible=false;
invB_but._visible=false;
invC_but._visible=false;

a_but.onRelease=function(){
invA_but._visible=true;
invB_but._visible=false;
invB_but._visible=false;
}

b_but.onRelease=function(){
invA_but._visible=false;
invB_but._visible=true;
invC_but._visible=false;
}

c_but.onRelease=function(){
invA_but._visible=false;
invB_but._visible=false;
invC_but._visible=true
}

View Replies !    View Related
Check My Code
I'm using the code below on preloaders

loadedbytes=getBytesLoaded();
totalbytes=getBytesTotal();
loadedkbytes=Math.ceil (loadedbytes/1000);
totalkbytes=Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
_root.loader.gotoAndStop(frame);

It doesn't always show all of my preloader, ie: by about 25% of the preloader animation it jumps to the movie. I still want the preloader to play all the frames before it goes to the movie regardless of download speed. Also sometimes it sticks on the final frame of the movie for a few seconds and then jumps to the main scene.

Can anyone notice any reason for this in my code?

Thanks in advance

Mhunki

View Replies !    View Related
Code Check
Hi,

I have the following code on the second frame of my root timeline:

function preloadF(){
picA=["sky.jpg","white.jpg"] //<- array of your path/pics
buttonA=[sky_btn,white_btn]
for(var ivar=0;ivar<picA.length;ivar++){
rclip=_root.createEmptyMovieClip("swatch_mc"+ivar, _root.getNextHighestDepth());
rclip._alpha=0;
rclip._x=20;
rclip._y=20;
rclip.loadMovie(picA[ivar]);
}
}
for(var ivar=0;ivar<buttonA.length;ivar++){
buttonA[ivar].jvar=ivar;
buttonA[ivar].onRollOver=function(){
_root["swatch_mc"+this.jvar]._alpha=100;
}
buttonA[ivar].onRollOut=function(){
_root["swatch_mc"+this.jvar]._alpha=0;
}
}

Basically I want the user to rollover either of the two buttons and have the images load and then onrollout the transparency is set to 0. I have the jpegs in the same directory as my swf file but when I test it the code doesn't seem to work. I get the hand link symbol indicating that each of the buttons is a hot spot but no image loads.

Would someone mind checking the code to see if there are any errors?

Thanks for any help offered.

View Replies !    View Related
Check This Code
Hi

Please could you check the following .fla file and give it a once over and see if theirs anything you think could be improved upon codewise!

Their are many ways of doing the same thing in Flash, i need this .fla file to be simplest way of doing it, in that its not necesscarily the pro way but they way a newbie might do it!

Please post your ideas/code replacements etc.

THANKS!


http://www.driz.co.uk/puzzle.fla.zip

View Replies !    View Related
Check My Code
I'm using the code below on preloaders

loadedbytes=getBytesLoaded();
totalbytes=getBytesTotal();
loadedkbytes=Math.ceil (loadedbytes/1000);
totalkbytes=Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
_root.loader.gotoAndStop(frame);

It doesn't always show all of my preloader, ie: by about 25% of the preloader animation it jumps to the movie. I still want the preloader to play all the frames before it goes to the movie regardless of download speed. Also sometimes it sticks on the final frame of the movie for a few seconds and then jumps to the main scene.

Can anyone notice any reason for this in my code?

Thanks in advance

Mhunki

View Replies !    View Related
[as] Code Check
Hi again!
Im writing a simple snipit for easing and ran into a small problem when I try and use functions to call stuff.

When you release myMC from a drag, function ease() is called. (works)
Within function ease(), I have a piece of code that deletes onEnterFrame if myMC is pressed. (also works) The problem is that the onPress of the myMC no longer registers and the drag code is not initalized. Essentially freezing myMC in place.

Any ideas on how I can get this working? Thanks!

Also, for the pro scripters out there, is this a good way of organizing code? Ive just recently started working on some more complex code and have realized that just hacking things together really isnt a good way to work. Updating code and debugging is a real pain.

Anyway, Here is the snipit



ActionScript Code:
//any movieclip:
this.onPress = function() {
    trace("press")
    this.startDrag();
}
this.onRelease = this.onReleaseOutside = function() {
    this.stopDrag();
    _parent.ease(_name)
}




ActionScript Code:
//_root actions layer:
function ease(obj) {
    x = 0;
    y = 0;
    drag = 0.05
    easeObj = this[obj];
   
    onEnterFrame = function() {
        //oX = x; // not needed
        //oY = y; // not needed
        x = (targetObj._x-easeObj._x)*drag;
        y = (targetObj._y-easeObj._y)*drag;
        easeObj._x += x;
        easeObj._y += y;
        trace("!");
    }
   
    //if(oX == x && oY == y) {  // this works
    easeObj.onPress = function() {
        trace("delete")
        delete onEnterFrame
    }
}

View Replies !    View Related
Tab Order, Check Out This Code
this is a pretty straight forward code for a simple tab order, however, when in action, cursor just jumps all over, completely ignoring the specified order. Even highlights the buttons. What could be the problem?

onClipEvent (load) {
if (Key.isDown(Key.TAB)) {
if (Selection.getFocus() == "_root.sim.f1") {
Selection.setFocus("_root.sim.f2");
}
if (Selection.getFocus() == "_root.sim.f2") {
Selection.setFocus("_root.sim.f3");
}
if (Selection.getFocus() == "_root.sim.f3") {
Selection.setFocus("_root.sim.f4");
}
if (Selection.getFocus() == "_root.sim.f4") {
Selection.setFocus("_root.sim.f5");
}
if (Selection.getFocus() == "_root.sim.f5") {
Selection.setFocus("_root.sim.f6");
}
}
}

View Replies !    View Related
Check Out This Code. What Am I Doing Wrong
i got a few replies about my pop up window but the code given still isn't working. here is what I am doing:

I have a main movie. I am loading different swf into empty movie clips using load movie into targets.
i have a button in one of my movies that load into one of the empty movie clips in my main movie.

this is the code I put on the button
on release
getURL ("javascript:spawnwindow('womenscontactpop.swf','W omens Contact Information','height=400,weight=w00,toolbar=yes,sc rollbar=no');");

I open the html page generated in flash in dreamweaver4
the code is this:

<HTML>
<HEAD>
<TITLE>womenscontactbutton</TITLE>
<script language="JavaScript">
function spawnWindow('womenscontactpop.swf', 'Womens Contact Information', 'height=400,width=400,toolbar=yes,scrollbar=yes'){
window.open('womenscontactpop.swf','Womens Contact Information','height=400,width=400,toolbar=yes,scr ollbar=yes);
}

</script>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<A HREF=javascript:spawnwindow('womenscontactpop.swf' ,'Womens Contact Information','height=400,weight=w00,toolbar=yes,sc rollbar=no');></A> <!-- text used in the movie-->
<!--If you would like to learn more about the Women's Ministry or Contact a Team Member CLICK HERE --><OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=985 HEIGHT=540>
<PARAM NAME=movie VALUE="womenscontactbutton.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="womenscontactbutton.swf" quality=high bgcolor=#FFFFFF WIDTH=985 HEIGHT=540 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>


when I publish preview in flash I get an error message and it tells me that it is expecting an "OBJECT" can anyone explain this.
Much appreciated and thanks in advance.

View Replies !    View Related
Check This What's Wrong With Code.
onClipEvent (enterFrame) {
for (i = 1; i < 4; i++){
_root.cont["mc" + i]_alpha-=3;
}
}
What's wrong with the above code??

I want it to enterframe and each time take the alpha down 3 until mc1,mc2,mc3,mc4 have all faded to 0. This is a control mc too by the way, 'cont' holds the mc's that the alpha is being appied to! It works individualy if i do this.

onClipEvent (enterFrame) {
_root.cont.mc1._alpha -= 3;
_root.cont.mc2._alpha -= 3;
_root.cont.mc3._alpha -= 3;
_root.cont.mc4._alpha -= 3;
}

View Replies !    View Related
_currentframe Code Check Please
Code:
on (release) {
what_frame_is_it = _currentframe;
//trace (what_frame_is_it);
if what_frame_is_it == 1 then
gotoAndPlay ("start");
}
Hi everyone - can someone please let me know what I have done wrong on line 4? The test, as can be seen, is that I want to find out what the current frame is and if it is 1, then go to a certain frame label. I want to carry out similar tests, but I have to get the method right. Flash kicks up a fuss -



Code:
Symbol=animation, Layer=red button, Frame=1: Line 4: '(' expected
if what_frame_is_it == 1 then
Sorry I know I'm missing something obvious - any pointers?

thanks

frank

View Replies !    View Related
Mx Check Box Component Code
I've searched for a tutorial/answer on this but can't find what I've done wrong.

I have a 2 movie clips. 'recon' has a checkbox. If it is checked, I want a movieclip in 'stress' to go to another frame.

My comments show what I think I'm doing but the clip in 'stress' never shows up...

'recon' has this code:

Code:
//capture values of checkboxes
function setValues() {
image.setValue(image_value);
}
//convert to variables
function getResults() {
image_value = image.getValue();
}

and a gotoAndPlay(1); on the second frame, to make it keep checking.

'stress' has this code:

Code:
//if box checked, go to visible frame
if (_root.recon.image.image_value == true) {
image2.gotoAndStop(2);
} else {
image2.gotoAndStop(1);
}


and again a gotoAndPlay (1);

Hope you can help this ActionScript beginner!

View Replies !    View Related
Code Check, What's Wrong Here?
I added the highlighted piece of code below and I get this error message, what am I doing wrong here?

Scene=Scene 1, Layer=actions, Frame=1: Line 5: Left side of assignment operator must be variable or property.

audioNarration = new Sound(this);
audioNarration.attachSound("audio.mp3");
audioNarration.start(0, 1);
audioNarration.onSoundComplete = function() {
if (_root.whichPic<_root.photoAmount && _root.paused = false) {
_root.navButtons["photo_button"+_root.whichPic].gotoAndStop(1);
_root.fadeOut = true;
_root.whichpic++;
_root.subhead = _root["subhead"+_root.whichPic];
}
};

View Replies !    View Related
MX Level Check Code
Question for Flash MX Actionscript.

Scenario:
main.swf - level 0
about.swf - level 1
info.swf - level 2
notes.swf - level 3
music.swf - level 4

In each of these movies is a music on/off button. The button is created in a movieclip with 2 frames. On frame 1 is the "music off" button and on frame 2 is the "music on" button. When the user clicks the "music off" button the music.swf movie is unloaded from level 4 and the movieclip jumps to frame 2.

Now, my problem is that I need all of the independent music on/off buttons in each level to reflect the state of the music.swf file in level 4. For instance, is there an way to check if level 4 is occupied and then based upon the answer tell the music button movieclip to go to a specific frame?


If level 4 is occupied, go to <movieclip> frame 1...

Else...

go to frame 2

I hope this makes sense. Thanks!

View Replies !    View Related
Code Check - Arrays
Hey all- I am having problems with this little bit of code. These are variables of text boxes that need to have the correct answer in them. I apologize for the lengthy code, but its simple for the gurus out there and I cannot upload the fla to my free web server. It's too big.


Code:
stop();
Stage.showMenu = false;
mcArray = new Array(rw1, rw2, rw3, rw4, rw5, rw6, rw7, rw8, rw9, rw10, rw11);
mcArray2 = new Array(rw1a, rw2a, rw3a);
inputArray = new Array();
inputArray2 = new Array();
answerArray = new Array("iliac crest", "ilium", "ischial spine", "ischium", "pubis", "pubic arch", "obturator foramen", "symphysis pubis", "acetabulum", "iliac spine", "sacrum");
answerArray2 = new Array("iliac crest", "ilium", "pubis");
checkAnswers.onPress = function() {
// Set the array elements of inputArray = to the text input by the user
inputArray[0] = iliac_crest;
inputArray[1] = ilium;
inputArray[2] = ischial_spine;
inputArray[3] = ischium;
inputArray[4] = pubis;
inputArray[5] = pubic_arch;
inputArray[6] = obturator_foramen;
inputArray[7] = symphysis_pubis;
inputArray[8] = acetabulum;
inputArray[9] = iliac_spine;
inputArray[10] = sacrum;
inputArray2[0] = iliac_crest2;
inputArray2[1] = ilium2;
inputArray2[2] = pubis2;
// Loop for each element in the array
for (i=0; i<inputArray.length; i++) {
if (inputArray[i] == answerArray[i]) {
mcArray[i].gotoAndStop(2);
//match found
} else {
mcArray[i].gotoAndStop(3);
//match was not found
}
}
for (i=0; i<inputArray2.length; i++) {
if (inputArray2[i] == answerArray2[i]) {
mcArray2[i].gotoAndStop(2);
} else {
mcArray2[i].gotoAndStop(3);
}
}
};
resetAgain = function (num) {
// sets up 'reset' as function
for (var i = 1; i<=num; ++i) {
this["rw"+i].gotoAndStop(1);
}
};
//
//
resetAgain(11);
reset = function (num) {
for (var i = 1; i<=num; ++i) {
this["rw"+i+"a"].gotoAndStop(1);
}
};
reset(3);
//
//
for (i=0; i<inputArray.length; i++) {
inputArray[i].onSetFocus = function() {
colorArray[i]._visible = true;
};
inputArray[i].onKillFocus = function() {
colorArray[i]._visible = false;
};
}
So here's the breakdown:

...I have multiple textboxes with variable names. These are the input array names. Now, Sleeve gave me this code, so thank to him, but I tried making a inputArray2[0], [1], etc but it doesn't work. Please tell me what I am doin wrong. Same for answerArray2. The rws are all working correctly within inputArray and answerArray, not inputArray2 and answerArray2. This is what I am having problems with. and the colorMCs are not yet implemented. So I don't need help on these. Unless you see something I can change...

Thanks very much.

Also, really quick-- what is the vB code for actionscript? It would help me a lot to post code that is color coded for AS. I am using code and /code, of course in brackets. Is actionscript like action and /action or...

Thanks again. You guys really save my butt.

View Replies !    View Related
Code Check, Quickie
I received this info for passing variables along from a combo box into an asp page and I need to have the syntax of the code checked.

Is this correct
choice = comboboxinstance.getSelectedItem()to your button handler.

My combobox is called 'combobox' and it has green and blue labels as well as green and blue data fields

The asp should see the variable "choice" correct

View Replies !    View Related
Check This Code Please (1 Line)
ok i wish to display a result in a list box.

code:
_root.txtresult.text = _root.txtresult.text+"
"+_global.creatureObjects[counter1].name+" has "+strHas;


This displays the result in a dynamic text field fine, but i want it to display in a list box called 'result' i have tried addItem and that does not work either. Any ideas?

thanks

View Replies !    View Related
Searching Through XML....check Code Please?
I have this XML
http://flash.uk-graffiti.co.uk/creatures.xml

Where a creature, species, breed or subbreed has more than one .has attribute. This code will not pick up on it.
It works for all creatures that only have one .has attribute.

So i guess i have to put in attributes.has.split(",") some where.

but im not sure where?
any ideas?

code:
_global.xmlLoaded = false;
creatureXML = new XML();
creatureXML.load("creatures.xml");
creatureXML.ignoreWhite = true;
creatureXML.onLoad = xmlReady;
//only allow button to work when xml is loaded
function xmlReady() {
_global.xmlLoaded = true;
trace("XML loaded");
}
//relate button script
_root.relateButton.onRelease = function() {
if (_global.xmlLoaded) {
_root.findFirstLevel(txthas.text);
}
};
//findFirstLevel function
/* this function doesn't allow adding to the comparison arrays,
therefore it is assumed that if there's no match, both entries
must be "creature" */
function findFirstLevel(strhas) {
for (i=0; i<creatureXML.childNodes.length; i++) {
if (creatureXML.childNodes[i].nodeName.toLowerCase() == "creature") {
if (creatureXML.childNodes[i].attributes.has == strhas) {
_root.txtresult.text = creatureXML.childNodes[i].attributes.id+" has "+strhas;
}else{
passOn = creatureXML.childNodes[i];
}
}
findSecondLevel(passOn, strhas);
}
}
//
//findSecondLevel function
/* All functions from here are pretty much repetition */
function findSecondLevel(passedNode, strhas) {
trace("Has 2:"+strhas);
for (i=0; i<passedNode.childNodes.length; i++) {
if (passedNode.childNodes[i].nodeName.toLowerCase() == "category") {
if (passedNode.childNodes[i].attributes.has == strhas) {
trace("2nd level"+passedNode);
_root.txtresult.text = passedNode.childNodes[i].attributes.id+" has "+strhas;
} else if (passedNode.childNodes[i].hasChildNodes()) {
findThirdLevel(passedNode.childNodes[i], strhas);
}
}
}
}
//
//findThirdLevel function
function findThirdLevel(passedNode, strhas) {
trace("Has 3:"+strhas);
for (j=0; j<passedNode.childNodes.length; j++) {
if (passedNode.childNodes[j].nodeName.toLowerCase() == "species") {
if (passedNode.childNodes[j].attributes.has == strhas) {
trace("3rd level"+strhas);
_root.txtresult.text = passedNode.childNodes[j].attributes.id+" has "+strhas;
} else if (passedNode.childNodes[i].hasChildNodes()) {
findFourthLevel(passedNode.childNodes[j], strhas);
}
}
}
}
//findFourthLevel function
function findFourthLevel(passedNode, strhas) {
trace("Has 4:"+strhas);
for (k=0; k<passedNode.childNodes.length; k++) {
if (passedNode.childNodes[k].nodeName.toLowerCase() == "breed") {
if (passedNode.childNodes[k].attributes.has == strhas) {
trace("4th level"+passedNode);
_root.txtresult.text = passedNode.childNodes[k].attributes.id+" has "+strhas;
} else if (passedNode.childNodes[k].hasChildNodes()) {
findFifthLevel(passedNode.childNodes[k], strhas);
}
}
}
}
//
//findFifthLevel function
function findFifthLevel(passedNode, strhas) {
trace("Has 5:"+strhas);
for (l=0; l<passedNode.childNodes.length; l++) {
if (passedNode.childNodes[l].nodeName.toLowerCase() == "subbreed") {
if (passedNode.childNodes[l].attributes.has == strhas) {
trace("5th level"+strhas);
_root.txtresult.text = passedNode.childNodes[l].attributes.id+" has "+strhas;
}
}
}
}

View Replies !    View Related
PHPmail Code Check
Do you see anything mistakes?


<?
if(!empty($_POST['sender_mail'])
|| !empty($_POST['sender_message'])
|| !empty($_POST['sender_subject'])
|| !empty($_POST['sender_name']))
{
$to = "info@entangledstudios.com";
$s_name = $_POST['sender_name'];
$s_mail = $_POST['sender_mail'];
$subject = stripslashes($_POST['sender_subject']);
$body = stripslashes($_POST['sender_message']);
$body .= "

---------------------------
";
$body .= "Mail sent by: $s_name <$s_mail>
";
$header = "From: $s_name <$s_mail>
";
$header .= "Reply-To: $s_name <$s_mail>
";
$header .= "X-Mailer: PHP/" . phpversion() . "
";
$header .= "X-Priority: 1";
if(@mail($to, $subject, $body, $header))
{
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error"; /
}
?>

View Replies !    View Related
I Have Problem, Please Check This Code..
Hello. I have AS code in my Fla. I found this code in flashkit ale I change it a little and I adapted it to my needs. But, I have a request. Could you check it for me? or could you simplify it? I think that this code is little too complicate to me...

and If you can, please explain me this code . I will be grateful


Code:
var funcName = forward ;
function loadPic(item) {
if (!pictures[currentItem].loaded) {
mcNext.enabled = mcContainer._visible = !(mcWait._visible = true);
}
this.onEnterFrame = function() {
var bl = this.mcContainer.getBytesLoaded();
var bt = this.mcContainer.getBytesTotal();
if (bl == bt && bt > 0) {
this.mcNext.enabled = this.mcContainer._visible =
!(this.mcWait._visible = false);
this.pictures[this.currentItem].loaded = true;

delete this.onEnterFrame;
}
};
mcContainer.loadMovie(item.name);
}

mcNext.onPress = function() {
var p = this._parent;
p.forward = true;
p.loadPic(p.pictures[p.currentItem =
(p.currentItem == (p.pictures.length-1)) ? 0 : (p.currentItem+1)]);
};
pictures = [{name: 'julitka.swf', loaded: false},
{name: 'brutus.swf', loaded: false},
{name: 'julitka.swf', loaded: false}];
currentItem = 0;
forward = true;
loadPic(pictures[currentItem]);


and now I tell you what I want to do. I have a few movieclips in SWF and I would like to load these MC's in sequence every time when I click on the button. So when i click first time on button i loading first MC. when i click second time on a button I loading second MC. etc.


I have question:


Code:
(p.currentItem == (p.pictures.length-1)) ? 0 : (p.currentItem+1)]);
-- what's that means and what is this: "? 0:" . I know that "?:" is a condition but what a condition is in this line of code?

View Replies !    View Related
Code Check Request
hello,
I would like to get some feedback on this method for scaling and positioning a map within a constrained space. Its based on a post i read here. Although its working ok If you have any comments for improving the method let me know. I would really like to get an inertia effect, but thats not going to happen with this code is it? I didnt include the button code as that is working well enough.
thanks



Code:
function moveClip() {

if (myClip_mc._x < 600) {

// the _x value is less than x, so increase _x by 1px,

// and let setInterval execute this function again

myClip_mc._x += 1*.5; // move the clip 1 px to the right

} else {

// the _x value is greater than x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalRight);

} // end "if myClip_mc._x < x"

} // end moveClip()



// do this when "myButton_btnRight" is clicked

myButton_btn.onPress = function() {

// execute the "moveClip" function every 10 milliseconds

myIntervalRight = setInterval(moveClip, 5);

} // end myButton_btnRight.onPress()


// Right button relase to stop right movement

myButton_btn.onRelease = function() {

// stop the right setinterval

clearInterval(myIntervalRight);

} // end myButton_btn.onPress()


function moveClipLeft() {

if (myClip_mc._x > 450) {

// the _x value is less than x, so increase _x by 1px,

// and let setInterval execute this function again

myClip_mc._x -= 1; // move the clip 1 px to the Left

} else {

// the _x value is greater than x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalLeft);

} // end "if myClip_mc._x < x"

} // end moveClip()



// do this when "myButton_btnLeft" is clicked

myButton_btnLeft.onPress = function() {

// execute the "moveClipLeft" function every 10 milliseconds

myIntervalLeft = setInterval(moveClipLeft, 5);

} // end myButton_btnLeft.onPress()
myButton_btnLeft.onRelease = function() {

// stop the "moveClipLeft" function e

clearInterval(myIntervalLeft);

} // end myButton_btnLeft.onPress()

function moveClipScaleUp() {

if (myClip_mc._yscale < 350 ) {

// the scale value is not equal to x, so increase scale by 1px,

// and let setInterval execute this function again

myClip_mc._yscale += 5;
myClip_mc._xscale += 5;

} else {

// the scale value is greater than x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalScaleUp);

} // end "if myClip_mc._x scaleup"

} // end moveClip()



// do this when "myButton_btnScaleUp" is clicked

myButton_ScaleUp.onPress = function() {

// execute the "moveClipScaleUp" function every 10 milliseconds

myIntervalScaleUp = setInterval(moveClipScaleUp, 5);

} // end myButton_btnScaleUp.onPress()
myButton_btnScaleUp.onRelease = function() {

// execute the "moveClipScaleUp" function every 10 milliseconds

clearInterval(myIntervalScaleUp);

} // end myButton_btnScaleUp.onPress()


function moveClipScaleDown() {

if (myClip_mc._yscale > 150 ) {

// the scale value is not equal to x, so decrease scale by 1px,

// and let setInterval execute this function again

myClip_mc._yscale -= 5;
myClip_mc._xscale -= 5;

} else {

// the scale value is equal to x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalScaleDown);

} // end "scaledown"

} // end moveClip()



// do this when "myButton_btnScaleDown" is clicked

myButton_btnScaleDown.onPress = function() {

// execute the "moveClipScaleDown" function every 10 milliseconds

myIntervalScaleDown = setInterval(moveClipScaleDown, 5);

} // end myButton_btnScaleDown.onPress()

myButton_btnScaleDown.onRelease = function() {

// stopscaling down on the button release

clearInterval(myIntervalScaleDown);

} // stopscaling down on the button release()



function moveClipUp() {

if (myClip_mc._y > -50) {

// the scale value is not equal to x, so decrease scale by 1px,

// and let setInterval execute this function again

myClip_mc._y -= 5;

} else {

// the scale value is equal to x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalUp);

} // end "scaledown"

} // end moveClip()



// do this when "myButton_btnScaleDown" is clicked

myButton_btnUp.onPress = function() {

// execute the "moveClipup" function every 10 milliseconds

myIntervalUp = setInterval(moveClipUp, 5);

} // end myButton_btnScaleDown.onPress()

myButton_btnUp.onRelease = function() {

// stopscaling down on the button release

clearInterval(myIntervalUp);

} // stopscaling down on the button release()


function moveClipDown() {

if (myClip_mc._y < 250) {

// the scale value is not equal to x, so decrease scale by 1px,

// and let setInterval execute this function again

myClip_mc._y += 5;

} else {

// the scale value is equal to x,

// so stop the setInterval from executing anymore

clearInterval(myIntervalDown);

} // end "scaledown"

} // end moveClip()



// do this when "myButton_btnScaleDown" is clicked

myButton_btnDown.onPress = function() {

// execute the "moveClipup" function every 10 milliseconds

myIntervalDown = setInterval(moveClipDown, 5);

} // end myButton_btnScaleDown.onPress()

myButton_btnDown.onRelease = function() {

// stopscaling down on the button release

clearInterval(myIntervalDown);

} // stopscaling down on the button release()

View Replies !    View Related
[F8] Help On CPU Speed Check Code
Hey, Guys!

Iīve been looking for a way to make a flash web-site detect the userīs system and, based on this analysis, lead the browser to a specific version of the site (say, a "light version" or a "full version").

After some searches in many forums, Iīve found a code that seems to provide a rough idea of the userīs system perfomance. I am not sure how it works exactly, but it is pretty interesting. I am attaching the original fla. So, this fla evaluates the system performance and based on that gives us a number. So if this number is under a pre-specified value, my site will load a "light version", without effects. If this number is above a pre-defined value, my site will load a "full version".

What I want now (and have no idea how to do it) is make this code collect (letīs say) three different numbers and calculate an average number among them, so the end result will be more reliable. I am having a hard time to explain this, but once you guys open the fla it will get pretty clear.

Thanks in advance

View Replies !    View Related
[F8] Could Someone Please Check Out My Code And See What Is Wrong
I am at a loss as to what's wrong in my movie. I am trying to keep a variable called "currentTab" false and something keeps changing it back to true. I have no idea how it keeps changing back... I have checked the movie over and again.

This is a portfolio site.. I have two buttons at the top that switch from a resume to the portfolio. I have set up functions called "playImageHolder", "frameis9" and "playResume"... these just rest within the movieclips that they are supposed to play because I was having trouble getting them to play from a remote location...

somehow, between playImageHolder and frameis9 the variable "currentTab" switches back to true, even though I define it as false in playImageHolder... I have only defined it as true in one location (that I'm aware of).. that is frame 5 of imageHolder_mc... it changes back to true even though the playhead never goes through 5 again...!!??

Hopefully somebody can help me out.. I have no idea what's wrong
Thanks for your help!
The address of my .fla file is http://www.brianearwood.com/website_test.fla
Its about 600 K.. I erased all of the bitmaps out of it and it was still that big so if you also know why that is, I'd be happy to learn!

View Replies !    View Related
Error And Code Check
my nefew asked me if I could look at his code, I have not done much with as3
I use as2. and I just got back into it. can you help me help him with his error and code please? thanks a million in advance.
he is getting error code: on frame 1 line 74
(1116: A user-defined namespace attribute can only be used at the top level of a class definition.)
here is his code.

Code:
import gs.TweenMax;
import fl.motion.easing.*;
TweenMax.from(content, 5, {y:"-100", ease:Elastic.easeOut});

var menue:String = new String();
var a:String = "myText.txt";
var b:String = "myText2.txt";
var c:String = "myText3.txt";
var d:String = "myText4.txt";
var e:String = "myText5.txt";
var defaultText = a;

stage.scaleMode = StageScaleMode.NO_SCALE;

function loadText():void {
var txtLoader:URLLoader = new URLLoader();
txtLoader.addEventListener(Event.COMPLETE, onLoaded);
content.autoSize = TextFieldAutoSize.LEFT;
txtLoader.load(new URLRequest(defaultText));
removeEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void {
content.text = txtLoader.data;
if (content.height < sb.track.height) {
sb.alpha = 0;
} else if (content.height > sb.track.height) {
sb.alpha = 1;
sb.thumb.y = yMin;
content.y = masker.y;
}
}
}

loadText();

var yOffset:Number;
var yMin:Number = 0;
var yMax:Number = sb.track.height - sb.thumb.height;

sb.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp);

function thumbDown(e:MouseEvent):void {
stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
yOffset = mouseY - sb.thumb.y;
}

function thumbUp(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
}

function thumbMove(e:MouseEvent):void {
sb.thumb.y = mouseY - yOffset;
if (sb.thumb.y <= yMin) {
sb.thumb.y = yMin;
}
if (sb.thumb.y >= yMax) {
sb.thumb.y = yMax;
}
var sp:Number = sb.thumb.y / yMax;
TweenMax.to(content, 1, {y:(-sp*(content.height - masker.height)), ease:Back.easeOut});
e.updateAfterEvent();
}
//buttons
btn1.addEventListener(MouseEvent.CLICK, btn_click);
btn2.addEventListener(MouseEvent.CLICK, btn_click);
btn3.addEventListener(MouseEvent.CLICK, btn_click);
btn4.addEventListener(MouseEvent.CLICK, btn_click);
buttoninstancename.buttonMode = true;
buttoninstancename.mouseChildren = false;

function btn_click(event:MouseEvent)
{
define the selected_text variable
var selected_text:String = "menue";

//Check which button is clicked on instance names
if(event.target.name == btn1) {
selected_text = "a";
} else if(event.target.name == btn2) {
selected_text = "b";
} else if(event.target.name == btn3) {
selected_text = "c";
} else if(event.target.name == btn4) {
selected_text = "d";
} else if(event.target.name == btn5) {
selected_text = "e";
}
//add seīlected text to your textfield
myTextLoader.text = selected_text;
}

View Replies !    View Related
Can Some Check This Code For Me Its Only Working Once In My MC
The code below is only working once in my MC. I am trying to create a tabbed navigation with an imbedded button within an MC. I have started to get the movement down sorta, but the movement only works once. I'm new to actionscript so i'm not sure if this code is right. thanks for all the help.



speed = 1.5;
endX = 100;
endY = 40;
meycolitemesh.onRollOver = function() {
entiremeycolitemesh.onEnterFrame = function() {
this._x += (endX-this._x)/speed;
this._y += (endY-this._y)/speed;
meycolitemesh.onRollOut = entiremeycolitemesh.onDragOut= function() {
if (entiremeycolitemesh._x>=100) {
endX = 335;
endY = 40;
delete this.onEnterFrame;
} else {
endX = 335;
endY = 40;
}
};
};
};

View Replies !    View Related
Quick Cfc Code Check Please.
ActionScript Code:
import mx.remoting.*
import mx.rpc.*


var myresponder:RelayResponder = new RelayResponder(this,"getCombobox_con_Result","getCombobox_con_Fault");
var getCombobox_con:Service = new Service("http://localhost/flashservices/gateway",null,"getData_uf",null,myresponder);
var pc:PendingCall = getCombobox_con.getComboxitems();

function getCombobox_con_Result(result){
  // display successful result
 
  trace(getCombobox_con.results.getLength())
}
function getCombobox_con_Fault(fault){
  trace("error")
}


is there something I am missing to get the result back as a recordset obj? I am getting undefined.
in my cfc I have the returntype="query" do I have to change that?

when using the remoting connector component its fine but I rather do it manually.

is relay responder the quickest way to have a function called when the results get back?


thanks.

View Replies !    View Related
Masking Code Check -- Help
Can someone look at this code and see if there is something I am overlooking. I've checked and rechecked and rechecked and rechecked and...


ActionScript Code:
#include "mc_tween2.as"

_root.createEmptyMovieClip("image0_mc", 1);
_root.image0_mc.createEmptyMovieClip("imageHolder_mc", 1);
image0_mc.imageHolder_mc.loadMovie("Beach.1.jpg");

_root.createEmptyMovieClip("image1_mc", 2);
_root.image1_mc.createEmptyMovieClip("imageHolder_mc", 1);
image1_mc.imageHolder_mc.loadMovie("Beach.2.jpg");


_root.createEmptyMovieClip("mask_mc", 3);
mask_mc._x = -720;
mask_mc._y = 0;
mask_mc.beginFill(0xFFFFFF, 100);
mask_mc.lineStyle(3, 0xFFFFFF, 0);
mask_mc.drawRectangle(720, 480);
mask_mc.endFill();

image1_mc.setMask(mask_mc);

image0_mc.onRelease = function(){
    trace("i am firing");
    _root.mask_mc.onEnterFrame = function(){
        trace("I'm fring too");
        this.slideTo(0, 0, 1.8, "easeOutElastic");
        if(this._x >= 0){
            this._x = 0;
            trace("Iam firing three");
            delete this.onEnterFrame;
        }
       
    }
}

Please help and I'll write a thank you letter that says thanks 1000 times w/o copy and paste...

Thanks

View Replies !    View Related
Mp3 Preloader Code Check Please
Sorry for cross-posting, but I'm in bit of a jam.

I'm trying to preload a dynamic mp3 and show the percentage loaded as a number and a graphic bar. But it's not working.

The following code is on the the movie clip that the mp3 is being loaded into.

----------------------------------------------------------------------

onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("music.mp3", false);
}

onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
percent -= (percent-((downloaded/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;

if (percent>99) {
_root.gotoAndPlay("intro");
}
}

----------------------------------------------------------------------


Thanks.

View Replies !    View Related
Can Anyone Check My Code For Errors ?
I've been working all day and I just don't see it anymore.....it's always the same thing: the most difficult things work perfectly and the simpel stuff never does

I put 6 dynamic text fields on stage with names t00, t01, t02, 03, t04, t05 inside their own movieclip mc00, mc01, mc02, mc03, mc04 and mc05.

Now my code is so simple: make a variable that contains the name that should go into the text field PLUS some extra characters and onRollover it adds a + infront of the word.
I used variables so that I can use that string for the swf I want to load when the user clicks on it. Simple


It DOES show "00_home", when I start it up, the 'finger' icon appears on the rollOver, but NO + appears.....

Thanks for any hints!

PS This isn't because I use a number in the instance names, is it ?

View Replies !    View Related
Check My Preloader Code Plz
my preloader does not want to work....
i have it programmed and all
here is the fla
http://ca.geocities.com/scotteffer@r...com/cowboy.fla
can some 1 check the code plzzzzzzz
ty

View Replies !    View Related
Check Color Code
I am trying to learn flash and was tryingn to check the color of a movieclip with
actionscript. Here is the code i used

myColorObject = new color("myMovieClip_mc");
trace((myColorObject.getRGB()).toString());

I get a error message in the output window. Can someone please let me know what I am doing wrong?

View Replies !    View Related
_root. Vs This. - Someone To Check This Code
Hi,

I'm trying to load a jpeg, display a text preloader then fade in the image. I can get the preloader working but when I tack on the call to the fadeIn function at the end all I see is the fade and no preload. What am I doing wrong here?

I've got the following code:

on frame 1

//variables
var series = "p";
var index = 1;
var totalFiles = 22;
loadMovie("../images/"+series+"/image"+index+".jpg", "container");
fadeIn = function () {
if (container._alpha<=100) {
container._alpha += 5;
}
};

same frame different layer

stop();
container._visible = false;
this.onEnterFrame = function ()
{
var l = container.getBytesLoaded();
var t = container.getBytesTotal();
var getPercent = l / t;
loadText = "Photo loading... " + Math.round(getPercent * 100) + "%";
if (l > 0 && l >= t)
{
container._visible = 1;
loadText = "";
container._alpha = 0;
_root.onEnterFrame = fadeIn ;
}
}

View Replies !    View Related
Mp3 Preloader Code Check Please
Sorry for cross-posting, but I'm in bit of a jam.

I'm trying to preload a dynamic mp3 and show the percentage loaded as a number and a graphic bar. But it's not working.

The following code is on the the movie clip that the mp3 is being loaded into.

----------------------------------------------------------------------

onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("music.mp3", false);
}

onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
percent -= (percent-((downloaded/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;

if (percent>99) {
_root.gotoAndPlay("intro");
}
}

----------------------------------------------------------------------


Thanks.

View Replies !    View Related
Can Anyone Check My Code For Errors ?
I've been working all day and I just don't see it anymore.....it's always the same thing: the most difficult things work perfectly and the simpel stuff never does

I put 6 dynamic text fields on stage with names t00, t01, t02, 03, t04, t05 inside their own movieclip mc00, mc01, mc02, mc03, mc04 and mc05.

Now my code is so simple: make a variable that contains the name that should go into the text field PLUS some extra characters and onRollover it adds a + infront of the word.
I used variables so that I can use that string for the swf I want to load when the user clicks on it. Simple


It DOES show "00_home", when I start it up, the 'finger' icon appears on the rollOver, but NO + appears.....

Thanks for any hints!

PS This isn't because I use a number in the instance names, is it ?

View Replies !    View Related
Can Someone Check My Code Please - On Loaders
Hi,

I Have the following code below. It part works...

It works in as much as it loads my movie, and then fisplays the complete message, but.. in the meantime whilst its loading, i expect the progress command to display how of the file has loaded - but it is being completly skipped - when run from my server too.



//my=new MovieClipLoader();
//my.loadClip("ar_ad.swf","_root.stan");


// create event listener object for the loader
myListener = new Object();
// click event handler

myListener.onLoadProgress = function(target,bytesLoaded,bytesTotal)
{
trace("The progress of the "+target+" download is "+bytesLoaded + "/" + bytesTotal);
}





myListener.onLoadComplete = function ( target )
{
trace("finished loading"+target);
//gotoAndPlay("hide_loader");
}




my=new MovieClipLoader();
my.addListener(myListener);


my.loadClip("ar_ad.swf","_root.stan");





If anybody could help out here i would be most apreciative
Thanks
Steve

View Replies !    View Related
Code Check And Variables
I tring to get these variables to pass to a php file but I can not get it to work, any ideas? These are checkbox componets.

on (release) {
if (name == null || recipient == null || supervisor == null) {
gotoAndPlay("invalid");
} else {
leadershipVar = leadership.getValue();
CommunicationVar = Communication.getValue();
CustomerFocusVar = CustomerFocus.getValue();
InterpersonalVar = Interpersonal.getValue();
InnovationVar = Innovation.getValue();
DiversityVar = Diversity.getValue();
GoalOrientationVar = GoalOrientation.getValue();
CompetenceVar = Competence.getValue();
MotivationVar = Motivation.getValue();

/*
trace ("LeadershipVar = " + LeadershipVar);
trace ("CommunicationVar = " + CommunicationVar);
trace ("CustomerFocusVar = " + CustomerFocusVar);
trace ("InterpersonalVar = " + InterpersonalVar);
trace ("InnovationVar = " + InnovationVar);
trace ("DiversityVar = " + DiversityVar);
trace ("GoalOrientationVar = " + GoalOrientationVar);
trace ("CompetenceVar = " + CompetenceVar);
trace ("MotivationVar = " + MotivationVar);
*/

loadVariablesNum("form.php", 0, "POST");
_root.gotoAndPlay(35);
}
}

Thanks,

Chuck

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