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




Password Access Button



Hi everyb... I hope I can find some help here.. this is my first post but not the last.I've next problem. I'm working on a Intranet, in some area I need restriction, so, I'm using this as with a button to give access.on (release) {if (miUser eq "kmi" && miPass eq "Ea4gn2007") {nextScene();}}I use "==" and not "eq" but have the same problem.I'm publishing it in ActionS 2 from flash8 and flash cs3. but when I try to access, I write access data, user and pass then I click the buton but nothing happens, no error, no message, nothing... where is the problem???I'm using two input text boxes. Thank you.



Adobe > ActionScript 1 and 2
Posted on: 08/07/2007 12:33:07 PM


View Complete Forum Thread with Replies

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

Password Access
Im working on a website for a Counter-strike clan I'm in, and Im making it with Flash. There is a part in the site that I want to be totally hidden from anybody but the clan members. So i decided that I wanted to put a password text box. And only if you put theright password (which i will tell my clan members), you can get in. You see, I'm just starting on Actionscript so i don't really know much. I wanna be able to make it so it will only go to next frame if they type the right password in the text box...but I don't know how. I know it has to do something with actionscript. I have an idea about it in my head, but I tried it and it didn't work...could some1 plz help me out? Thx

Password And Ftp Access
hi fellows and happy new year, wish you all luck in flash AS and design.

I'm working on a password protected page. I've found an exemple who work well (multi user protected pages) but i was wondering how to redirect the user to is ftp account and of course without need to enter pass and username again?

cheers mates.

Multiple Password Access
I have one password that works if this is added to a button.
How do I allow multiple passwords to be excepted?

this works for one password...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "jonsmith") {
gotoAndPlay(60);
} else if (pass ne "jonsmith") {
gotoAndPlay("denied", 2);
}
}



working on this one...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "123-123-123","231-231-231","321-321-321") {
gotoAndPlay(60);
} else if (pass ne "123-123-123") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "231-231-231") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "321-321-321") {
gotoAndPlay("denied", 2);
}
}

Multiple Password Access
I have one password that works if this is added to a button.
How do I allow multiple passwords to be excepted?

this works for one password...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "jonsmith") {
gotoAndPlay(60);
} else if (pass ne "jonsmith") {
gotoAndPlay("denied", 2);
}
}



working on this one...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "123-123-123","231-231-231","321-321-321") {
gotoAndPlay(60);
} else if (pass ne "123-123-123") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "231-231-231") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "321-321-321") {
gotoAndPlay("denied", 2);
}
}

Multiple Password Access
I have one password that works if this is added to a button.
How do I allow multiple passwords to be excepted?

this works for one password...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "jonsmith") {
gotoAndPlay(60);
} else if (pass ne "jonsmith") {
gotoAndPlay("denied", 2);
}
}



working on this one...
----------------------------------------------------------------------------------
on (release, keyPress "<Enter>") {
if (pass eq "123-123-123","231-231-231","321-321-321") {
gotoAndPlay(60);
} else if (pass ne "123-123-123") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "231-231-231") {
gotoAndPlay("denied", 2);
}
} else if (pass ne "321-321-321") {
gotoAndPlay("denied", 2);
}
}

Ifelse Script For Password Access
hi thanks for the site it has been of great help to me. i have a problem with the if else code i am using to give access to my site. i am developing in flash mx 2004, when i run your ifelse_final.fla it works like a charm, when i re-write it or copy it into my flash doc i get a script error regarding the onrelease AS and how this can only be applied to a button (i have tried library buttons, your button and my own made buttons) - HELP, it is driving me crazy....

[Q] Disabling Parent's Button Access For Child's Button Access
Hi All,

Havent been to the forum in a long time due to an enduring school term
now that I have gotten back into it, I got into a slight problem

How do I disable the parent's onRelease attributes so that I can allow the child's onRelease function to run . It is a menuSystem where the parent shows first then the subMenu mc are attached to the main Menu.

I tried mc.enabled = false, but this disables the child button actions as well
I tried mc.onRelease = null; which doesnt seem to work
I tried delete this.onRelease BUT maybe cause of syntatical errors, theres no response

Thanks all

How To Put A Password On A Button
Hi

