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








Code Not Always Working For Some Reason


Hello every one,
I've wrote this piece of code that moves a set of movieclips to randomly specified positions. For some reason, some of the movieclips don't move some times. I've tried every thing possible but nothing worked. Could some one please take a look at the code and tell me if I'm missing something. I've attached an fla file.




FlashKit > Flash Help > Flash ActionScript
Posted on: 04-15-2005, 03:37 AM


View Complete Forum Thread with Replies

Sponsored Links:

Ive Got Code, But Its Nor Working For Some Reason
im using flash mx 2004 pro. ive got a click per second code that would tell me how many clicks im getting a second and record the higest. that works fine. then i wanted it to add en extra 2 clicks on each click over 10. thats what i didnt get working. the code for it all is:
Code:
clickCount = 0;

_root.createTextField("myTextField", 1, Stage.width/2, Stage.height/2, 150, 20);

_root.createTextField("totalTextField", 2, Stage.width/2, Stage.height/2, 150, 20);

myTextField.background = false;

totalTextField.background = false;

_root.onMouseDown = function() {

clickCount++;

if (clickCount < highCount) {

highCount = highCount;

} else {

highCount = clickCount;

}

};
_root.onMouseUp = function() {

clickCount++;

if (clickCount < highCount) {

highCount = highCount;

} else {

highCount = clickCount;

}

};

function countTrack() {

trace(clickCount+" shots per second");

myTextfield.text = clickCount+" ";

totalTextField.text = ""+highCount;

clickCount = 0;

}

traceCount = setInterval(countTrack, 1000);

if(clickcount>10&&clickcount>highcount){

clickcount+=2;

}else{

clickcount++;

}
the code in bold at the end is what doesnt work. i uploaded the source if anyone wants to mess with it. its at http://dustinmurphy.com/menu/karni1.fla

View Replies !    View Related
For Some Reason Not Working
flash mx AS not working going to mysql database using PHP......

FLASH MX script..

PHP Code:



// create a new loadVars object for the variables to send
varsToSend = new LoadVars();
    myData = new Array(); 
    varsToSend.venueName = venueName.text;
    varsToSend.state = state.getSelectedItem().label;
    varsToSend.city = city.getSelectedItem().label;
    varsToSend.areaCode = areaCode.text;
    varsToSend.venueType = venueType.getSelectedItem().label;
    varsToSend.ageGroup = ageGroup.getSelectedItem().label;
    varsToSend.musicType = musicType.getSelectedItem().label;
// include a variable to prevent cacheing - this forces the browser
// to make a new call to the server
varsToSend.clearCache = new Date().getTime();
// assign a variable to send - this will eventually come from the search box
varsToSend.myVar = "new";
// create a new loadVars object for the variables to be received
varsToReceive = new LoadVars();
// set up the onload caller
varsToReceive.onLoad = processData;
// set up the function to be called on onLoad
function processData(success) {
    // split the results into arrays using the "|" delimiter - this creates three arrays
    //trace("first pipe = " + varsToReceive.venueName);
    venueNameArray = varsToReceive.venueName.split("|");
    addressArray = varsToReceive.address.split("|");
    cityArray = varsToReceive.city.split("|");
    zipCodeArray = varsToReceive.zipCode.split("|");
    areaCodeArray = varsToReceive.areaCode.split("|");
    phoneNumberArray = varsToReceive.phoneNumber.split("|");
    stateArray = varsToReceive.state.split("|");
    // format the text for the output box
    for (i=0; i<venueNameArray.length; i++) {
        outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + "
";
        //trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]);
    }
    // tell the movie to go to the last frame label
    _level0.gotoAndStop("results");
}
// do the send and load action - I put 127.0.0.1 (localhost)
// you'll need to put your own domain name in
varsToSend.sendAndLoad("search.php", varsToReceive, "GET");
stop(); 

View Replies !    View Related
Some Reason Its Not Working.. Argh..
www.e54interactive.com/compare.zip

if you have a sec and can take a peek at this in action, maybe im missing s-thing really obvious, id really appreciate.

what im doing is loading the date from a text file, trying to compare with the current date and showing and object based on that result, for some reason its just not workiing.. id relaly appreciate if you could point me in the right direction..
thnaks

View Replies !    View Related
HitTest Isnt Working For Some Reason
hi there,

im trying to get two movie clips to collide, then goto frame 1 in the animation. Ive searched thru google and it looks like i might have named my instances wrong or something because the code looks correct. [FlashMX]

objects: 'chutters' - instance of: chutters (this is a movieclip i have 10 of) these are asteroids
objects: 'laura' - instance of: laura (this is the players character)


Code:
//In the laura movieclip actionscript
onClipEvent (enterFrame) {
if (this.hitTest (_root.chutters)) {
gotoAndPlay(2);
}
}

View Replies !    View Related
A Reason The Second Alpha Fade Is Not Working?
Here is what I have and it works good.

//mineral_btn

_root.index_mc._alpha = 100;
mineral_btn.onRollOut = function() {
_root.index_mc.onEnterFrame = function() {
this._alpha < 100?this._alpha+=5:delete this.onEnterFrame;
};
};
mineral_btn.onRollOver = function() {
_root.index_mc.onEnterFrame = function() {
this._alpha > 0?this._alpha-= 5:delete this.onEnterFrame;
};
};


Now when I try to make it so when you rollover the button another movie fades in and rollout it fades out neither one works. I was using this...

//mineral_btn

