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








Conditional Scrollbar


Ok,

I have no problem with the creating scrolling text, but what I ouwld like to do is make the scrollbar conditional, for example, if the loaded text is > x, scrollbar is visible. But, I don't know how to do it!!!

Can anyone point me in the right direction, ie. what properties and methods I could use to control it all.

Cheers




FlashKit > Flash Help > Flash MX
Posted on: 03-19-2003, 06:21 AM


View Complete Forum Thread with Replies

Sponsored Links:

Scrollbar Problem - How To Load Text And Have The Scrollbar Default To Bottom Onload?
Hi,

I am currently working on a project whereby I need to display text in a scrollable area that refreshes every 2 seconds. I have the text loading ok but there is some extra functionality that I require.

At the moment I have a PHP application that uploads text files and adds the latest comment to the end of each text file. If you open the text file you can see the older comments at the top and the latest comments at the end. In the flash movie, I need the text file to load and the scrollbar to default to the bottom of the flash movie - that way, the latest comments will appear at the bottom of the screen and you can scroll up to the older comments.

I am not sure how to do this as I have just used the built in Flash components to get what I have so far.

Any help is appreciated.

Thanks,
Martin

View Replies !    View Related
Scrollbar Problem - How To Load Text And Have The Scrollbar Default To Bottom Onload?
Hi,

I am currently working on a project whereby I need to display text in a scrollable area that refreshes every 2 seconds. I have the text loading ok but there is some extra functionality that I require.

At the moment I have a PHP application that uploads text files and adds the latest comment to the end of each text file. If you open the text file you can see the older comments at the top and the latest comments at the end. In the flash movie, I need the text file to load and the scrollbar to default to the bottom of the flash movie - that way, the latest comments will appear at the bottom of the screen and you can scroll up to the older comments.

I am not sure how to do this as I have just used the built in Flash components to get what I have so far.

Any help is appreciated.

Thanks,
Martin

View Replies !    View Related
Scrollbar Problem - How To Load Text And Have The Scrollbar Default To Bottom Onload?
Hi,

I am currently working on a project whereby I need to display text in a scrollable area that refreshes every 2 seconds. I have the text loading ok but there is some extra functionality that I require.

At the moment I have a PHP application that uploads text files and adds the latest comment to the end of each text file. If you open the text file you can see the older comments at the top and the latest comments at the end. In the flash movie, I need the text file to load and the scrollbar to default to the bottom of the flash movie - that way, the latest comments will appear at the bottom of the screen and you can scroll up to the older comments.

I am not sure how to do this as I have just used the built in Flash components to get what I have so far.

Any help is appreciated.

Thanks,
Martin

View Replies !    View Related
Scrollbar Problem - How To Load Text And Have The Scrollbar Default To Bottom Onload?
Hi,

I am currently working on a project whereby I need to display text in a scrollable area that refreshes every 2 seconds. I have the text loading ok but there is some extra functionality that I require.

At the moment I have a PHP application that uploads text files and adds the latest comment to the end of each text file. If you open the text file you can see the older comments at the top and the latest comments at the end. In the flash movie, I need the text file to load and the scrollbar to default to the bottom of the flash movie - that way, the latest comments will appear at the bottom of the screen and you can scroll up to the older comments.

I am not sure how to do this as I have just used the built in Flash components to get what I have so far.

Any help is appreciated.

Thanks,
Martin

View Replies !    View Related
Scrollbar Doesn't Work (tutorial: Object-oriented Scrollbar)
(tutorial --> object-oriented scrollbar: http://www.gotoandlearn.com/play?id=71).

I followed the tutorials instructions and this is the code that i have now:

import caurina.transitions.*;

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_DOWN, 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;
Tweener.addTween(content, {y:(-sp*(content.height-masker.height)),
time:1});
e.updateAfterEvent();
}

Does anybody see what's going wrong? I'm a beginner beginner, so all could think of to do is check if everything was typed correct. (i double checked instance names and code). But can't seem te get it to work, nothing happens when i preview swf.
No compilers errors and no syntax error. Tweener class is installed properly. PLEASE help me i've been looking for hours now.
If someone could help me, would be great!!

Sorry for my english, thank you for your time.

View Replies !    View Related
Conditional Help
I am trying to write out a conditional for a set of buttons. I want to tell one button to look at the other buttons, and check if any of them is active, and if any one is active play it back!

The buttons_mc have a roll over, a roll out, and a down state. I am running to the issue that when I click on one, and it becomes active, and I roll out, and it's working again, I need to deactivate that button by using some sort of action script. Not button_mc. enabled = false;