I am currently using flash MX and i am unsure of how to put a password on a button so that when you click on it the password menue will pop and ask you to enter the password before entering that button.

if you know how please reply to this post or e-mail me at bsbsk78@hotmail.com

thank you

How To Put A Password On A Button ?
I have a site up, And im working on a private tactic movie that i only want a few people to have access too. So , i was thinking to have this link secure some how. The only way to enter it would be to click through the button. Once you click the button, it will ask you for a password . When you enter the password it will send you to the movie link.

So adding a password to a link is one thing i need to know how to do. Also, once the person reaches that link. I dont want it to show the url . So if they copy past the url from the box in explorer and put it in again the movie will play. I only want it to be able to go through the button with the pw, it should not show where its actually located on the host directory...

If anyone could tell me how to do this i would be in great debt. A tutorial would be good also. I just cant find anything on passwords...

Password Protected Button
can u put a password on a button?

Password Check On Button
Hi as you can probably guess I am not a programmer and I am fairly new to Flash.

I have got the following code working on a button. I have a text box where the user adds his password and a combo box for the user to select the area he wants to go to. The on release part works to my amazement.

on (release) {

if (myInput == "XXXX" && Selectme.getValue() == "222") {
goToAndStop("welcome");
}
else if(myInput == "YYYY" && Selectme.getValue() == "333") {
goToAndStop("part1");
}
else if (myInput == "ZZZZ" && Selectme.getValue() == "444") {
goToAndStop("part2");
}
else if (myInput == "HHHH" && Selectme.getValue() == "555") {
goToAndStop("part3");
}
else {
goToAndStop("wrong");
}
}

I need the enter button on the keyboard to also work along with the click of the button. When I upgraded to Flash CS3 it stopped working. Can anyone help?
Both scripts are on the same button.

on (keyPress "<Enter>")
if (myInput == "XXXX" && Selectme.getValue() == "222") {
goToAndStop("welcome");
}
else if(myInput == "YYYY" && Selectme.getValue() == "333") {
goToAndStop("part1");
}
else if (myInput == "ZZZZ" && Selectme.getValue() == "444") {
goToAndStop("part2");
}
else if (myInput == "HHHH" && Selectme.getValue() == "555") {
goToAndStop("part3");
}
else {
goToAndStop("wrong");
}

How To Password Protect A Movie, Password Scrn With Multiple Frames
I'm trying to password protect one of my flash 5 clips but if the password entree screen has only one frame then anyone who wants acces the site can just right click and press "play". I need a way of disabling the right click menu on my movie, if thats impossible then I need a way of making the password enter screen multiple frames.
Help please!

Password Protect A Flash Button
I have a Flash site and I have a Button that i need to password protect...How do i Do this?
This is the site...the button i need to pw protect is members only....
http://bigdrunkpat.home.insightbb.com/home2.html
Thanks in advance..

[F8] Hit Enter Instead Of Button On Password Gate
I'm using the password gate found here:
http://www.flashkit.com/movies/Scrip...7689/index.php

I'd like to be able to hit the enter key after typing the password rather than having to click the button. Anybody know how to do this?

Easy User-password Button... Cant Get It To Work
I have 2 fields user and pass for the user name and password... i cant get the button to work....

code:
SEE CODE IN LAST EXAMPLE!!!


THANKS A MILLION IN ADVANCE!!!
-manny

Button._focurect Disables Also Button Keyboard Access
I'm trying to make my Flash movie keyboard-accessible.
It's a search engine control panel, with a drop list for categories, a textfield and a Search button.

I have set a "halo" effect to enhance the GUI element currently under focus, for both keyboard and mouse interaction.

Everything works fine if I leave the _focusrect active, but it's really ugly and I want to eliminate it.