_root.index_mc._alpha = 100;
mineral_btn.onRollOut = function() {
_root.index_mc.onEnterFrame = function() {
this._alpha < 100?this._alpha+=5:delete this.onEnterFrame;
};
};
mineral_btn.onRollOver = function() {
_root.index_mc.onEnterFrame = function() {
this._alpha > 0?this._alpha-= 5:delete this.onEnterFrame;
};
};

//mineral_mc

_root.mineral_mc._alpha = 100;
mineral_btn.onRollOver = function() {
_root.mineral_mc.onEnterFrame = function() {
this._alpha < 100?this._alpha+=5:delete this.onEnterFrame;
};
};
mineral_btn.onRollOut = function() {
_root.mineral_mc.onEnterFrame = function() {
this._alpha > 0?this._alpha-= 5:delete this.onEnterFrame;
};
};

View Replies !    View Related
Random Frame AS Not Working For Some Reason
I wrote the following code and got an error. It is code i got from a forum with about 15 people who said 'thanks, this words perfectly', but it doesn't for me. I have scoured the code but can't find any reason why it will call this error. Any ideas?

function getRandomLabel():String {
var labels:Array = new Array(â€quote_01″, “quote_02″, “quote_03″,â€quote_04″, “quote_05″, “quote_06″, “quote_07″);
var index:Number = Math.floor(Math.random() * labels.length);
return labels[index];
};

but then I get this error in the output box:
**Error** Scene=Scene 2, layer=actions, frame=1:Line 12: ‘{’ expected
function getRandomLabel():String {

**Error** Scene=Scene 2, layer=actions, frame=1:Line 16: Unexpected ‘}’ encountered
};

what have i done wrong?
Thanks.
Van

View Replies !    View Related
SetInterval Stopped Working Without Any Reason At All
Im really beginning to lose it.. All i wanted to do is make a stopwatch with a couple more functions.
At first everything worked. Later i changed some code (nothing to do with the setInterval function) and suddenly it doesnt work anymore! All it does is execute a function once and then stops.

Here is my code:

Code:
var sekunde:Number = 0; //seconds
var minute:Number = 0; //minutes
var intervalID:Number;
var stoparicaTece:Boolean = false; //is the stopwatch running


osveziStoparico();

function povecajSekunde(){ //increases the seconds
sekunde++;
if(sekunde>=60){
minute++;
sekunde = 0;
if(minute >= 60){
minute = 0;
}
}//1 minute
osveziStoparico();

}
function sproziStoparico(){ //initiates the stopwatch
if(!stoparicaTece){ //ce stoparica se ni bila pognana
intervalID = setInterval(povecajSekunde(), 1000);
stoparicaTece = true;
}
}

function ustaviStoparico(){ //stops the setInterval function
clearInterval(intervalID);
stoparicaTece=false;
}

function resetirajStoparico(){ //resets the stopwatch
sekunde = 0;
minute = 0;
osveziStoparico();
}

function osveziStoparico(){ //displays current seconds&minutes
stoparica.text = minute+":"+sekunde;
}
Thanks for your help because right now i want to hurl my computer through the window!

edit: i already tried restoring it to original state but it didnt work

View Replies !    View Related
What Would Be The Reason For This Popup Not Working? Help Needed Ugently
What would be the reason for this popup not working? Help needed ugently!!


Quote:




on (release) {
getURL("javascript:NewWindow=window.open('http://www.coperecords.com/gamle/www/html/dk/wb/wonderbrassII-rampartrampage.htm','newWin','width=300,height=300 ,left=0,top=0,toolbar=No,location=No,scrollbars=No ,status=No,resizable=No,fullscreen=No'); void(0);");
}




It works fine when tested on my own computer, and it also works when uploaded to my server, but nothing happens when uploaded to the band's server???
Any suggestions?
And if you know why, what can be done??

View Replies !    View Related
For Some Reason My Flash Movies Stopped Working
If you check out the video section of my website at http://www.jonbarron.org/video/video.php and try clicking on any of those videos (which are videos I made in Flash 8 by the way) you will notice that none of them ever load. I tried them in IE, Firefox, and Safari and in Safari they don't load the first time but if you refresh the page they load just fine. The funny thing is that in IE they don't load AT ALL even if you refresh the page.

The even funnier thing is that last week ALL of these videos loaded fine in every single browser out there. Since then I haven't touched a single one of these pages so I'm wondering what in the heck could be going on here. Any ideas guys?

View Replies !    View Related
Give Me One Good Reason Why My Basic Code Cant Be Bothered To Work, Please.
Ok, so ive got this game im working on, but the idea is that u accerate into thae square and it goes to a frame which playes u doing the jump...
Funnily enough it dosent work, heres the fla file to download.

So in short my problem is my hitTest script isnt working, the red square out side the playarea shuold make it work but it dosent.

please help me thx very much, any help will be appricated. if u even view the thread plz post!

View Replies !    View Related
Give Me One Good Reason Why My Basic Code Cant Be Bothered To Work, Please.
Ok, so ive got this game im working on, but the idea is that u accerate into thae square and it goes to a frame which playes u doing the jump...
Funnily enough it dosent work, heres the fla file to download.

So in short my problem is my hitTest script isnt working, the red square out side the playarea shuold make it work but it dosent.

please help me thx very much, any help will be appricated. if u even view the thread plz post!

View Replies !    View Related
Btns Stop Working For Some Reason-intermittent Script Problem
Some buttons I've created in a slide out movie clip stop working after about a minute of just sitting there. I cannot figure out why in the heck these buttons just stop working all of a sudden. there doesn't seem to be an obvious trigger for this problem—it seems like the event listener just stops listening all of a sudden. it isn't a scope problem as the btns will work fine for awhile.