I need something else!

Thanks dudes, let me know if you gusy could understand what I am trying to say?

View Replies !    View Related
Conditional GetURL
I'm back with another question re: my search engine gui. How do I set up my "execute search" button to getURL only when my searchString variable is not "" and not "Enter search word(s) here.".

This code (which does not work) is currently attached my "execute search" button:

on (release, keyPress "<Enter>") {
if (searchString ne "") {
} else if (searchString ne "Enter search word(s) here.") {
getURL ("/cgi-bin/WebObjects/dotcom.woa/wa/searchStation", "_self", "GET");
}
}

View Replies !    View Related
Conditional Telltargets?
here's the problem...
i have a MC telltageted within a Movie. it is activated by a button. within the same scene i have a series of other button that tell target to their appropriate movies.
//so far so good...
BUT, when i have one button activate a telltarget and then push another button, the previous telltargeted movie remains onn the screen. what i want is for and tell targeted movie to disappear when another telltageted MC is activated ...
//what do i do?

View Replies !    View Related
Conditional Functions
Hello everyone!

I am wanting to set a variable, and if this variable is a certain value, reveal a movie. I know the variables are being written okay, as I have some dynamic text boxes saying so. What I have so far is:

if (input == z) {
setProperty ("movie_ins", _visible, 1);
} else if (input == x) {
setProperty ("movie_ins", _visible, 0);
}

Also, where to put this code? In a loop in the timeline? In a ' onClipEvent (load) '? In the button?

Simple problem, except I just swapped Flash 4 for Flash 5. hmmmmm. Many thanks for any help at all!

cheers, Heresjonny

View Replies !    View Related
HitTest + Conditional Help
Hi all,

I have an animated game that requires a collision whilst a button is pressed to run a MC. It works fine, using a hitTest + the space bar using the following code:

if (branding[i].hitTest(_root.body.hand)and Key.isDown(32)) {branding[i].gotoAndPlay(2);}

Now I want to make it so that it works if a collision occurs whilst the left mouse button is pressed. Is there a key code the left mouse button, or do I have to use a different approach. ( the x,y coordinates of the mouse are irrelavant, purely whether the button is down or not)

cheers

Dongle

View Replies !    View Related
If <- Conditional Statement ?
I've created a text movie which shakes at the end. I used about 10 keyframes to position the text all over the place which give is the shaking apperence. I want to control the number of times my gotoAndPlay loop with a If condition.

I've tried several different types of conditions:

count = 1;
if (count <=20){
gotoAndPlay (16)
count++;
}
stop();

Q. why doesn't this loop the goto function until the counter is 21.

My objective is the control the number of times the text shakes without using keyframes to do it. It it possible or did i even make sence, somebody help!!!

View Replies !    View Related
Simple Conditional
I have an MC in a frame with the following script:

onClipEvent (enterFrame) {
if (this._alpha>0) {
this._alpha -= 10;
}
if (this._alpha<=0) {
gotoAndStop ("timer");
}
}

Here I am just doing a fade on the MC
and when the _alpha reaches "0" I want it to go to another frame called "timer". For some reason, it won't advance to "timer". What is the conflict here? I also tried using an "else if" instead of a seconf "if" but no luck.

View Replies !    View Related
:::::::::::Conditional Actions::::::::::::::::::::
If I have a series of seven MC's with instance names of say
CD1, CD2, CD3,.....CD7, and each clip has 2 frames, the first with a stop action and no content, the second w/ a stop action and text -

I'm wondering if there is a more efficient way of evaluating
which of, if any, these clips has moved to frame 2 from a on (release) action.

Eg:
on (release) {
if (_root.CD1._currentframe==2) {
_root.CD1.gotoAndStop (1);
_root.WhatEver.gotoAndPlay (1);
}
else if (_root.CD2._currentframe==2) {
_root.CD2.gotoAndStop (1);
_root.AnotherClip.gotoAndPlay (1);
}
else if (_root.CD2._currentframe==2) {
_root.CD3.gotoAndStop (1);
_root.SomeThingElse.gotoAndPlay (1);
}
}
...and so on...

Please tell me there is???

View Replies !    View Related
:::::::::::Conditional Actions::::::::::::::::::::
If I have a series of seven MC's with instance names of say
CD1, CD2, CD3,.....CD7, and each clip has 2 frames, the first with a stop action and no content, the second w/ a stop action and text -

I'm wondering if there is a more efficient way of evaluating
which of, if any, these clips has moved to frame 2 from a on (release) action.