Unfortunatelly when I set Button._focusrect = false, the buttons recieve focus but are not "pushed" when I press the spacebar (I tried to add Key-specific triggers to a button, but that doesn't work either).

Does anybody know how to help this?

p.s. I already set all the tabIndex stuff...

Needcoding Help Bad.. Button To Input Text/ Login-Password Box
Brief Statement:
I'm currently in the process of creating an advanced member login to my new website. I'm fairly new to the web lingo and creation world. I know ALOT (Technical) about computers but quite frankly know jack squat about web development, creation, and design. I am however starting to grasp onto Studio MX rather fast, especially Flash. So this is only for peeps who know a fair deal about flash and dreamweaver and are willing to help a newbie create a fairly advanced website.

Brief Project Specs:
Sorry no pictures at the time so this project is not for the visually illiterate...
Ok first the user will goto the members link on the menu (main site). When they get there a small number pad will appear (Blue semi-transparent artfully designed box like the number pad). They can either type in the 6 digit numeric code or punch it in via mouse click and press or click enter.

There will be 3 levels:

-Members
-Site Tech/Employees
-Site Manager

each with a static code (non-changing per user)
that must be typed.

ex.
Level 2 Clearance: 532840
Level 3 Clearance: 297543
Level 4 Clearance: 324095

if they enter the wrong code an Access Denied screen (red semi-transparent artfully designed box like the number pad) will appear and will automatically forward them back to the main page in 2 sec.

if they enter the right code an Access Granted screen (green semi-transparent artfully designed box like the number pad) will appear and will automatically forward them to their particular level clearance in 2 sec.

after they get pass the number pad

an additional login screen will appear
asking for their individual login id and password
each login screen will be color coded according to access level
ex:

Member (orange semi-transparent artfully designed box like the number pad)

Site Tech/Employee (yellow semi-transparent artfully designed box like the number pad)

Site Administrator (purple semi-transparent artfully designed box like the number pad)

if they enter the wrong code an Access Denied screen (red semi-transparent artfully designed box like the number pad) will appear and will automatically forward them back to the main page in 2 sec.

if they enter the right code an Access Granted screen (green semi-transparent artfully designed box like the number pad) will appear and will automatically forward them to their particular level clearance site page in 2 sec.

lastly this will all be on a black background webpage.

I will create all this stuff, I already now how to create the graphics such as the boxes.

I have already created the number pad with the buttons and the numeric password box but now i need to know how to make the number buttons on the pad input thier respective number in the numeric password box by mouse click. In additon the buttons light up when u click on them. I would also like to make the option of simply typing the numbers in and as there being typed in the buttons act as if they were being clicked by the mouse.

I hope all this stuff isn't too hard. Trust me i believe i'm making it sound harder than it is, simply cuz i've done most all the animated graphic designs but none of the Action script. I know a lil bit about computer programming. If u r interested in helping me and wish to see what i've gotten accomplished e-mail me a JazzkidPhD@yahoo.com

P.S. i normally don't talk this much, lol, but felt i should compensate text for not having pics. Also the site itself has not been built yet so ne parts of the code that need the site inputed will just have to be left blank. (ex. code code code "XX")

Password Protection W/ E-mailed Password
I need a password protection gate that E-mailes a password to the visitor if they pay to enter the site. I really need this or I can't take this job I got. Please help. If can be anything like .html, .swf, .php, .etc.

I'm just a flash designer and I don't have a ton of knowlege in programing outside of flash and html.

Thanks!!!

Access To A Button
I have a .fla with 3 frames. I'm trying to access to a button ("btnAdvance") placed in the second frame at the main timeline from the document class (DC). I tried this, but don't works:

Código :


ActionScript Code:
package {
   import flash.display.*;

   public class DC extends MovieClip {
      function DC() {
         gotoAndStop(2);
         trace(getChildByName("btnAdvance"));// null
      }
   }
}

Could somebody help me with this?
Thanks.

How To Access Movie Into Button ?
Hi all V: Flash MX

suppose that I have A Effective movie into environment button

where the up & over & down & hit places

name of this movie is effectClip as an instance name


is there anyway to access this movie by action ?

I tried many ways to but no effect on it

something like this

myButton.onPress = function () {

this.effectClip.gotoAndPlay(2);
}

please someone help

bye

Access Dynamic Mc's With A Button
I am having the hardest time trying to figure out how to access a group of dynamically created movieclips with a button that is outside of where they are defined. here's the code I am working with.


Code:
masterHouse = _root.housesHolder.multiHolder.attachMovie("multicom_house", ["multicom"+j], _root.housesHolder.multiHolder.getNextHighestDepth(), {_x:mX[j], _y:mY[j]});
housesHolder.multiHolder being the containing clip that the dynamic houses are placed in. I need to do something like:
button.onPress = function() {
houses.slideTo(x,y);
}

Any help would be great. Thanks!

Access Mc Inside Button?
MX 2004 Pro:
I need to change the color of an MC instance (Test1) that is on the UP frame of a button (btnTest).


ActionScript Code:
trace(btnTest.Test1._width)
returns "undefiend". But when I turn the button into a MovieClip:
ActionScript Code:
trace(mcTest.Test1._width)
returns a correct value, meaning, I can access Test1.

Is there a way to access MC instances inside a button?

Button Can't Access Its Variables?
Alright so: I created an instance of a button that I created, and in the code for that instance I put

on (press) {
trace (this._name);
}

I've also tried with this._x and this._y, and it's convinced that they don't exist because it always prints just a return in the output window.... what is going on? Why can it not access its own properties?

Access To A Button's Variable
I have a button who's instance is "btn_free"
I am assign a variable in my button.
Do I have access to this value outside "btn_free" or what is the best way to access a value that is assigned in a button's action script

actionscript in my button, “btn_free” that is assign a value to mystring.

PHP Code:



on (press) {    
     var myString:String;
    trace("I am at button btn_free");
    this.myString = "value from button btn_free"






In my layer1:frame1 I have the following actionscript

PHP Code:



btn_arc.onPress = function() {
    trace("hello from btn_arc")
    trace(btn_free.myString);





where I am attempting to get the value from the “btn_free”

PHP Code:



trace(btn_free.myString); 




This however, does not work.... btn_free.myString I get a undefined error.

Access Button In Loaded SWF
ok....

i loaded an external swf and dropped it in a SWF...

Code:
var container_mc:MovieClip = new MovieClip();
quizLoader.load(quizRequest);
container_mc.addChild(quizLoader.content);
loads just perfectly...

now...i need to access a button in that swf to add an event listener...

i have...


Code:
container_mc.submit_btn.addEventListener(MouseEvent.MOUSE_UP, funct);
i get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.

what am i doing wrong?? its not an empty movieclip cause i used a condition to check if container_mc.content == null...the button exsists on the external SWfs stage.

please help....thanks

Access Dynamic Mc's With A Button
I am having the hardest time trying to figure out how to access a group of dynamically created movieclips with a button that is outside of where they are defined. here's the code I am working with.


Code:
masterHouse = _root.housesHolder.multiHolder.attachMovie("multicom_house", ["multicom"+j], _root.housesHolder.multiHolder.getNextHighestDepth(), {_x:mX[j], _y:mY[j]});
housesHolder.multiHolder being the containing clip that the dynamic houses are placed in. I need to do something like:
button.onPress = function() {
houses.slideTo(x,y);
}

Any help would be great. Thanks!

Cannot Access Button Instance
I am new to flash. I created a movie clip symbol. I instantiated the movie clip and placed a "play" button on it. I have instantiated the button as playBtn but I cannot access it from AS3. I get the error "Access of undefined property playBtn". Can someone help me?





























Edited: 05/22/2008 at 09:17:00 AM by olosko

Access Button Inside Movieclip
Hey Everyone,

I am not that familiar with Flash yet, so I have trouble accessing a button inside a Movieclip that I have loaded by using the loadMovie command.
code:
createEmptyMovieClip("menu",1);
menu.loadMovie("menu1.swf",1);

menu.button.onPress = function(){
trace("works");
}

My movie loads fine and my button has the instance name button. So that should not be the problem.

Thanks for any help,
Andy

Access A Button Within A ScrollPane (pain)
I am trying to access a button that I have in a scrollPane to change it's active state. This happens on a cuepoint in my video. Here is my script..
------
listenerObject = new Object();
listenerObject.cuePoint = function(eventObject) {
if (eventObject.cuePointName == "cp_2") {

_root.TitlesMC.button2_btn._visible = false;

trace("Cuepoint Passed");
}
};
myVideo.addEventListener("cuePoint", listenerObject);
-----

My scrollPane points to a movie clip called "TitlesMC" which contains a button called "button2_btn". I can't seem to access it.

If I put a button out in the main movie and point to it there, it works great - but the button in a movie clip within the scroll pane - can't access it.

Thanks -
Jmac1

AttachMovie/button Access Problem
Hi I'm trying to do something seemingly simple but it is proving really frustrating.

Basically I have a movie that fades in an image (mc_splash). Once you click on the image it moves that image off the screen and uses attachMovie to load a movie clip (mc_thumbs) with has a bunch of other movie clips (mc_thumb_00001 - mc_thumb_00015) which act as buttons (rollovers, onReleases etc.)

The problem is that if i have the attachMovie in the onRelease function of mc_splash I can not access my buttons in mc_thumbs unless i put the button functions in mc_thumbs.

However if i take the attachMovie function out of the onRelease function and just have it load at the opening of the movie it works fine with the button functions in the root.

Working:
Code in root:

Code:
_root.mc_splash.onRelease = function() {
_root.mc_splash._x = 5000;
_root.attachMovie("mc_thumbsLoader", "mc_thumbs", 1);
_root.mc_thumbs._x = 458;
_root.mc_thumbs._y = 36;

}


Code in mc_thumbs:

Code:
var thumbsPath = this;

thumbsPath.mc_thumb_00001.onRollOver = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(2);
}

thumbsPath.mc_thumb_00001.onRollOut = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(1);
}

thumbsPath.mc_thumb_00001.onRelease = function() {
trace ("hitting mc_thumb_00001");
_root.attachMovie("mc_imageLoader", "mc_imageLoader_00001", layerDepth);
_root.mc_imageLoader_00001.loadMovie("skin/original/images/portfolio/00001.jpg");

}


Not working:
Code on root:

Code:
_root.mc_splash.onRelease = function() {
_root.mc_splash._x = 5000;
_root.attachMovie("mc_thumbsLoader", "mc_thumbs", 1);
_root.mc_thumbs._x = 458;
_root.mc_thumbs._y = 36;

}

var thumbsPath = _root.mc_thumbs;

thumbsPath.mc_thumb_00001.onRollOver = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(2);
}