I have runt this by a number of folks here at work and none of us can figure out why this happens or even what triggers it. A real mystery.

As I said: this appears to be an intermittent problem and it isn't obvious what is wrong until you explore the website and let the various content load up. Here is a quick link to the site:
http://wmsrite.com/test

You will be my hero if you can figure out what is going on to interfere with the listener.

Thanks.

A sample of the AS I am using follows:

_root.slide.single.onRelease = function() {
_root.gotoAndPlay("single");
};
_root.slide.multi.onRelease = function() {
_root.gotoAndPlay("multi");
};
_root.slide.story.onRelease = function() {
_root.gotoAndPlay("story");
};
_root.slide.inter.onRelease = function() {
_root.gotoAndPlay("interact");
};
_root.slide.wet.onRelease = function() {
_root.gotoAndPlay("wet");
};
_root.slide.written.onRelease = function() {
_root.gotoAndPlay("written");
};
_root.slide.contact.onRelease = function() {
_root.gotoAndPlay("contact");
};
_root.slide.blog.onRelease = function() {
_root.gotoAndPlay("blog");
};

View Replies !    View Related
I Need Some Basic Help Getting My Pseudo Code Into Working Code
id appreciate a hand from you guys, if you could.

ive got a fla (575x431) that im making for an image gallery.... i will have 20 images that will be icons probably 40-50% smaller than the full size image these will be movie clips that i will assign a very slow random movement to
i think that i have the random part ok, i just need some help with this part...

pardon me if my terminology isnt right..

If mouse (over) a mc, then;
stop mc, show mc label, title.

If mc is clicked, then;
enlarge scale of mc (ie, 100%) and center it on the stage.

If mouse (out) then;
return mc size to its former state and continue moving randomly.


hope this makes sense would really appreciate some direction....

thanks alot

løk

View Replies !    View Related
MX Code Not Working In 5?
i have used the following code for a scrolling text button. does this code need flash 6 player. i have just tested on a computer and i believe they only have flash 5 player and the buttons did not work.

onClipEvent (enterFrame) {
if (lPressed) {
_root.textAbout.scroll += 1;
setProperty("_root.scrollUpButton", _alpha, 100);
}
}

View Replies !    View Related
Why Isn't This Code Working?
flash 5


Code:
function wait(){
starttime=getTimer();
stoptime=getTimer() + 3000;
while(starttime < stoptime){
_root.mycardback._alpha = 0;
_root.mydeck._visible=true;
_root.yourcardback._alpha = 0;
_root.yourdeck._visible=true;
starttime=getTimer();
}
_root.wincard();
}


Í'm expecting this function (called "wait"), when called, to pause for 3 seconds and process all 4 of the _root., and then when finished (still showing the _root.) to call the function "wincard".
When I call this function, it does wait for 3 seconds, and then move on to call function wincard, but it doesn't seem to process the _root. (ie the visible settings are still set to false, and the alpha settings are still set to 100).
Can anyone shed any light on this?
Thanks

View Replies !    View Related
Code Not Working - Please Help
Hi,

i have been having trouble with this code. if the users input from two textfields match the corresponding array items this should go to the next scene, if not it will display the error text. All this does is display the error text. No matter what!


on (press) {
user = ["harry", "karen", "mine"];
passes = ["mine", "hers", "too"];
logged = _root.login.text;
passed = _root.passer.text;
for (var i = 0; i<user.length; i++) {
if (user[i] == logged && passes[i] == passed) {
_root.gotoAndPlay("userCalendar", 1);
break;
} else if (i == user.length-1) {
_root.message.text = "Username or Password invalid. Please try again. ";
_root.message.text += "If you feel you are recieving this message in error, contact the webmaster";
}
}
}

View Replies !    View Related
Code Not Working
i have a main movie w/c is draggable and zoomable where i drag another movie on top of it. Each have its own instance names. my problem is my main movie is the only one that ca be drag and zoom.

i created a hit button and placed this as on it;
here's the code;

on (press) {
startDrag(MovieClip1 Instance name. MovieClip2 Instance name);
}
on (release) {
stopDrag();
}

thanks in advanced!!!!

View Replies !    View Related
Php Code Not Working Right
True or false.....

If I have a input text field in a MC thats in a MC, that changes the variables that are sent to the form. So var(email)on the text field is no longer var(email) but now likemc1.mc2.var?????

Im so lost.....

All I know is the input text is not sending the variable entries to the php form, and I wanna know if it has to do with the fast that the input text fields are included in MCs and not just chillin in the main time line...

View Replies !    View Related
Code Not Working At All
About a month or two ago i was making a game, and i restarted my work today, but i realized i had forgotten everything, and now i cant figure out why my code to send out a random MC isnt working, any why my MC's arent even moving when they have animations. Any help is appreciated

View Replies !    View Related
Why Isn't This Code Working?
got 7 buttons each sets variable (WhereNext) to a number 1-7

e.g.
on (release) {
WhereNext = 1;
gotoAndPlay(5);
}

the play head thing then plays to the end of the scene where there is an action assigned to the last frame which says

stop();
if (WhereNext = 1) {
gotoAndPlay("Green Creature Scene", 1);
} else {
if (WhereNext = 2) {
gotoAndPlay("Red Creature Scene", 1);
}
}

It jus keeps going to the first one "Greens Creature Scene"

Any help?

*edit Using Flash MX by the way!