Eg:
on (release) {
if (_root.CD1._currentframe==2) {
_root.CD1.gotoAndStop (1);
_root.WhatEver.gotoAndPlay (1);
}
else if (_root.CD2._currentframe==2) {
_root.CD2.gotoAndStop (1);
_root.AnotherClip.gotoAndPlay (1);
}
else if (_root.CD2._currentframe==2) {
_root.CD3.gotoAndStop (1);
_root.SomeThingElse.gotoAndPlay (1);
}
}
...and so on...

Please tell me there is???

View Replies !    View Related
Conditional Statment
i have a problem with my flash project.
what it's suppose to do is check if the slopeA,riseA,runA variable is correct. The co ordinates are randomly generated.
the user will need to put the value in those test boxes and if it's correct then it will pop into next frame and count plus one , if not then it will pop into other frame
but it doesnt work properly
can someone please help me?
the file is attached above

scene 8 does all these actions
PLEASE help me
if you can help plesae contact me through ICQ # 16552975 or MSN Cederick_Wong@hotmail.com

please !!
need this ASAP
thanks !

View Replies !    View Related
Conditional Variable?
Hello I'm new to Action Script and got myself into a project that requires a fair amount of codes!
I have a series of buttons with pictures and text that appears when the mouse goes over the buttons. When you click on the button it starts a new Movie Clip that a small part of the window. I need to hide the 'over' pictures when the MC is playing, but keep the buttons visible and active!
After talking to a friend, his suggestion to my problem was to use a conditional variable something like:
if (nameofvariable==1)
then put_image("house")
and set the value to 0 at the begining of the MC et to 1 at the end of the MC!
Makes sense I guess! I just don't know the syntax of it or if it would work!

Thanks for your help!

Coccinelle

View Replies !    View Related
Conditional Variable?
Hello I'm new to Action Script and got myself into a project that requires a fair amount of codes!
I have a series of buttons with pictures and text that appears when the mouse goes over the buttons. When you click on the button it starts a new Movie Clip that covers a small part of the window. I need to hide the 'over' pictures when the MC is playing, but keep the buttons visible and active!
After talking to a friend, his suggestion to my problem was to use a conditional variable something like:
if (nameofvariable==1)
then put_image("house")
and set the value to 0 at the begining of the MC and to 1 at the end of the MC!
Makes sense I guess! I just don't know the syntax of it or if it would work!

Thanks for your help!

Coccinelle

View Replies !    View Related
Look At This Code (conditional)
The code below goes in a game where I'm dropping clothes on a character and the clothes that she's wearing when a button is pressed dictate the next step. As you can see, there are several conditions that must be met, but this code isn't working 100%. Some of it works, some doesn't. I'm sure it's my lack of experience with actionscript. What I want to say is something like:

"If the dress is blue and the hat is leopard or pink hat OR if the dress is leopard and the hat is asian, goto and play "newhat""

begin code------

on (release) {
trace(dress);
trace(hat);
if (dress == "pinkdress"){
gotoAndPlay("pinkdress");
}else if(dress == "bluedress" && hat == "leopardhat" || "pinkhat" || dress == "leoparddress" && hat == "asianhat"){
gotoAndPlay("newhat");
}else if(dress == "bluedress" && hat == "bowhat"){
gotoAndPlay("beautiful");
outfit = "blue";
}else if(dress == "bluedress" && hat == "asian" || dress == "leoparddress" && hat == "bowhat" || "pinkhat"){
gotoAndPLay("stylist");
}else if(dress == "leoparddress" && hat == "leopardhat"){
gotoAndPlay("leoapard");
}else if(dress == "asiandress" && hat == "asianhat"){
gotoAndPlay("asian");
}else if(dress == "dogfit"){
gotoAndPlay("dogfit");
}else if (dress == "duck"){
gotoAndPlay("duck");
}else{
gotoAndPlay("naked");
}
}

View Replies !    View Related
Conditional Testing
hello all, i'm having a another one of my flash enduced headaches...

i have a n input filed in my movie where the user puts there url if they want to. I'm trying to test the following

have they left field saying url? (if so move on if not test2)
have they left field blank? (if so move on if not test 2)

TEST 2
has string got "http://" OR has string got "www." (if NOT error, if so move on)

I've tried this


Code:
if (!url == "url" || !url.length && url.indexOf("http://") == -1 || url.indexOf("www.") == -1) {
results += "url not valid";
}
but it keeps throwing up the error when i leave the field as either url or blank. fine if i put in real url, but this is supposed to be an optional field. PLEASE HELP!!!!