thumbsPath.mc_thumb_00001.onRollOut = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(1);
}

thumbsPath.mc_thumb_00001.onRelease = function() {
trace ("hitting mc_thumb_00001");
_root.attachMovie("mc_imageLoader", "mc_imageLoader_00001", layerDepth);
_root.mc_imageLoader_00001.loadMovie("skin/original/images/portfolio/00001.jpg");

}



Working but useless:
Code on root

Code:
_root.attachMovie("mc_thumbsLoader", "mc_thumbs", 1);
_root.mc_thumbs._x = 458;
_root.mc_thumbs._y = 36;

_root.mc_splash.onRelease = function() {
_root.mc_splash._x = 5000;

}

var thumbsPath = _root.mc_thumbs;

thumbsPath.mc_thumb_00001.onRollOver = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(2);
}

thumbsPath.mc_thumb_00001.onRollOut = function() {
thumbsPath.mc_thumb_00001.gotoAndStop(1);
}

thumbsPath.mc_thumb_00001.onRelease = function() {
trace ("hitting mc_thumb_00001");
_root.attachMovie("mc_imageLoader", "mc_imageLoader_00001", layerDepth);
_root.mc_imageLoader_00001.loadMovie("skin/original/images/portfolio/00001.jpg");

}


I just don't understand why having the attachMovie in an OnRelease cause the it to stop working.

