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




Action Script Problem Simple Answer



Ok i have started off making my first text effect knowing only very tinsy amount of as.... and sadly i ahve ran into a problem allready. I am trying to get the text alpha 50 percent

var text="What time is it?";
text._alpha = 50;

Please help me.



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-14-2002, 04:17 PM


View Complete Forum Thread with Replies

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

[F8] Very Simple Question, Very Simple Answer, I Hope. (Flash 8, Collisions)
Alright, so I've got my ball that moves up and down; it has gravity too. There are two things I want to do:

1. I want it to 'jump' when the UP key is pressed, rather than just accumulatively move upward.

2. I only want gravity to be applied while the ball is in the air(In other words, I basically just don't want it falling through the floor; however, want the edges to be the collision, not the center, and I also still want to be able to jump afterwards.

Thanks for any help, I don't need an explanation, I can figure it out by looking at the code. I'm going to attach a basic file with what I already have, please add the coding to it, then send the file back. Thanks for any help, and I apologise if this is hard to understand, or if I sound any bit rude to be asking how to do something; I don't mean to.

Simple Problem. Simple Answer? Arranging Windows W/flash
SIMPLE problem. | SIMPLE answer?
We're trying to have a Full screen CD presentation in flash that plays .avi's in windows media player, & opens up url's in a web-browser. The problem is the URLs AND the .AVIs show up underneath the flash, is there a way to have them open on top of the presentation?

Thank you.

Random Tweens - Simple Question, Simple Answer?
Hello, I have one swf with a few different motion tweens inside their own movie clips. I want to write some code to play only one of the tweens at random. I know how to use setInterval to get the process to repeat with a delay. But I just want a different/random tween to play with each repeat. I hope that makes sense.

I imagine this must be easy, but I'm having a tough time getting it to work. Random tweens, somebody please help.

Simple Problem Neeeds Simple Answer
hey i figured one of u geniuses here could help me figure this out much faster than me fiddling around so here goes.

All I'm trying to do is have a button (which is loaded in an MC in _level6) allow the user to switch between languages on the website. To do this I figured all I would do is have it 2 scenes...one in English and the other in Chinese. When the user clicked the toggle button I would have it go to the current frame in _level0 but switch to Chinese scene.

Get it? basically i want it to switch between frames but remain on the same frame number. Here is the last piece of code I tried using, but nothing seems to work (this code is connected to the release of the toggle button)


Code:
_level0.gotoandplay("Chinese", _level0._currentframe)
Anybody got any idea what i need to do??

Thanks for your help!
Brad

Simple Question, Probable Simple Answer
still in my quest for new flash knowledge and being a "noobie" in the world of flash i would like help.

whats the easiest way to create a Button that upon rollover creates a text discription in a text box. just so i can give a description of what the button is going to lead to....

ohh and i will have multiple bittons on 1 frame and 1 designated box for all descriptions

thanx in advance

Simple Question - Simple Answer FLASH MX
hi you good people out there. hope you could help me too. using flash mx, not beyond beginner yet.
about finishing my homepage with it. one problem is there:
i have a premade flash and changed graphics, etc. all no problem, the menu is included as well - i have changed the text of the 9 menus already, works fine - only when i use the preview - the original text appears when going over with the mouse... i changed the text visible to me - but cannot locate and change the text for the mouse over.
for instance the first two of the menu named

start
gallery

i changed it to

home
pictures

in the prview it show again
start
gallery
upon mouseover.

so i need to locate where to change also that hidden text (only active upon mouseover) to the same word.

if anyone of you could help me - i would be going into learning faster and finally getting my homepage up and running. if needed please e-mail me at

harton@harton.at

thank you so much!

....................I have uploaded a screenshot of it - clearly you can see, I changed the text yet have to located the original text below of it (?) and write the same text so that it shows up correctly upon mouseover.....

Help With Some Action....asked In Another Forum...no Answer?
Hello...I am using Flash 5 and I have a question I am hoping someone can help with. I have 3 buttons:

"button1"
"button2"
"button3"

I am trying to have each button switch positions when one is pressed.
EXAMPLE
When "button2" is pressed, buttons changepressed button always goes to the top of the order)

"button2"
"button3"
"button1"

Each time the buttos are pressed they move to either middle or top with the other buttons moving in order as well. I hope this makes sense? Does anyone know of any actionscript that I can accomplish this with?

I asked this in actionscript forum, but got no answer. My only alternative is to do all the animation ...seems like way too much!