View Replies !    View Related
Conditional Statements
Hi all-

I am trying to make what i hope is a very simple game. There will be 4 different people and 4 different colors. The "player" has to match the person with the right color by clicking on the person button and then clicking on the color button. If the match is correct a small movie clip plays.

I just need a little push in the right direction. Is this an "if else" situation? I have just been sitting and staring at my screen - i do not have much experience with conditional statements.

thanks in advance.
Shawn

View Replies !    View Related
Using Conditional Logic
When creating an if else statement, I have to check for multiple varriables being set (all are just numbers) There has to be an easier way of doing it than I am:

if (myvarr == 1 || myvarr == 2 || myvarr = 3 || myvarr == 12 || myvarr == 13 || myvarr == 15){
Do this stuff
}else if (myvarr == 5 || myvarr == 6 || myvarr == 7 ... ect...ect){
Do this stuff
}

There has to be a shorter way to check for multiple varriables instead of saying
this == that || this == theother ect.

There is 41 different checks and they do 2 different things

any suggestions?

View Replies !    View Related
Conditional Movement
probably a stupid question, but it's been keeping me up at night...

...i need a crash course in how to make a mc move from it's current position to a specified position (i.e. on(rollOver), whatever i have hovering around my menu will move to the selected button from wherever it was seamlessly)...

...sorry for the noob question...

View Replies !    View Related
Simple Conditional
Hello all,

I'm trying to create a simple conditional that basically just goes to a frame and plays if


Code:
stop();
if (_root.crunch == yes ) {
gotoAndPlay(2);
}


The variable "crunch" is loaded from an external text file and will contain either "yes" or "no." I was going to go with "true" or "false" but I wasn't sure if that'd conflict with any AS syntax.

What exactly am I doing wrong?

Thanks in advance!

View Replies !    View Related
Conditional Preload
Hey guys...i am trying to put together an interesting preloader.

I have a movieclip that is 8 frames long. All I want to do is make it play for as long as it takes for the rest of my entire movie takes to load.

what I really want is for it to reach its last frame at about 97% of the way for the entire movie load time. The movie clip doesnt even HAVE to stay at 8 frames, it can be more or less.

I dont know much about actionscripting and I've tried a few tutorials but not many of them that i found address this specifically enough for me to learn it on my own any help would be appreciated.

I know how to make it play if all bytes are not loaded but i dont know how to stop it from playing all the way through and make it play in sync with the loader. Any suggestions?
thanks
D

View Replies !    View Related
Conditional With 3 Variables?
help!!

Im using the variables 2 and 99 to move the playhead in mc's one and two to the prevFrame.
how do i string these two variables together in one statment.

i.e. how do i write this?


Code:
...
if
{
_root.showclips == 2 or 99;
_root.mcone.prevFrame;
_root.mctwo.prevFrame
}





heres the full situation-if you need more


mc one