Any help would be great, thanks,

Eric

Trying To Access A Dynamic Button Within A Movieclip
Code:
if (interface_mc.btnSizer_1 == null)
{
trace ("button not found");
}
// Above returns false, works perfectly...button is found!


i = 1;
if (this['interface_mc.btnSizer_'+i] == null)
{
trace ("button not found");
}
// Above returns true, button cannot be found!

Can someone help me, because this['whatever'+i] works, it's just that when I'm trying to access it within a movieclip, it doesn't work.

I tried the following:
this['interface_mc.btnSizer_'+i] //does not work
this[interface_mc.'btnSizer_'+i] //does not work
interface_mc.this['btnSizer_'+i] //does not work

interface_mc.btnSizer_1 //works

Access Button In Stage(.fla File)
I have a button in my stage..ie on my fla file...The botton name is btn_pause.
I need to access that button from my class file(.as file)..I had tried Stage.btn_pause.But it is not working..Please give me a solution..with some example..

Thankyou...

How Access Button When Grouped In A Movieclip
hey guys! i'm a new face here, so hello everyone!

i'm coding a keyboard and created buttons for each key in flash cs3 and added an onclick-effect to each button. after grouping them into one movieclip and importing it to stage i still have the onclick-effect. now i'd like to add an eventlistener to one of the buttons in the movieclip. any hints/ideas?