View Replies !    View Related
This Code Is Not Working Immediate Help Please
HI I thought that this was working but it is not. I get it to play the first swf but then it wont play the next. On the last frame of every swf I have this code:

stop();
_level3.nextFrame();

On each frame with exception to the first frame that as a fscommand for fullscreen and not scale.

I have this on each frame

stop();
loadMovieNum("orient_mov_b.swf", 3);

each movie is labeled as such: orient_mov_a.swf, orient_mov_b and so on up to the letter f. I need all of these movies to run one after the other.

What is wrong with the coding.

Please help.

View Replies !    View Related
Working With .fla Code I Have Never Seen
I have a program called "Album Creator 3.3" by www.firmtools.com; They have been so kind as to give me the source files for one of their themes in hopes that I can customize it to my specs... However this is some flash that I have never seen before... So I am hoping I can find someone who can help me discover how I can do the following...

Inside of the linked ZIP file is the following...
http://www.ikandigraphics.com/greebo2.zip

1: geebo2 Directory - Source .fla files for out calling to local XML

2: album_title_feild - The end product from the exportation thru Album Creator Pro 3.3.

I would like to have the ability to add a function button inside of the geebo2 file(s) that will send out a URL with the following syntax

The fullname of the text field object is _main.tb.AlbumName and the corresponding variable is _main.tb.AlbumNameText

That feild placed into a getURL command of the follwing example http://www.url.com/dir/cart.php?Albu..._NAME_IMG_####

View Replies !    View Related
Why Is This Code Not Working
Hi Im having a problem when setting a var for coulor gradient matrix the error come up on the following line of code:

var oMatrix:Object = (matrixType = "box", x:0, y:0, h:100, w:100, r:0);

OutPut returns:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 6: ')' expected
var oMatrix:Object = (matrixType = "box", x:0, y:0, h:100, w:100, r:0);

Total ActionScript Errors: 1 Reported Errors: 1

I just dont understand this why would it except a ) i have an opening and closeing on in there.....

View Replies !    View Related
[F8] HELP Code Not Working
HI. It's been a while since my last post ( that sounds so AA, doesnt it?)LOL

I am pulling my hair out here. What works on once mc, doesnt work on another. Please chack out the .fla: /site_flash/flash

Stupidly, I bought a template, thinking it would save me time. NOT!!

I have 8 "Pages" - and 7 different galleries. I thought I figured out the pattern in the code, but when I got to #3, it went all wacky.

Can someone shed some light?

Also, I'm looking to break this up into indiviual movies. Each "page" is huge, so for loading speed, want to separate. Will tackle this last..

TIA,
Deb

View Replies !    View Related
[F8] Code Not Working.
I have a Movie in which bullets are to be fired by the Ctrl key press. But this is not happening. Can I get help on this please!

Code:
var vel=20;
var vx;
var vy;
var rt=0;
var fr=0;
var i=0;
turret.onEnterFrame=function(){
if(Key.isDown(Key.UP)){
rt++;
}
if(Key.isDown(Key.DOWN)){
rt--;
}
if(Key.isDown(Key.CONTROL)){
fr=1;
}else{
fr=0;
}
turret._rotation=rt;
}
if(fr==1){
ballm=_root.attachMovie("ball", "ball"+i, 100+i,{_x:300,_y:200});
i++;
}
ballm.onEnterFrame=function(){
if(fr==1) {
vx = vel*Math.cos(rt*Math.PI/180);
vy = vel*Math.sin(rt*Math.PI/180);
ballm._x+=vx;
ballm._y+=vy;
}
}
stop();
also attached the FLA (F8)

View Replies !    View Related
Code Not Working
I am creating a XML driven thumbnail gallery. Which works fine with this code:


Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;

var fadeTween:Tween;

var imageText:TextField = new TextField();

var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data.xml"));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();

for(var i:int = 0; i < xmlList.length(); i++)
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.x = 25;
imageLoader.y = i * 200 + 25;
imageLoader.name = xmlList[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);

}
}

function showPicture(event:MouseEvent):void
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
imageLoader.x = 250;
imageLoader.y = stage.stageHeight / 4;
addChild(imageLoader);
imageText.x = imageLoader.x + 200;
imageText.y = 600;
for(var j:int = 0; j < xmlList.length(); j++)
{
if(xmlList[j].attribute("source") == event.target.name)
{
imageText.text = xmlList[j];
}
}

fadeTween = new Tween(imageLoader, "alpha",None.easeNone,0,1,1,true);

}

imageText.autoSize = TextFieldAutoSize.LEFT;
addChild(imageText);




What my problem is, is I am trying to format the text in the dynamically created text field by doing this:


Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;

var fadeTween:Tween;

var imageText:TextField = new TextField();

var myFormat:TextFormat = new TextFormat();
myFormat.font = "Helvetica";
myFormat.color = "0xFF0000";
myFormat.bold = true;
myFormat.size = 25;
myFormat.kerning = 2;


var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data.xml"));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();

for(var i:int = 0; i < xmlList.length(); i++)
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.x = 25;
imageLoader.y = i * 200 + 25;
imageLoader.name = xmlList[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);

}
}

function showPicture(event:MouseEvent):void
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
imageLoader.x = 250;
imageLoader.y = stage.stageHeight / 4;
addChild(imageLoader);
imageText.x = imageLoader.x + 200;
imageText.y = 600;
for(var j:int = 0; j < xmlList.length(); j++)
{
if(xmlList[j].attribute("source") == event.target.name)
{
imageText.text = xmlList[j];
}
}

fadeTween = new Tween(imageLoader, "alpha",None.easeNone,0,1,1,true);

}