onClipEvent (enterFrame)
{
if (this.hitTest(_root._xmouse, _root._ymouse, true))
{
_root.showclip1 = 4;

else
{
_root.showclip1 = 2;
} // end if
}


mc2

onClipEvent (enterFrame)
{
if (this.hitTest(_root._xmouse, _root._ymouse, true))
{
_root.showclips = 4;

else
{
_root.showclips =99;
} // end if
}


(bot)
onClipEvent (enterFrame)
if
{
_root.showclips == 4;
_root.clip1.prevFrame();
_root.clip2.nextFrame();

if
{
_root.showclips ==99, 2;
_root.clip1.prevFrame;
_root.clip2.prevFrame;
} // end if
}
thanks

View Replies !    View Related
Conditional Trigger
Trying to change the position fi a cli based on the Current Frame number.
At stsrtup, the clip jumps to x 300 and does not change even after passing frame 100;

How do I create an event the move a clip based o current frame number?

Thanks

onEnterFrame=fduration;
function fduration(){
value1=_root.empty_mc._currentframe;//tarcks frame
}if(value1>=300){
_root.empty_mc.stop();
_root.empty_mc.gotoAndStop(440);
this._x=100;
}else{
if(value1<=99){
this._x=300;
}
}

View Replies !    View Related
Help With Conditional Statements
I just downloaded the Flash 8 demo from Macromedia and read through a bunch of tutorials. I am now making a project that starts with an animated menu with three choices. I have the menu as a separate scene. After you choose one of the menu options, Flash jumps to another scene in which the menu fades away. I created on scene for this so I wouldn'y have to do it three times for each button. All the aforementioned stuff works fine. However, after I click a menu button, I want Flash to go to a resoective scene. So basically i have the menu scene. after clicking on a button flash goes to a fademenu scene. afterwards, depending on which buttons were clicked, flash should go to one of three other scenes. I expect this to work by having Flash set a variable, say, sceneselect to 1 if the first menu button was clicked, to 2 if the second one was clicked, etc. Flash would set the variable right after the click. then, i would add actionscript at the end of the fadeout scene that would check for the value of variable sceneselect, and then gotoandplay a certain scene. is that how it would work? and if someone could like guide me through this I would very appreciate it.

thanks

View Replies !    View Related
[MX] Conditional Statements For Mc's
hello all who are viewing this.
Ive posted a few questions on this forum but tend not to get any replies I dont know if my enquiries are too simple to reply to but again i will ask for help.
I have created some characters for a menu.
which will play with on (rollOver) with an invisible button.
I have attached a file for all to see.
My problem is that I need to write a conditional statement for the invisible button. Whats supposed to happen is that the Mc, (which is a simple alpha tween) plays and when certain frames are reached triggers other Mc's to play.
But I want to write a conditional statement to stop when the user rolls over the invisible button a second time the Mc going back to the beginning and starting again (check the attachment).
I know how to do this with a button when loading MP3's (boolean true, false)
but not with a Mc. I know this must be simple but cant get my head around it. All the examples Ive seen are usually with Numerical values such as a quiz.
anybody out there can help me?????



so that when the user rolls over the invisible button the affected movie clip only plays once instead of going back to the beginning

View Replies !    View Related
Conditional Question
This is a complicated question and I am kinda stumped... I have a dynamic ecommerce site that all I want to do is have a flash file dynamically load if the user has a certain amount of money in their shopping cart... Is that possible?

Looked a bit further and all i really want to do is a url conditional, but I don't know how to start it

if(money > 50) {
loadMovie(1.swf);
}else if(money > 500){
loadMovie(2.swf);
}

I have to figure out the variables to put inplace for the dollar amounts.
The site is www.porterstahoe.com and I want this to be used off the cart dollar amounts

View Replies !    View Related
Conditional Statements
I'm using flash 8 to put together a website. I have links at the top of my page. When a user clicks on a gallery an animation runs in the main page and then it loads an external swf file. My problem is, I don't always want it to play that animation. Kinda hard to explain, I'll provide a link. I was wondering if I would have to write a conditional script to do this or is there another way.

here is the link.

http://www.litemediadesign.com/John

if you click on "bio" it works fine and then click back to "home" it works fine. But, if you click on a gallery (japanalia) then click on "bio" it plays an unnecessary animation (obviously because I told it to). Help me out!

My main Flash file is also available at
http://www.litemediadesign.com/John/index5.fla

Thanks!

View Replies !    View Related
[F8] Conditional Not Working
I'm a long-time Flash user, but still a noob with actionscript.

I have a movie clip on the stage that I've set the alpha to 0%. I want to change the alpha to 100% when a particular HTML page loads the Flash file. In my OBJECT and EMBED tags, I've set my FlashVars to "pid=home".

In the keyframe of the layer containing the movie clip, I have the following code:

if (_root.pid == "home"){
setProperty("bar home", _alpha, "100");
}

When I load the page in the browser, the alpha of the movie clip doesn't change. If I strip out the conditional code and just leave the setProperty line, it works fine.

I've even tried taking off the "_root" part and declaring the variable (pid = "home"; ) directly before it, and I still can't get the conditional to work.

Any ideas?

View Replies !    View Related
[F8] Conditional Loop Help
FLA attached

I've been really struggling to get this tsunami menu working properly and I'm not confident enough with actionscript to be able to fix it so any pointers would be a huge help.

I've built a tsunami-style menu which works using duplicated movie clips. The movie clips scale big when rolled over then back again on roll out however on click the movie jumps to it's relevant frame label on the main timeline but I cannot get the menu item to remain scaled big to show it has been selected.

I think I need to use conditional loops of some sort but I cant get it working. At the moment I've got if...else statements in there but somethings not right.

Please help!

Thanks in advance

Joanna

View Replies !    View Related
[CS3] {as2} - Conditional Statements
Hello Flashers !

I have a web page with 6 buttons on it
making a a movie clip disappear on one click
and re -appear on the second click.
the problem is each of the movie clips
has a button on them that sends the user to a different URL
but if all the clips are on - well than all the buttons are on,
I am trying to write a conditional statement that would
enable the buttons only when their movie clip is on
and all the rest are off.

well code speaks louder than words so...
this is the script for one of the buttons/movie clips
essential they are all the same just the instance name changes



lineMc_james._alpha=0
jamesBt.onRelease = function() {
if(jamesMc._alpha<100) {
jamesMc._alpha= 100;
lineMc_james._alpha= 0;
} else {
jamesMc._alpha= 0;
lineMc_james._alpha= 100;
}

}


the script referring to to the button on jamesMc is:

ja1webBt.onRelease = function () {
getURL ("http://www.victorenyc.com","_blank")

}

any ideas on how to enter the statement in this line ?

Thanks for your patience )

View Replies !    View Related
CS3: Trouble With An If/else If Conditional...
This script comes from an external .as file that is being referenced by a template flash file. I have an array set up for a dropdown list of pages and I have a movieclip and dynamic text field that I want to change dependent upon the page range being dynamically loaded into a movieclip. The script I am having difficulty with is highlighted in the actionscript below:

// Enter the Course Title and Course # text here:
var title1 = "The Name of the Course";
var title2 = "Secondary Title";
var courseid = "555_302";

//Use this to define page sections:
//section 1:
if (dropdown_cb.value >= 1 && dropdown_cb.value <= 2) {
var section_txt = "Prepare";
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF9900);
}
//section 2:
else if (dropdown_cb.value >= 3 && dropdown_cb.value <= 5) {
var section_txt = "Arghhh";
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF99CC);
}