How To Access Components Of Button Symbol?
Hi all,

I'm new in flash and I would like to get a feedback about how accessing the components (like a Label component) included in a button Symbol. The situation is the following:

Step #1: I would like to to create a dynamic button. This button should be composed of a label component (Label with instance name "vTitle"). I converted this label as "button" symbol (instance name "vButton". therfore, I'm now able to define the different appearances of my button depending on the event (mouse over, down...).

Step #2: Next, I would like to dynamically set the value of my label depending on a parameter called "title". I converted my button as "Movie Clip" and added the parameter "pTitle" as String.

So, now, I have defined what I can call the "context" of my object. Next step if the coding of the event script. When I go to the action section of my "Movie Clip" and click on the "Target' button to locate the "vTitle", I can browse to the button, but not to the title included in this button. Therefor, I checked the options in the "Accessibility" panel of the button and did not found any "Make child accessible" for this kind of symbol! So I do not understand why it is not permit.... :(

Can anybody help me about accessing the internal label of my button symbol ?

Thanks and Best Regards,
Tanguy

Can I Access Player Controls Thru A Button?
I would like to access the Zoom In function from the right-click menu using a button in my flash movie...

Can I Access Player Controls Thru A Button?
I would like to access the Zoom In function from the right-click menu using a button in my flash movie...

How To Access A Text Within A Button Programatically?
Hi i was using this for movie clips

LuzLetra is a MovieClip which contains a DynamicText inside with the name of texto

var nuevaLetra:LuzLetra = new LuzLetra();
nuevaLetra.texto.text = "sfsf";
this.addChild(nuevaLetra);


this works for MovieClip but it doesn't works if I use a Button so I would like to know if there's a way to make it to work using Button.

Access Button Inside Of Loaded Swf
Hello to all! So, i'm loading a swf (image gallery) that fills the entire index movie's stage. I created a "close" button in the swf. So, you're inside the index movie and click gallery. It loads on top of the entire index movie so it appears as an image gallery with a solid background, none of the index elements are seen, but exist behind the gallery swf. What i want to do is access the close button in the gallery swf so when it's clicked, it closes and the index stage is being viewed again. Ideas? Helpful Hints? Are the Lakers going win?

Dynamic Button Access Trouble
I've tried searching, but I can't find a specific answer to this question. Say I have a button on the stage with the instance name "menuButton" along side a number of buttons. Now say I want to dynamically add a listener to this button using a variable instead of hardcoding:

menuButton.addEventListener(MouseEvent.CLICK, someFxn);

when I try:

var dynamicName:String = "menuButton";
dynamicName.addEventListener(MouseEvent.CLICK, someFxn);

I get :

TypeError: Error #1006: value is not a function.

How can I achieve this with a variable? I've tried other data types, and all throw errors. Should I give in and do an epic if/else chain?

Thanks much in advance!!

Access A Button Label At Runtime
i am new to flash and it may sound stupid:
but I cannot find any property which allows me to set the label of a button at runtime.
What is the name of this property??
Markus

How To Access The Text Property In A Dynamic Button?
Flash 8 Issue.

I have a button that has a text object in it (aside from some graphic of course). I am trying to set the text dynamically and I can't seem to get it to work because I don't seem to know the proper class to call:

btn = _root.attachMovie("navButton_symbol", "myButton"+i, i);
btn._y = i *50;
btn.text = "please work this time!";

The buttons do render properly and all that other stuff works.

On the button library object the text is set to dynamic and has the name of btnLabel. But I have tried addressing it as btn.btnLabel.text and btn.btnLabel and all of the other permutations I can think of. As you can see the buttons have dynamic names so this is presenting me with this challenge. What is the proper way to address this text field so I can set the text to a value that I need?