Simple Question - Simple Answer?
I'm looking to do something basic to start off with Flash - and I'm hoping this is the project. Basically, I'm looking to have a movie with an image (or images) that will fade in and out over a set period of time - as seen in this website.

http://www.westonfl.org (The pictures on the left - yes I know, this was done by 2advanced....)

Any help you can give, would be great. The more detailed the better.

Talk to me like I'm 5.

Simple Question With Hopefully A Simple Answer.
Ive only just started making games in flash and im wondering how i can make it so my little birds eye view character can be stopped from running into buildings... in other words i want to make my buildings so you CANT walk on em or under em!..

haha im hella nOOb i probably sound like a loser.. but if you could waste your time on me it would be greatly apreciated!

CHEERZ 1337 Hax0rz.

Simple Answer For A Simple Question?
ok what this code does is it rotates my mc (mainclip)(it has 3d objects) as the mouse moves left or right on the x-axis.... and it works:

stage.addEventListener(MouseEvent.MOUSE_MOVE,myFun );
function myFun(event:MouseEvent):void
{
mainclip.rotationY= stage.mouseX;
}


...but what if i wanted to stop it rotating after it has rotated a certain amount to the left or to the right?

at the moment it rotates 360degrees in each direction, and i want it to rotate about 60degrees in each direction........

thanks.

Simple Question...simple Answer
ActionScript Code:
var prslide:slide1 = new slide1;

ok, say i din't want to have it always be slide1. how can i change it at runtime.
for instance make a loop that incremented the value of and did something like

ActionScript Code:
i++
var prslide:("slide"+i.toString()) = new ("slide"+i.toString());

this used to be easy in as2

Simple Problem, Simple Answer?
I've just successfully completed replicating your tutorial for a simple drop-down menu ( http://www.kirupa.com/developer/mx/dropdownmenu.htm ) which works perfectly... almost.

In my Flash movie, I've created three scenes (...Scene 1, Scene 2, and Scene 3...). In my drop-down menu movie, there are three buttons that corrispond to the three scenes. I've dragged my 'drop-menu' movie onto each scene.

Here's the problem. Inside the movie that creates the drop-down menu, I have attached the following action script to the 'Scene 1' button:

on (release) {
gotoAndPlay("Scene 1", 1);
}

I've attached a "Scene 2" actionscript to the 'Scene 2' button, and a "Scene 3" actionscript to the 'Scene 3' button.

Yet, when I play my primary Flash movie, the drop-down menu buttons don't take me to the corrisponding scenes. What am I doing wrong?

Simple Question Simple Answer
I want my button to go to a particular frame on release, can someone please show me the AS for this? I am using Flash MX for reference.

Simple Question? Simple Answer
Hi i am creating a navigation menu and has a rectangular border around it. The menu has buttons e.g home, about etc. However the border is not a symbol, if i convert the border to a movie clip say, how do i ensure that the border still becomes underneath the buttons?

Every time i convert it to a symbol, the border is always on top of the buttons.

Thanks

Simple Problem, Simple Answer?
I've just successfully completed replicating your tutorial for a simple drop-down menu ( http://www.kirupa.com/developer/mx/dropdownmenu.htm ) which works perfectly... almost.

In my Flash movie, I've created three scenes (...Scene 1, Scene 2, and Scene 3...). In my drop-down menu movie, there are three buttons that corrispond to the three scenes. I've dragged my 'drop-menu' movie onto each scene.

Here's the problem. Inside the movie that creates the drop-down menu, I have attached the following action script to the 'Scene 1' button:

on (release) {
gotoAndPlay("Scene 1", 1);
}

I've attached a "Scene 2" actionscript to the 'Scene 2' button, and a "Scene 3" actionscript to the 'Scene 3' button.

Yet, when I play my primary Flash movie, the drop-down menu buttons don't take me to the corrisponding scenes. What am I doing wrong?

Simple Question Simple Answer
I want my button to go to a particular frame on release, can someone please show me the AS for this? I am using Flash MX for reference.

Simple Question Needs Simple Answer
Is Flash MX Trial cutdown in any way at all?

SIMPLE Problem. | SIMPLE Answer?
We're trying to have a Full screen CD presentation in flash that plays .avi's in windows media player, & opens up url's in a web-browser. The problem is the URLs AND the .AVIs show up underneath the flash, is there a way to have them open on top of the presentation?

Thank you.

If You Know Action Script Then You Could Answer My Easy Question
I have made a mp3 player that loads external mp3's. I need to make it buffer for dailup connection though. I am not fluent in action script yet so maybe you can help.