//Enter the Page Titles here. Add or delete rows as needed
dropdown_cb.dataProvider = [
{value:0, label:"[01] Yarrr"}
,{value:1, label:"[02] Blech"}
,{value:2, label:"[03] Woot"}
,{value:3, label:"[04] Shoo"}
,{value:4, label:"[05] Meh"}
];
dropshadow(controlbar, .5, .5, .5)
//dropshadow2(dropdown_cb.dropdown, 1, 1, 2)
dropdown_cb.rowCount = 5;
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
var item_obj:Object = dropdown_cb.selectedItem;
var i:Number;
for (i in item_obj) {

var swf = _root.playlist[dropdown_cb.selectedItem.value];
trace("SWF :"+swf);
_root.mcLoader.loadClip(swf,_root.mc);

// trace(i + ": " + item_obj[i]);
trace("MC OBJ"+item_obj[i]);
var er:Number = dropdown_cb.selectedItem.value;
controlbar.jumper.stepper.value = er;

trace("NUMERIC STEPPER "+ er);
}

};
dropdown_cb.addEventListener("change", cbListener);


The first if part works but will not change when i advance the pages. Can anyone help me with this?

View Replies !    View Related
Trouble With An If/else Conditional
Hello

I have script being pulled into a flash file (new_template.fla) from an external .as file (pglist.as). I have an array set up for a dropdown list of pages and I have a movieclip and dynamic text field that I want to change dependent upon the page range being dynamically loaded into a movieclip. The script I am having difficulty with is in the pglist.as file:

//Use this to define page sections:
//section 1:
if (controlbar.jumper.stepper.value >= 0 && controlbar.jumper.stepper.value <= 1) {
var s_txt = "Prepare";
section_txt.text = s_txt;
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF9900);
}
//section 2:
else if (controlbar.jumper.stepper.value >= 2 && controlbar.jumper.stepper.value <= 3) {
var s_txt = "Arghhh";
section_txt.text = s_txt;
var colorful = new Color("_root.section_clr.section2");
colorful.setRGB(0xFF99CC);
}

Currently it is orange and says "Prepare" when you are any of the pages but I want it to change dependent upon an if, else if page range when the user either clicks the dropdown or the next and prev buttons. Can anyone help me with this?

Attached are my files.

cond_prob.zip

View Replies !    View Related
Problems With Conditional If
Hi, I´ve been trying to make a button based on a movie clip, which when I click on it, the visitated appearence remains. I´ve worked this script
on (rollOver) {
gotoAndStop(3);
}
on (rollOut) {
gotoAndStop(5);
}
on (release) {
gotoAndStop(7);
}

But I need a conditional that desactivate the rollout event if the button is pressed, any help?
Thanks a lot I hope you could understand me, I haven´t practice my english since a long time.

View Replies !    View Related
Conditional Question
Hey all,