btn.btnLabel.text = "I am totally lost!";

I tried to do this with an init object, but that seems to lead me to the same dead end.


-sed

Access Child SWF File Button From Parent Swf
Hi all,

I have a main.swf file in which there is a button and a movie clip.
I am loading another swf file inside this movieclip.

loadMovie("mm.swf","main.mc");

On click of a button on the main.swf I want to access the buttons on the child swf.

How to go about this?

Thanks...

Can't Access Main Timeline As With Imbedded Button
I have a an FLA with a movie clip that has a button inside it. Is there something special I need to do in order for that button to activate the action script in the main timeline correctly?

All of my other buttons & movie clips work fine. It's just my movieClip/Button combo symbol that won't work.

Here's the .FLA. the button I'm referring to is in the top right corner.

FYI, all of the audio is loaded externally from the library in the .AS. So, to have any sound, you'll need the 2 .mp3's as well that in this directory.

http://dev.sheridan.edu/Test/Sound/



Code:

this.createEmptyMovieClip("mcSoundHolder",this.getNextHighestDepth());
var sndAudio:Sound = new Sound(mcSoundHolder);
sndAudio.loadSound("Sound/slow_part.mp3", true); // True = Streaming, False = Event Clip totally downloaded

this.createEmptyMovieClip("mcSoundHolder",this.getNextHighestDepth());
var sndAudio2:Sound = new Sound(mcSoundHolder);
sndAudio2.loadSound("Sound/Voice.mp3", true); // True = Streaming, False = Event Clip totally downloaded

// ============ If false, then you have to check if the sound clip is loaded or not


sndAudio.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess) {
this.start();
this.setVolume(100);
}
};

sndAudio2.onLoad = function(bSuccess2:Boolean):Void {
if (bSuccess2) {
this.start();
sndAudio.setVolume(20);
this.setVolume(100);

}
};


var nInterval:Number = setInterval(checkProgress, 1000);
var nInterval2:Number = setInterval(checkProgress2, 1000);

function checkProgress():Void{
var nPercent:Number = Math.round((sndAudio.getBytesLoaded()/sndAudio.getBytesTotal()) * 100)
trace ("Stuff =");
trace (nPercent);
}

function checkProgress2():Void{
var nPercent2:Number = Math.round((sndAudio2.getBytesLoaded()/sndAudio2.getBytesTotal()) * 100)
trace ("Stuff2 =");
trace (nPercent2);

}

// Production Handlers

// none

// Testing Handlers

mcPlay.onRelease = function():Void {
sndAudio.start(sndAudio.position/1000)
sndAudio.setVolume(100);
};

mcPause.onRelease = function():Void {
sndAudio.stop();
sndAudio2.stop();
};

mcPlayVoice.onRelease = function():Void {
sndAudio2.start(sndAudio2.position/1000);
sndAudio.setVolume(20);
};

mcStopVoice.onRelease = function():Void {
sndAudio2.stop();
sndAudio.setVolume(100);
};



stop();

How Can External Files Have Access To Button Class?
I have an interface that creates two buttons...

In the interface class:

Code:
private var nextButton_mc:NextButton;
private var prevButton_mc:PrevButton;
In the main constructor:

Code:
nextButton_mc = new NextButton;
nextButton_mc.x = 486;
nextButton_mc.y = 490;
addChild(nextButton_mc);

prevButton_mc = new PrevButton;
prevButton_mc.x = 406;
prevButton_mc.y = 490;
addChild(prevButton_mc);
I then load external files into a container MovieClip and each of those files is supposed to be able to communicate with the
buttons like this:


Code:
Interface._container.setNextButton();
(I use static vars to reference the interface movie)

This all works if I place copies of the NextButton and PrevButton inside each Library of the external files; otherwise it fails because the external files can't see these classes. What's a way to do this without adding the buttons to each and every Library? Am I stuck creating an external class file like NextPrevious.as?

Button Within A Movie Clip Cant Access To Different Scene
i couldnt think how to fix this problem
can someone help me

the first button on the left (purple color) i set it to gotoAndPlay("Scene 2",1) but it wont move to scene 2