Action Script needed=
getting if percentLoaded (variable)= 25% of the song loaded to goto and Play frame (43)

Here is the script that it is in:::

function loadFile() {
if (sound_1 instanceof Sound) {
}
_root.createEmptyMovieClip("holder", 1);
sound_1 = new Sound(holder);
vol = 100;
sound_1.setVolume(vol);
sound_1.onLoad = function(success) {
if (success) {
sound_1.stop();
} else {
clearInterval(checkProgress);
}
};
sound_1.onSoundComplete = function() {
loadStatus.text = "";
loadFile();
playing = true;
paused = false;
stopped = false;
dummy = 0;
sound_1Position = 0;
};
var loadUrl = checkField();
fileURL.text = loadUrl;
sound_1.loadSound(loadUrl, false);
progressBar._xscale = 0;
loadStatus.text = "loading streaming audio.";
checkProgress = setInterval(checkLoad, 50);
}
function checkLoad() {
var obj = sound_1;
var tBytes = obj.getBytesTotal();
var lBytes = obj.getBytesLoaded();
var percentLoaded = (lBytes/tBytes)*100;
progressBar._xscale = percentLoaded;
if (lBytes>=tBytes) {
clearInterval(checkProgress);
}
}
function removeSound() {
sound_1.stop();
delete sound_1;
holder.removeMovieClip();
loadStatus.text = "";
fileURL.text = "";
Selection.setFocus(fileURL);
}
function checkField() {
if (fileURL.text != "") {
return fileURL.text;
if (this.precentLoaded=25) {
gotoAndPlay(43);
}
} else {
if (songList.length == 0) {
initSongList();
}
return songList.shift();
}
}

thank you for your time
Patrick

Action Script Question, Please Answer Quickly.
i have a question. in action script, how do i make a text button turn into another object on mouse over? i want to make a button turn into a square or get bold, how do i do that?

please use in-depth explanation

Should Be A Simple Answer...
hello. Here's my problem:

I have a ball bouncing off objects. the problem is, sometimes the ball gets stuck inside the object and bounces back and forth. Here is the code I'm using:

onClipEvent (enterFrame) {
xpos = _x;
ypos = _y;
xpos = xpos+xspeed;
ypos = ypos+yspeed;
_x = xpos;
_y = ypos;
UpdateAfterEvent();
if (ypos+yspeed>maxY) {
yspeed = -yspeed;
wHit.start();
}
if (yPos+yspeed<minY) {
yspeed = -yspeed;
wHit.start();
}
if (this.hitTest(_root.gameboard.paddle)) {
xspeed = -xspeed - (5);
pHit.start();
}
if (this.hitTest(_root.gameboard.paddle2)) {
xspeed = -xspeed - (5);
pHit.start();

Is there a better way to do this? Thanks,

Andy

Simple Answer
I have three check boxes 1. Square 2. Circle 3. Triangle if any one of the check boxes are selected the movie needs to make any of the selected checked boxs 100% alpha and the remaining, unchecked left at 50% alpha. I can't seem to get the action scrit right. any thoughts or is this question too vague. I have the check boxes labled
(this is in the unchecked state)
stop ();
instanceName = "triangle";
set (instanceName, "");
../:resultsField = "";

(in the checked state)
stop ();
instanceName = triangle;
set (instanceName, "True");
../:resultsField = "";

and after that I have a simple submit button and i can't seem to get the action script to communicate to proceed to the next key frame on the main time line that has the movie clips 50% that will change to 100%

Hope this isn't too vague, I can try and explain better or send the fla to see my horrible attempt.

Cheers

Probably Has A Very Simple Answer But....
how do you make a button load a movie and go to a specific frame in the loaded movie?

Probably A Very Simple Answer To This
I am trying to load another flash movie into level 1 and then when the user clicks a button in that movie havi it return to a particular frame in a particular scene in the level 0 flash movie and have it continue playing from there.

Can anybody help me please?

Should Be Simple Answer
my MC stops @ frame 10...i want on rollover for it to go back to frame 1 ...|||here is my problem- i only want it to do this if its on frame 10 and no other frame should listen to the rollover... im not sure what i use do it....i know what im doin i just need to know----should be simple enuff

Very Simple To Answer If You Know
I want to do a tweening shape with 2 jpegs pictures. I did it but they swap without morphing step by step. could you tell me how to do this step by step. Thanks

Simple Q That Anyone Could Answer Except Me .. So Pls Help
ok here the situation looks like ..
i got an external swf appears on top of my movie screen ..
the problem is that i dunno how should i do if i'd like to close the external swf window by not affecting my current movie screen ..

fyi, i got a CLOSE button on the external swf but if i use
_____________________________________________

on (release) {
fscommand("quit", "true");
}

_____________________________________________

all windows will be closed ..
what action should i use in this situation ..??
thanks in advance ..

Please Help - Simple Answer
I am a real newb i cant work this out,
I want this cartoon ive made, not to start untill the play button is clicked. I woulda thort i new how to do it but obviously not:|
can someone please help, its the coding im stuck with

Simple Answer I Am Sure
how come after you put all the puzzle pieces in the correct spots you do not get the message, "You Puy Jessica Back Together Again."? i kept messing around with it i do not know what is wrong. All the coordinates for the movie clips are correct.

chris

This Should Be Simple For Someone To Answer...
How would I create a grid with ActionScript? Ideally it would be tiled boxes that i could change the fill color, line color, alpha, box size, and input stage dimensions into (so the grid is scaled according to the movie size, or maybe a better way to put it is "in proportion" to movie size.

).....basically, i want to more or less have the have the look of graph paper (or the grid in Flash) as part of the background. I have found a bunch of different code samples but can't figure out how to edit any of them to suit my needs.

any help please?? thanks

[MX] Simple Answer, Im Sure
Hey im sure this is asked alot around and an answers probably right in fornt of my face but, Im using microsoft word as a webpage builder (because frontpage sucks and im not aware of anything else thats free) and i want to take my flash .swf files and put them on the website, however i have numerous buttons and i want to be able to move them freely around the page like i could a picture. Not sure if im explaining this right but, any help? Or suggestions for a better web page editor?

Probably A Simple Answer
Okay this sounds like the most basic problem but it's annoying me no end.
I'm creating an object in flash and then going to change it into a graphic, and make children movie clips (it's a person, with each child movie clip being a different limb, head, torso etc). But when drawing and colouring the object in, I can't seem to get flash to only colour one section ie. just the tshirt and not the skirt.
There is a line seperating them so I assumed it would behave like MS paint and just fill the one section, but it fills the t-shirt and skirt with the same colour. Any suggestions?
Thanks!

Simple Answer.
Hi.

Can anybody tell me hur i can call a item with a var?

var tempName = _root.nav.images."item_"+i;
tempName.gotoAndStop(tempLink);

You guys perhaps have a more simple way to do this.

//F

Probably A Simple Answer This...
I recently purchased a template, and I am trying to add gallery buttons to it. I can find the button and copy it, but each time I change the text, it changes the text of the one I duplicated as well.

Any help would be much appreciated.

Thanks,
CP

Probably A Simple Answer...
Is there a way to give an item a NEW instance name after it has been placed on the stage using AS?

Example: Everytime a movieclips y value = 0, I want to give that moviclip an instance name of firstPos.

Thanks!

Simple Quick Answer? Please Help Me :) Please
What I wanted be able to do

I have 2 seperate flash .swf files on 1 html page, right:::

1 file is always on every page

the other is a heading banner.

I want the top heading .swf file to tell the main .swf file )that is ALWAYS on every page) to load a certain .swf in that certain movie, but from the banner .swf movie

ie.

I want the banner.swf movie at a certain frame to tell the main.swf
to load in Place a certain.sf movie

both these movie are on seperate portions of an html document

this is NOT ONE big flash file.

please help please someone anyone

fs comman whaaatt?

the page I am wekin' is here at http://www.mjdurious7.co-inc.com/

Simple Quick Answer? Please Help Me :) Please
What I wanted be able to do

I have 2 seperate flash .swf files on 1 html page, right:::

1 file is always on every page

the other is a heading banner.

I want the top heading .swf file to tell the main .swf file )that is ALWAYS on every page) to load a certain .swf in that certain movie, but from the banner .swf movie

ie.

I want the banner.swf movie at a certain frame to tell the main.swf
to load in Place a certain.sf movie

both these movie are on seperate portions of an html document

this is NOT ONE big flash file.

please help please someone anyone

fs comman whaaatt?

the page I am wekin' is here at http://www.mjdurious7.co-inc.com/

Simple Question - Please Answer.
how do you limit the movement of a movie clip?

ie keep it within a circle when it is following cursor for example.



many thanks

Simple Question, Need Answer Though
Hey when I say 'simple' I mean simple for an actionscriptter, not someone new to it. So plz read it.