Hopefully a very simple question. I have a conditional in a function that controls what frame to go to in a mc. It's basically a forward button. I have it loading what frame to go to based on a 2 dimensional array because I need to specify how many frames there are as well as what movie clip is currently being played. I'm pretty sure it's working (based on the trace), but I need it to check if the values of the array return undefined, and if so, to go to the next sub array so that I can change the movie clip.

I just started this, and I can already tell it's going to give me fits. Here's the basic controlling code so far.


ActionScript Code:
tempClip.onRelease = function() {
        slideNum +=1;
        if (slidez[slidezNum][slideNum] == undefined) {  //this is not working at all. it returns undefined, yet won't go to the next sub array
            slidezNum+=1;
            slideNum = 1;
            slideName.removeMovieClip();
            slideName = _global.myRoot.slideHolder_mc.attachMovie(slideArray[slidezNum],slideArray[slidezNum],1,{_x:0,_y:0});
        }
        if (slidezNum > 6) {
            slidezNum = 1;
            slideNum = 1;
            slideName.removeMovieClip();
            slideName = _global.myRoot.slideHolder_mc.attachMovie(slideArray[slidezNum],slideArray[slidezNum],1,{_x:0,_y:0});
        }
        slideName.gotoAndStop(slidez[slidezNum][slideNum]);
        trace(slidez[slidezNum][slideNum]);
    }

Does anyone out there have any ideas on how to either clean this up a bit or to register that the condition of equaling undefined is true?

Any help would be much appreciated!

s

View Replies !    View Related
Conditional Buttons
Help! I'm having a problem with a set of buttons I created. The goal here is; when one button is pressed it slides out to a position, then the other two slide vertically to take it's place. When that particular button is pressed again it slides back and the other two slide down to their original positions.
For some reason, probably a giant error in my coding, it won't do anything.

Here's my file. Thanks for any help.
Bp

View Replies !    View Related
Help With Conditional Statement.. I Think?
Hey Guys,

I am not a programmer, so have no idea how to set this up. Any help would be appreciated.

Take a look at the link before you read on.
http://www.ednacional.com/port/SBliss.html

Basically there are 3 photos, 2 set to 0% alpha and 1 set to 100% and each have a mini page icon which changes the photo that is visible. i when the side bar opens i want it to find out which photo is visible and have the appropriate icon on rollover state (grow) so you always know which of the photos are visible.

DOWNLOAD MY FLA

Thanks for any help or suggestions!

View Replies !    View Related
Conditional Question
Hello,

So i'm trying to fade a movieclip from 100 to 0, then 0 to 100.

my code looks like below

//////////////////////////////////////
randomNumber = Math.ceil(Math.random()*100);
trace(randomNumber);

movieClip_mc._alpha = randomNumber;

_global.fader = function(mc){
if(mc._alpha > 0){
trace('if Portion');
mc._alpha -= 2;
} else if(mc._alpha <= 0){
trace('else Portion')
mc._alpha += 2;
}
}
//////////////////////////////////////

so I can get the movieclip to fade to zero, but when it hits zero it just bounces up and down in small increments.

any help, hints anything is greatly appreciated
thanks,
rd

PS also on a sidenote, I trace the alpha of my movieclip and it has decimals even though I rounded it up. kinda weird. rawr

View Replies !    View Related
Conditional Problem
First off, hello everyone. I'm kind of new to flash, but have taken a course on it this semester. Our culminating project is to develop a game based around what we've learned in the course so far. My question is this:

I have an array for my "space" variable, and my method for redefining it is below. However, it appears that I can't use visibility as a boolean. Is there a way around this? (Whenever a button is invisible in my program, I need it to correspond with my array as such.)


function getSpace() {
for (x=1; x<=33; x++) {
if (_root.P[x]._visible == false) {
space[x] = x;
} else if (_root.P[x]._visible == true) {
space[x] = -x;
}
}
}


I am using an onLoad to run the function when the program starts. However, when I use a trace statement to display my array, I get an array that is undefined.

Any help is greatly appreciated, thank you in advance.

Oh, and in case it wasn't obvious, I have 33 buttons, each named "P1, P2..." etc

View Replies !    View Related
Conditional Statement
I have buttons within an MC that I'm using to navigate to different frames of the MC.

eg,

ActionScript Code:
lb_btn.addEventListener(MouseEvent.CLICK, lauren);
function lauren (e:Event) {
gotoAndStop (38);
}

I'm trying to include a conditional statement that will change the button instance alpha if the playhead is at a specific frame (and have the alpha return to normal when the playhead moves again).

I have