1087 Error From Trying To Access A Button Inside A Symbol
Hey All,

I've been getting a 1087 error with regards to my attempts to access a button inside a symbol which is being referenced by a ScrollPane Component.

The basic idea is for the user to click a button in the symbol scrollable symbol, that in turn affects a movie clip outside the symbol and ScrollPane. The code I am using is as follows.


Code:
// infoPaneMC is the movie clip outside the ScrollPane that I am trying
// to activate. In a perfect world, pressing the button below would
// cause it to slide into frame (or halfway through its timeline)
infoPaneMC.stop();

// scrolltest is the movie clip symbol referenced by the ScrollPane
// 1800_R_Button is the button inside scrolltest
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);
function startClip(e:MouseEvent) {
infoPaneMC.play();
}

// This code is what I am using to close infoPaneMC by playing it
// out from its halfway mark
infoPaneMC.addEventListener (MouseEvent.MOUSE_UP,startClip2);
function startClip2(e:MouseEvent) {
infoPaneMC.gotoAndPlay("infoPanePause");
}
However I keep getting the following error:

1087: Syntax error: extra characters found after end of program.

The line it refers me back to is:


Code:
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);


Any ideas?

Thanks!

Boz

Document Class Access Of Button On A Specific Frame
I have a button that exists on a certain frame in my flash movie. I'm getting a null reference error when I try to compile the movie. Here's what the trace window reports:

onConnect1 running! chatService has connected.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-289()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at net.flashmog::FlashMOGService/socketConnectHandler()


The code is attached.







Attach Code

package {
import fl.controls.TextArea;
import flash.display.MovieClip;
import flash.events.*
import flash.text.TextField;
import net.flashmog.FlashMOGService;

/**
* A simple chat application.
*/
public class ChatExample extends MovieClip {
private var lastErrorMessage:String = '';
private var chatService:FlashMOGService;

public function ChatExample() {
this.stop();
chatService = new FlashMOGService('11.22.33.44', 1234, 'chatService');
configureListeners();
chatService.connect();
}

private function configureListeners():void {
chatService.addEventListener(Event.CONNECT, onConnect1);
function onConnect1(evt:Event):void {
trace('onConnect1 running! chatService has connected.');
gotoAndStop('username');


function submitClick(evt:MouseEvent) {
if (usernameText.length > 0) {
usernameStatusText.text = "Registering username with server...";
chatService.server.registerUsername(usernameText.text);
} else {
usernameStatusText.text = "You must enter a name!";
}
}
submitButton.addEventListener(MouseEvent.CLICK, submitClick);

} // onConnect
} // configureListeners
} // class ChatExample
} // package

Target/access Button Inside (attach) Movieclip
Hi everyone,
im new to flash and actionscript v2.
would be great if i could get a shove in the right direction.

im trying to get a button working that is inside a movie clip.
the movieclip is given a linkage identifier (container_id and name as container_mc) as it is inside the library and not on the stage.
The movie clip has three buttons inside it.
I have the following code on each of the button

Code:
_root.containerBase_mc.scrollUp_btn.onRelease = function() {
trace("scrol upn");
};
this.containerBase_mc.scrollDown_btn.onRelease = function() {
trace("scrol down");

};
this._parent.containerBase_mc.close_btn.onRelease = function():Void{
trace("close me");
}
as you can see my desperate attempts to get this working
none of the trace actions work...
any help?
thank you.

[f8] Array Access Notation To Access A MC Within A MC?
Hi,
can one access the contents of a movieclip - that contains another mc - using Array Access notation??

I am loading a bunch of similar (ie, based on the same template) external swfs individually on level0 on the main timeline. because there are many swfs, i want to control the button/mcs in those external swfs from the main timeline. i have a different number of buttons in each swf, and each button goes to a different label. so i am trying to figure how to dettermine the name of the loaded swf, in order to get to the buttons inside that swf...

I was thinking to name each label the same name as the corresponding button object name. and each button/label name be derived from the name of the containing swf... I could put the name of the swf in a variable, and use it as a gotoAndStop() argument...,

i can provide code, but i'm lost and it's gotten messy...

Any ideas GReatly appreciated.

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