Example:

Imaging you have 3 movie clips the same but with the different instant names:

tree1
tree2
tree3

What I want to do is to have the number as a variable which can be attached to the word 'tree' to form the target of the movieclip.
In english, I want to tell flash to have the word tree + a number (variable) to make the instance name

e.g. tree + 5 = tree5

Plz help, I will be grateful

Thanks

Probably A Simple To Answer Question....
I hope this can be accomplished...here's my dilemma....

I have made a 1 frame movie clip containing pictures and text that I wish to scroll up and down the screen by pressing buttons that are not part of that same movie clip...

I've tried so many different action scrips but i believe the problem is that i simply do not understand variables.


thanks

Simple Question First One To Answer It Gets....
...the satisfaction of doing a good deed for the dude. All i want ot know is how to make my movie popup with a defined window size. basiclly when u type my url u come to a screen with essentially a big button/movie that will open an html document that is only as big as my .swf file. I am sure this is easy and im prolyl a dumbass for asking but i appreciate the help.

--->Please Answer A Very Simple Question :-(
I posted this Q in General help but after 2 days got no reply so I am posting here as I normally get an answer :-) Sorry if I am breaking any rules.
I need to know this
.....................................

Info panel related.

Imagine I place say a black square object on the main stage at x10 y10.

Next I create and place a movie clip called "head_ache" somewhere on the main stage > then I go inside this "head_ache" movie clip and place a green square (exactly same dimension as the black square lying on the main stage).

Then while inside the "head_ache" MC I dial in x10 y10 for the green square in the info panel. The green square inside the MC does not end up on top of the main stages black square.

The green square is on the x10 y10 of the "head_ache" movie clip and not x10 y10 of the main stage.

Is there a way in which I can place an objects in this case the green square which is inside the "head_ache" MC based on the documents main stage x-y co-ordinates rather than the MCs x-y co-ordinates?

I hope you understand what I mean. Something similar to the Align palette where you can align based on main stage or locally.

Normally I use the guides on the main stage which are visible when I go inside other MCs to place the green square exactly on top of the black square.

How can I do it based on dialing in the x-y co-ordinates in the info panel.

Can't I make the x-y on the "head-ache" MC info panel global?

ie. x-y will be x -y based on the main document and not the inside of the "head-ache" MC?

Please is there a better way than using guides and visually placing it with the keyboard arrow keys?

Thanks for your time

Question Too Simple, No Answer
how can i insert a motion tween to the "over" stage of a button?

ex: make the color or size of the button "gradually" change on the over stage.

Help With An Answer To A Simple Question
I need to make a script to count as fast as possible to a number.

For reference, that number is 6022000000. Can anyone help me, I have tried for things such as a++, but it doesn't seem to work so hot...

Thanks in advance.

Can Anyone Answer My Simple Questions?
Hi! I'm really new to flash, and I'm not understanding it very well. I just need someone to help me with some real basic stuff. For example, what do the little symbols in the timeline mean? The squares and circles...I was just working on a cartoon, and had just selected something I wanted to turn into a symbol, but I accidently pressed F7, and now all the frames between the one I was working on and the last one have little white circles in the timeline, and are blank when I try to play the video! How do I get the figures to show up again, and what do the open circles mean?

Simple Question, Please Answer
How do I have a custom right-click menu for my movie? I want it so when you right-click it'll say things like "My Site" that will link you to my site.

Can Anyone Answer My Simple Questions?
Hi! I'm really new to flash, and I'm not understanding it very well. I just need someone to help me with some real basic stuff. For example, what do the little symbols in the timeline mean? The squares and circles...I was just working on a cartoon, and had just selected something I wanted to turn into a symbol, but I accidently pressed F7, and now all the frames between the one I was working on and the last one have little white circles in the timeline, and are blank when I try to play the video! How do I get the figures to show up again, and what do the open circles mean?

Simple Questions Need Answer FAST
I have a deadline in like 2 hours and I need to know how to detect which frame a movie clip is at..

i mean, i want something to happen if it is at that frame one, and something else when it is at frame 20..

SIMPLE Question... Important Answer :(
Im a pretty good flash 5 actionscriptor, and overall i am not to shabby with flash, BUT there is one thing i dont understand... how do you make music fadeout at a certain TIME. I know how to fade it in or out depending on the songs length, but is there a command to make it fade out when i want another song to fade in?...

thanks in advance

(PS)
i already know how to custom edit things within the sound options... but thats not what im lookin for.

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