imageText.autoSize = TextFieldAutoSize.LEFT;
addChild(imageText);

imageText.setTextFormat(myFormat);


And the text doesn't format, what am I doing wrong?

View Replies !    View Related
[F8] Why Isn't This Code Working?
Hey all,
So, I have a sound playing in the background of my animation. A loop of birds chirping. It's stored in a movie clip, birdloop. At one point, I use the following ActionScript:


Code:
birdloopsound = new Sound(birdloop);
birdloopsound.setVolume(0);
From what I've learned of AS so far, this should mute the loop, but it doesn't. The movie clip birdloop is still present on the root timeline, although it's no longer playing, having been stopped by its own timeline. Any idea how I get this loop to mute???

View Replies !    View Related
Code Not Working
I have adde one button on a popUpManager in my application. I want to send a mail to the specified address after clicking on it.

Please check the following code (It's not working). The instance name of the button in the .fla file is given as helpBt.


import mx.utils.Delegate;
import mx.core.UIObject;
import mx.controls.*;
import mx.managers.PopUpManager;
import mx.containers.Window;

class Options extends UIObject{
public var helpBt:Button;
public var delegateHelp:Function;
public function Options(){
init();
}

private function init():Void{
helpBt = Button(createClassObject(Button, "helpBt", 7,{_x:577, _y:29, _width:77, _height:22,falseUpSkin:"help_etat1",falseDownSkin: "help_etat1",falseOverSkin:"help_etat2"}));
delegateHelp = Delegate.create(this,this.handleClickHelp);
helpBt.addEventListener("click", delegateHelp);
}
public function handleClickHelp(event):Void{
var cp:String;
var w:Number;
var h:Number;
var emailH:MovieClip;
if(_root.admin =="ok"){
w=650;
h=650;
cp = "helpAdmin"
}else{
w=650;
h=450;
cp = "help";
}
mapopup = PopUpManager.createPopUp(this, Window, true,{title:"Help",closeButton:true,_width:w,_heig ht:h,_x:200,_y:50,contentPath:cp});
mapopup.addEventListener("click",mapopup.deletePop Up);
mapopup.content.emailH.onPress = function(){
getURL ("mailto:abc@xyz.com " + "&subject=Help mail")
Alert.show("E-mail","Help", Alert.OK,_root);
}
}
}

View Replies !    View Related
Code Not Working
I have added one button on a popUpManager in my application. I want to send a mail to the specified address after clicking on it.

Please check the following code (It's not working). The instance name of the button in the .fla file is given as helpBt.


ActionScript Code:
import mx.utils.Delegate;
import mx.core.UIObject;
import mx.controls.*;
import mx.managers.PopUpManager;
import mx.containers.Window;

class Options extends UIObject{
public var helpBt:Button;
public var delegateHelp:Function;
public function Options(){
init();
}

private function init():Void{
helpBt = Button(createClassObject(Button, "helpBt", 7,{_x:577, _y:29, _width:77, _height:22,falseUpSkin:"help_etat1",falseDownSkin: "help_etat1",falseOverSkin:"help_etat2"}));
delegateHelp = Delegate.create(this,this.handleClickHelp);
helpBt.addEventListener("click", delegateHelp);
}
public function handleClickHelp(event):Void{
var cp:String;
var w:Number;
var h:Number;
var emailH:MovieClip;
if(_root.admin =="ok"){
w=650;
h=650;
cp = "helpAdmin"
}else{
w=650;
h=450;
cp = "help";
}
mapopup = PopUpManager.createPopUp(this, Window, true,{title:"Help",closeButton:true,_width:w,_heig ht:h,_x:200,_y:50,contentPath:cp});
mapopup.addEventListener("click",mapopup.deletePop Up);
mapopup.content.emailH.onPress = function(){
getURL ("mailto:abc@xyz.com " + "&subject=Help mail")
Alert.show("E-mail","Help", Alert.OK,_root);
}
}
}

View Replies !    View Related
Code Not Working
I have adde one button on a popUpManager in my application. I want to send a mail to the specified address after clicking on it.

Please check the following code (It's not working). The instance name of the button in the .fla file is given as helpBt.


import mx.utils.Delegate;
import mx.core.UIObject;
import mx.controls.*;
import mx.managers.PopUpManager;
import mx.containers.Window;

class Options extends UIObject{
public var helpBt:Button;
public var delegateHelp:Function;
public function Options(){
init();
}

private function init():Void{
helpBt = Button(createClassObject(Button, "helpBt", 7,{_x:577, _y:29, _width:77, _height:22,falseUpSkin:"help_etat1",falseDownSkin: "help_etat1",falseOverSkin:"help_etat2"}));
delegateHelp = Delegate.create(this,this.handleClickHelp);
helpBt.addEventListener("click", delegateHelp);
}
public function handleClickHelp(event):Void{
var cp:String;
var w:Number;
var h:Number;
var emailH:MovieClip;
if(_root.admin =="ok"){
w=650;
h=650;
cp = "helpAdmin"
}else{
w=650;
h=450;
cp = "help";
}
mapopup = PopUpManager.createPopUp(this, Window, true,{title:"Help",closeButton:true,_width:w,_heig ht:h,_x:200,_y:50,contentPath:cp});
mapopup.addEventListener("click",mapopup.deletePop Up);
mapopup.content.emailH.onPress = function(){
getURL ("mailto:abc@xyz.com " + "&subject=Help mail")
Alert.show("E-mail","Help", Alert.OK,_root);
}
}
}

View Replies !    View Related
Help: Working On Someone Else Code
Hi I am working on some clients website where i am working on someone else code. the code is below and it gives error in the out put window.

ActionScript Code:
sizeratio = 1.400000;
spacing = 0.900000;
speed = -28;
stopgap = 20;
picsize = 100;
pics = 10;
p = 1;
Pic10/:_urlpath = 15;
Pic9/:_urlpath = 21;
Pic8/:_urlpath = 17;
Pic7/:_urlpath = 26;
Pic6/:_urlpath = 20;
Pic5/:_urlpath = 23;
Pic4/:_urlpath = 26;
Pic3/:_urlpath = 17;
Pic2/:_urlpath = 24;
Pic1/:_urlpath = 18;
while (Number(pics) >= Number(p))
{
    set("Pic" add p add "/:_depth", p + 21);
    set("Pic" add p add "/:p", p);
    "Pic" add p._x = p * (spacing * picsize);
    p = Number(p) + 1;
} // end while
topscale = 100 * sizeratio;
lowscale = (pics * 100 - topscale) / (pics - 1);
wide = getProperty(border, _width);

out put widow error is

ActionScript Code:
**Error** Symbol=Symbol 62, layer=Action Layer, frame=1:Line 22: Left side of assignment operator must be variable or property.
         "Pic" add p._x = p * (spacing * picsize);

Total ActionScript Errors: 1     Reported Errors: 1

Please help me to fix this code.
thanks

View Replies !    View Related
Code Is Not Working
Code:
for (i=1;i<=66;i++) {

var target_mc = _root.["btn"+i];

target_mc.onPress = function() {

var t = Math.round[Math.random(2)+ 2];

var m = Math.round[Math.random(2)+ 2];

_root.["popped"+i].gotoAndPlay(t);

_root.pop_sfx.gotoAndPlay(m);
}
}
I have 66 buttons i.e. btn1 btn2 btn3 and so on.

and 66 instances of popped movieClip on the stage i.e. popped1 popped2 and so on.

i need the corresponding popped movieClip to gotoAndPlay(randomframe) when I push its btn

so if I push btn1 popped1 would go to randomframe?

am I on the right track?

View Replies !    View Related
Code Not Working With AS 2.0
I am using the following code to populate a list box reading from ASP. It works fine in Flash 6 but the list box fills with "undefined" when publishing in Flash 7 or higher.


Code:
myVars = new LoadVars();
if (strCategory != "") {
myvars.strCategory = strCategory;
myVars.onLoad = function(){
//populate the list box
songListBox.removeAll();
for (i=0; i<=myVars.count; i++) {
songListBox.addItem(eval("myVars.song"+i));
}
}
songListBox.selectedIndex=0;
myVars.sendAndLoad("GetSongs.asp", myVars, "GET");
}
I can only assume that the problem is with eval.

Any idea what the problem could be?

Thanks

View Replies !    View Related
2+2=22 ? <code Not Working
Hi please help

my code is adding 2 variables as stings instead of mathmathical functions.

var1 = var2 + var3

its giveing me something like

2 + 20 = 220 or 2+3 = 23

I just need it to add the numbers can anyone help please

thanks

David

View Replies !    View Related
Code Not Working In WIN IE
ok so I've got my preloader problems aside (or so I thought) and well my file works fine in mac safari and in win firefox, but I tested it in win IE and I get this strange redraw issues regarding my loadin bars, I think flash is goign wacky and scaling them up huge and flickering them around the screen.. I searched a bit to no avail but is there any reason for this. I'm stumped since flash is a plugin and wouldnt the plugin be the same for each browser?

let me know if you can help.

cheers

View Replies !    View Related
Code Not Working.
I have a button that loads a text in to a dynamic text field that will render a html page. I have a scroll component attached to the text field wich is invisible When the text loads I want the scroll bar to be visible but ofcourse I don't know what is wrong with the code.


Code:
on (release){
var story:XML = new XML();
story.ignoreWhite = true;
story.load("page.html");

story.onLoad = function () {
txt_area.htmlText = story;
}
this.scroll._visible = (this.txt_area.maxscroll > 1);
}
Now .. the page is loading .. the html is ok ... but the scroll bar will only be visible on the second hit....and yes ... I am a beginer with actionscript flash.
Thanks.

View Replies !    View Related
Code Not Working
I am using the partial code below to keep the movieclip from following my mouse after i get to close to the sides of the flash window. It isn't working though-- any thoughts?







Attach Code

if (_root._xmouse>(Stage.width/4) && _root._xmouse<(Stage.width-Stage.width/4)) {
rvk.onEnterFrame = function() {
var xMouse = _root._xmouse;
if (Math.abs(xMouse-this._x)<1) {
this._x = xMouse;
} else {
this._x -= (this._x-xMouse)/100;
}
};
}

View Replies !    View Related
Code Not Working
I created a flash file with my menu on it and hyperlinks to the various pages. I am having issues with getting it to work in explorer. I couldn't get it to work in firefox until I changed the code to this:

on (release) {
getURL("./photos.htm");
}

Then I checked it in Explorer and it does nothing when I click on it.
What is going on????? Why wouldn't explorer recognize the same code?

View Replies !    View Related
[FMX]Why Isn't This Code Working?
I saw a topic about loading movies with transtions. This is the link:

http://www.kirupaforum.com/forums/sh...1&page=1&pp=15

For myself I used loop to identify my buttons. Like this:

Code:
for (var i in this){
if (this[i]._name.substr(0, 4) == "btn"){
setButton (this[i]._name);
}
}
And the setButon function like this:

Code:
function setButton (clip){
var clip = eval(clip);
clip.onRollOver = function(){
// Rollover stuff here
};
clip.onRollOut = function(){
// RollOut stuf here
};
}
And than I integrated the code from the other topic in the onRelease like this:

Code:
clip.onRelease = function() {
if (_root.currMovie == undefined) {
_root.currMovie = this._name;
this._parent.container.loadMovie(this._name+".swf");
} else if (_root.currMovie != this._name) {
if (this._parent.container._currentframe>=this._parent.container.midframe) {
_root.currMovie = this._name;
this._parent.container.play();
}
}
};
But now when I press lets say btn_home the movie wants to load btn_home.swf while it should load home.swf

What am I doing wrong

Thank you in advance

View Replies !    View Related
This Code Seems To Be Not Working?
on (press) {
_root.mySlider.mySound.stop();
if (_root.mySlider.mySound.stop()) {
_root.dl = "Sound is Stopped...";
} else {
_root.dl = "playing";
}
}

this is on the stop_btn to stop music on playing and also show the text "Sound is Stopped" and as soon as the user click on play button the text is "playing"

but this code seems to be not working?

wats wrong with it?

help me

View Replies !    View Related
Code Not Working In AS2..
Hi
I have this code from
http://www.negatyve.net/EE/FScrollPa...llPaneForm.zip


ActionScript Code:
pane_sp.setScrollContent("form");h = pane_sp.getScrollContent()._height;trace(pane_sp.getScrollContent()._height);w = pane_sp.getScrollContent()._width; //trace("hPosition = " + pane_sp.hPosition + ", vPosition = " + pane_sp.vPosition); trace(h);elementCount = 1;morecheck_pb.setClickHandler("addCheckBox");moreradio_pb.setClickHandler("addRadioButton");moretext_pb.setClickHandler("addTextArea");//myTimer=SetInterval(draw_chart,200);//Call Draw Chart 50 timesfor(p=1;p<50;p++){draw_chart();}function addCheckBox(){ var sp = pane_sp.getScrollContent(); var mc = sp.attachMovie("FCheckBoxSymbol", "item" + elementCount, elementCount, {label:"new checkbox"});  mc._y = (h += mc._height + 10); mc._x = 10;  pane_sp.refreshPane(); elementCount++;}function addRadioButton(){ var sp = pane_sp.getScrollContent(); var mc = sp.attachMovie("FRadioButtonSymbol", "item" + elementCount, elementCount, {label:"new radiobutton"});  mc._y = (h += mc._height + 10); mc._x = 10;  pane_sp.refreshPane(); elementCount++;  }function addTextArea(){ var sp = pane_sp.getScrollContent(); var txt = ["item" + elementCount]; sp.createTextField(txt, elementCount, 10, h += 10, 200, 100); h += 100;  sp[txt].border = true; sp[txt].background = true; sp[txt].text = "Some new Text"; sp[txt].type = "input";  pane_sp.refreshPane(); elementCount++;}function draw_chart(){ w=w+40; var sp = pane_sp.getScrollContent();// pane_sp.hPageScrollSize = 2000;// pane_sp.setScrollPosition(200+x,100+y) // sp.createEmptyMovieClip("lines", 1000); //var mc = sp.attachMovie("FRadioButtonSymbol", "item" + elementCount, elementCount, {label:"new radiobutton"}); //trace("hPosition = " + pane_sp.hPosition + ", vPosition = " + pane_sp.vPosition);with(sp){ lineStyle(4, "0x000000",100); moveTo(x,350); lineTo(x+20,350+30); lineTo(x+40,350); x=x+40;// y=10+y;}pane_sp.refreshPane();}

This code is in AS1 from the original source. It doesnt works in AS2
My application is in AS2
When I changed the settings to AS1, this code works but most of the buttons got their text vanished and other strange things happened.
Can anyone tell me what to do?

View Replies !    View Related
Code Not Working?
I've been working on a preloader that will play a certain MC if a certain percent is load, this is my first attempt and wasn’t sure if this was the proper way to do. Well it doesn’t work and if anyone could take a look at the AS and give me some pointers and help me it would be greatly appreciated.

Thanks

View Replies !    View Related
XML Code Not Working
Hi,

I got some XML Code off your Website....The interesting thing is that, the code does work for some but refuses to work somewhere else...which is strange....


Code:
//Data.XML
<?xml version="1.0"?>
<disptext>
<firstcontent>
<name>Counsellor</name>
</firstcontent>
<secondcontent>
<name>Prince of Peace</name>
</secondcontent>
<thirdcontent>
<name>Saviour</name>
</thirdcontent>
<fourthcontent>
<name>Your Text</name>
</fourthcontent>
</disptext>
The code to display this in Flash is here....

Code:
function loadXML(loaded) {
if (loaded) {
//populating the text fields
_root.ftext = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.sectext = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
_root.thirdtext = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
_root.fourthtext = this.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue;
firsttext.text = _root.ftext;
secondtext.text = _root.sectext;
thirdtext.text = _root.thirdtext;
fourthtext.text = _root.fourthtext;
} else {
trace("file not loaded!");;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("data.xml");
What i notice is that, it's loading the data for the first and second texts..but nothing afterward. I also interchanged the text fields (called the first one on the third), but still no luck.

I don't have the XML code on the very first frame, it's halfway down, but is that a problem ?...as 2 of my 4 text fields are updating. I don't understand why this happens. I hope someone can help me.

View Replies !    View Related
[FMX]Why Isn't This Code Working?
I saw a topic about loading movies with transtions. This is the link:

http://www.kirupaforum.com/forums/sh...1&page=1&pp=15

For myself I used loop to identify my buttons. Like this:

Code:
for (var i in this){
if (this[i]._name.substr(0, 4) == "btn"){
setButton (this[i]._name);
}
}
And the setButon function like this:

Code:
function setButton (clip){
var clip = eval(clip);
clip.onRollOver = function(){
// Rollover stuff here
};
clip.onRollOut = function(){
// RollOut stuf here
};
}
And than I integrated the code from the other topic in the onRelease like this:

Code:
clip.onRelease = function() {
if (_root.currMovie == undefined) {
_root.currMovie = this._name;
this._parent.container.loadMovie(this._name+".swf");
} else if (_root.currMovie != this._name) {
if (this._parent.container._currentframe>=this._parent.container.midframe) {
_root.currMovie = this._name;
this._parent.container.play();
}
}
};
But now when I press lets say btn_home the movie wants to load btn_home.swf while it should load home.swf

What am I doing wrong

Thank you in advance

View Replies !    View Related
This Code Seems To Be Not Working?
on (press) {
_root.mySlider.mySound.stop();
if (_root.mySlider.mySound.stop()) {
_root.dl = "Sound is Stopped...";
} else {
_root.dl = "playing";
}
}

this is on the stop_btn to stop music on playing and also show the text "Sound is Stopped" and as soon as the user click on play button the text is "playing"

but this code seems to be not working?

wats wrong with it?

help me

View Replies !    View Related
This Code Is Not Working...why?
Hi!

I have a MC on my stage that is only a rectangle.I've clicked on it and add this code to it:

ActionScript Code:
onClipEvent(load){
  loadMovieNum("sound.swf",1);
}
onClipEvent(enterFrame){
  var amountSoundLoaded : Number = _level1.getBytesLoaded() / _level1.getBytesTotal();
  bSom._width = amountSoundLoaded * 176;
  somText.text = Math.round(amountSoundLoaded * 100) + "%";
}


The bsom is a Bar that I am using to show the progress and it is a rectangle made into a MC.The bSom(Bar for showing sound loaded progress),somText(dynamic text) are all located on my main movie on the stage.Not insid any MC.

but it is not working...I am trying to show the progress of loading a swf file that contains my sound.

I was told to make an empty MC but it didnt work...

Can You help me?

View Replies !    View Related
<php> Code Not Working In AS
Hello,

I'm working on a photoblog and am building the "next" and "previous" links in Flash. The blog is PHP driven so the code to implement the next and previous function is as follows:

<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"></a> for example.

So in the AS I have:

this.onRelease = function(){

getURL("/index.php?showimage=<IMAGE_PREVIOUS_ID>");

}

But Flash is mis-reading the carrots < >. When I test the Flash files the URL that appears in the address window is:

http://www. ********* .com/index.php?showimage=%3CIMAGE_NEXT_ID%3E

It looks as though it is interpreting the carrots as %3c and %3E obviously.

Anyone know how this is fixed? I've tried a few different things (entering the full URL) but its the carrots that it seems to have issues with.

I do not use Flash much, so I have not ran into this before....

Thank you,

KGA

View Replies !    View Related
Why Isn't This Code Working?
Hi guys: I have this code in a button placed in the main timeline of my movie:

on (press){
gotoAndPlay(_currentframe-5);
}


and this sends the playhead 5 frames before its current position in the timeline. Now I place the same button inside a movieclip (the MC is also in the main timeline) and I change my code to this:

on(press){
_root.gotoAndPlay(_currentframe-5);
}

and nothing happens, the playhead stays in the same position. What's wrong with my code? I have also tried this:

on(press){
_parent.gotoAndPlay(_currentframe-5);
}
with no success!!, so folks... help please.

View Replies !    View Related
Bar Preloader Code Not Working
I have made a bar preloader using similar code from the tutorials but it is not working, just keeps going.

Example of the code I am using:
On frame 3
//if introduction scene is loaded play the preloader frame 5
ifframeloaded("Introduction", 165)
gotoAndPlay(5);
}
On frame 4
//if condition in frame 3 was not met, loop back to the
//preloaders frame 1
gotoAndPlay(1);

etc.......

I have tried specifing ("preloader",1) still does not work.

The quotes automatically get loaded in, should I take them out, is that the problem????
The tutorial also has framesended, but I can't find that in Flash 5, do I need it????

Help please.

Thanks in advance.

Taz

View Replies !    View Related
HELP GetUrl Code Isn´t Working
Here´s the code
on (release) {
getURL ("javascript:NewWindow=window.open('http://www.yahoo.com','newWin','width=600,height=600,left =0,top=0,toolbar=No,location=No,scrollbars=No,stat us=No,resizable=Yes,fullscreen=No'); NewWindow.focus(); void(0);");
}

It should open a new window without toolbars and that, but it seems that i have to put an ")" after the
'http://www.yahoo.com'
but if i do that it just opens me a normal window.
Don´t know what is missing...please, any help will be welcome, even other ways to do it.
Regards,
Silverscale

View Replies !    View Related
Getting Two Sets Of Code Working
my code is here:
http://www.aurora-watch.com/auroraLights3b.fla
i cant get both halfs of the prog to work, at the mo the future predictions is commented out as only one side will work at a time,
when i say work, the past data works in as much as it goes through its process ok, there is a server prob at the mo thats why no data is received
pleas help ive been playing with it for ages with no luck

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