ActionScript Code:
if (currentFrame -- 38) {
lb_btn.alpha = 0
}
else
{
lb_btn.alpha = 100
}

But I'm getting an undefined property error. Does this condition need to be part of a function that's triggered with the CLICK event? Can you do two functions from one event?

View Replies !    View Related
E4x AND (&&) Conditional Does Not Compile
In the following, using "||" (or conditional) in the second text area compiles and runs fine. Using "&&" does not compile, with the compile error message "The entity name must immediately follow the '&' in the entity reference."

What's the proper syntax for an AND conditional?


ActionScript Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
    <![CDATA[
        [Bindable] private var xml:XML =
            <root>
                <a>
                    <aaa>1</aaa>
                    <bbb>2</bbb>
                </a>
                <a>
                    <aaa>99</aaa>
                    <bbb>7</bbb>
                </a>
            </root>;
    ]]>
</mx:Script>
    <mx:TextArea x="60" y="56" width="177" height="158" text="{xml.a.(aaa=='1')}"/>
    <mx:TextArea x="60" y="222" width="177" height="158" text="{xml.a.(aaa=='99' && bbb=='7')}"/>   
</mx:Application>

View Replies !    View Related
Conditional Statements For FLV
Hello all,

Yes, I am a complete newbie....but like a dog with a bone. I have a button that stops my flv and goes to another frame. But, if there is no video playing at the time I press that button, I get the following error:

VideoError: 1000: Unable to make connection to server or to find FLV on server
at fl.video::VideoPlayer/stop()
at fl.video::FLVPlayback/stop()
at index_fla::MainTimeline/stopVid()

I guess I need to write a "if flv not playing, do this" sort of deal. Help, Please.

Gwendolyn

View Replies !    View Related
Conditional Statements
Hello.

I love the if and else statements, I use it all the time. However it only lets me (with my current puny knowledge) do 'if this is this, do this, otherwise this". Is there a way to add more else's, or more ifs? So if a variable was set to one it would do this, set to two do this, so on and so fourth to ten for example?

I'm trying to fire a random tween on mouse over, I thought about using arrays but can't get it to work.

Thanks, A.

View Replies !    View Related
The :? Conditional Statment Example Please.
Hey all.

Can someone please give me an example of the :? conditional statment.

i just forgot how to use it and need a reminer.

View Replies !    View Related
Conditional Loader
wondering if there's a way to have my swf file load automatically when certain conditions are met in the browser.

like if they view x-image on a page it starts the movie. if they do not view x-image nothing happens.

View Replies !    View Related
Conditional Scene Changes
I've got an animation with 5 scenes (Scene1, Scene2, ect.). In Scene1 I have two buttons, one that would play the entire move (all of the scenes) and another that would play just scene 3 and 5. How would you attempt to code that? I know how to go from scene 1 to scene 2/3/4/5, but I'm not sure how one would go about playing only 3 and 5.

View Replies !    View Related
Help With Conditional Statement
1. I have given a group of button an onPress value of "w" so that I can reference them in a timeline of another movie clip.
In the timeline I have a conditional statement that checks for the value of "w" if the value matches any of the values in my list ...
then the playhead jumps 2 frames onto the last frame in the movie clip.

2. on the last frame there is another conditional statement that check the onPress "w" value again. This time if the value is equal to any of the prelisted values, the playhead goes back to the first frame.

3. My Problem - After the playhead goes to the first frame which has nothing in it but sends the playhead to the next frame with the 1st conditional I talked about, the values of the onPress I set is being read and matched...but the playhead does not respond.
I think - the value of one of the prelisted onPress buttons are still true.. which is preventing the condition from carrying out the code..

4. What do I do?

(Will post the file .. if my request to too confusing.. )

View Replies !    View Related
If Conditional Problem
Hy evrybody, I have a problem, its that. I have a movie with a differents buttons, and mc, and I need to tell the button think. Think like this, I write you what I want and tell if its possible, that I´m sure it is. " On press
if a mc its in a ??? number of frame tell target---go to. maybe the mc is one place or another and then the action change.I need to check before to teel what to do the clip where iss the frame in a mc. Thank you

View Replies !    View Related
Simple Conditional
Hello all,

I'm trying to create a simple conditional that basically just goes to a frame and plays if


Code:
stop();
if (_root.crunch == yes ) {
gotoAndPlay(2);
}
The variable "crunch" is loaded from an external text file and will contain either "yes" or "no." I was going to go with "true" or "false" but I wasn't sure if that'd conflict with any AS syntax.

What exactly am I doing wrong?

Thanks in advance!

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