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




Quick Actionscript Ques.



Ok so im building a portfolio website and basically if you click on the art image it goes tothe next art image..I have it set up so the art images are buttons and when u click it, it is coded to goto next scene..On one scene however the art image is a movieclip (fading effect)...now how do you write the actionscript so if you click on the movieclip it goes to the next scene? I dk im right but...my guess is to put the MC within a button symbol? But I dk. Thanks guys.



Ultrashock Forums > Flash > Flash Newbie
Posted on: 2005-05-03


View Complete Forum Thread with Replies

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

Quick Mask Ques
Im sure this is an easy one.. on the foofighters website http://www.foofighters.com When U click a button that flourish/swashy graphic looks like it is unwinding or growing rather. I would like to get the same effect.. Its obviously a mask of some sort. I know who to mask, im just figuring its a mask that is animated somehow. Anyone have an idea? Appreciate any insight into this. Peace

-R

<> QUICK QUES RE:Positioning After Dupe
Hi Im using a while loop and the dupliacteMovieClip() to dupe a certain number of my Mc's. I want to postion each duped Mc after its created with setProperty but I cant figure out how to do this within the same loop.
It complains in output box:

Symbol=playlist_Mc, Layer=Layer 2, Frame=1: Line 9: Expected a field name after '.' operator.setProperty(_root.playlist."box" + count, _y, vertpos);

Obviously I cant do the <"box" + count> bit, but how else can i do it?
(see code below)



Code:
onClipEvent(load){

var vertpos = 46;
var count = 0;
//create
while(count!=4)
{
duplicateMovieClip(_root.playlist.box, "box" + count, 1);
-->this doesnt work//setProperty(_root.playlist."box" + count, _y, vertpos);

trace(count);
count++;
}
//position
}


-Rich

Loading Clips Into Levels? -quick Ques
Hi, I need a quick bit of code or at least somebody to give me an idea on how to actually have a clip load itelf into a specific level depending on the value of a variable. I want to do this as my duplicateMovieClip() code is putting MC's on higher levels than other elements (other Mc's) in my movie, and one of these elements in perticular needs to be the 'highest'.

I tried using setProperty() as below but it doesnt work, flash complains (I gather it doesnt consider '_level' as a property?)

Code:

setProperty(need2BHighest_Mc, _level, highestLevel);




Any help appreciated

Nav Ques
Hey guys I seem to remember a thread regarding how to make this kinda of NAV :

http://dopepope.com/ntps/Build_onff/


Anyone remember the thread or have a link on a tutorial to dup that kind of load jpg and have the window resize automatically...thanks all

_parent. Ques
im trying to load an external jpg. and the file name of this jpg is the name of the mc 2 levels above the command.
if u dont understand this is thi code im trying to use

Code:
x = _parent._parent._name;
loadMovieNum("x".jpg, 1);

i also tried putting th eparent crap in the load move itself like this

Code:
loadMovieNum("_parent._parent._name".jpg, 1);

and its still not working. any one able to give some advice

AttachMovie Ques
Hi -
I'm using the code below to bring mcs from the Library to the stage. It works fine until I tried to add the x,y at the end.
I thought there was a way to include _x and _y coordinates to the same statement as the attactMovie. Is there?

TIA the correct way to accomplish this.

jl







Attach Code

mc_btn2.btn2.onRelease = function():Void {

attachMovie("Q2WithGame","Q2Game",this.getNextHighestDepth,[_x=45,_y=110]);

};

Simple AS 1.0 Ques
AS 1.0
I have this code in a keyframe on the main timeline:

var score = 0;
if (score == 2500){trace("winner")}

Othe stage in the maintimeline i have a dynamic text field I labeled "score" in the var box. The instance name is "pts" but i wasnt sure if i needed an instance name anyway here. The score box works fine as far as keeping score but when it reaches 2500, I dont get my trace. What am I missing? Thanks

-Chris

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Attaching MC Ques
hi.. anyone out there can give me a tutorial which teaches attaching a MC to another MC?? urgent..

Stupid Ques
hello new be ere (welsh) i got a prob wanderin if some1 could help im tryin to get a news page that updates ive got this off yahoo

this

so now tryin to use it but flash does ntlike it im prob doin some thing stupidly wrong now on the verge of not botherin

PLEASE HELP

Flash Ques
please can you explane me how can I make this file like on this site:
http://www.t-s-k-b.com .You go on this site and press SAKUBA WORKS and then button Painting/Drawing

I would like to make a picture gallery like in Painting/Drawing: So how I can make when the mause on the button to show small image of the picture and when I press the image to open the picture how is on the site(not in a new window)?
Please tell give me advice how could I make it!
thank you

Another Loading Ques
Is it possible to make the movie load let's say... only the 1st 2 frames of movie that has 8?

Button Ques
Ok real dumb ques..I have this animation..u can dl it from here: www.zeroxposur.com/test/nav.fla
So what I want to do is have 5 buttons fade in ..onto the bar as it finishes its animation..but I dont know how to do it.. Can anyone point me in the right direction. Thanks

Easy AS Ques.
ok so I have a flash doc..theres a an MC called target on mainstage that has the entite site in it (doing a fullscreen centered website)..now I have MC nav buttons on the stage (inside target). Inside one of the nav buttons I have a line of AS that says


ActionScript Code:
this.onRelease = function(){
    _root.target.loadMovie("bioresume.swf", "loader");
}


Now im not sure If im doing that right..but what i want to happen is; after u release the button, load the ext swf into the empty MC called "loader". But what seems to be happening is it loads the ext swf but everything else on the site disappears. See I originally had this as my AS cause i thought this made sense but it ends up not doing anything:


ActionScript Code:
this.onRelease = function(){
    loadMovie("bioresume.swf", "loader");
}


So if anyone knows what I did wrong, much appreciation. Heres the site link if u want a visual:

www.josephsernio.com/test

Easy As Ques.
Ok for some reason the end of this code doesnt work.. on release, i want it to take me to frame 2..and it wont...btw this a movie clip that has button properties through AS:



stop();

this.onEnterFrame = function(){

if(rewind == true){

prevFrame();

}

}

this.onRollOver = function(){

rewind = false;
play();

}

this.onRollOut = function(){

rewind = true;

}

this.onRelease = function(){
gotoAndStop(2);

}

MC Loader As Ques.
im working with the moviecliploader AS..so a button loads an ext SWF and also has a percentage loader .. so on my mainstage i have a loader mc (instance name "loader")and a holder mc (instance name "holder")..heres my AS on the main timeline:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
loader.percent.text = Math.round((loaded/total) * 100) + "%";
}

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);





Now i have another MC that houses about 20 or so buttons..so within the buttons MC i have say this for one of the buttons:

b4sub.onRelease = function() {
_root.loader._visible = true;
_root.mcl.loadClip("LevisCampaign.swf",holder);



And unfortunetly it doesnt to load the ext. swf..did I code the _root incorrectly?

Thanks for your help.

Fscommand Ques
Hi all, I was working with fscommand, when it struck me what FSCOMMAND stands for.

"Future Splash Command"

Can anybody confirm this, or am I mad, lol

Later

ORANGE900

LoadVariables Button Ques
Hello all. I have this code attached to a button calling up a different text file to a dynamic text field and it works fine, except I'm having to hit the button "twice" for it to work. Can't figure out why. Can someone enlighten me please?


code:

on (release) {
scrolltext = scrolltext1;
loadVariables ("scrolltext1.txt", scrolltext1);
}

Thanks in advance

Easy - Pong AI Ques.
Ok just to see if I could do it(never really got into game programming) I tried to make a pong game everything works so far but I have a problem with this:
Flash code:

PHP Code:



onClipEvent(enterFrame) {
if(_global.cspeed == 0) {
}else{
    if (this._y != _root.ball._y){
        if(_root.ball._y < this._y){
                this._y -= _global.cspeed;
        }else if(_root.ball._y > this._y){
                this._y += _global.cspeed;
        }else{
                this._y = this._y;
        }
    }
}
}




The problem is that instead of moving smoothly up the screen it looks like it s shaking up and down really quickly, but I would like it to be smooth.
Please help.

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

Movie Clip Ques
Hey i just started doing flash yesterday and i am doing a text fade

I made the motion tween and and everything and when i go to control and play everything is smooth but when i go to test movie nothing it just stays the same and doesnt fade :> plz help me

UI Text Input Ques.
Ok so Im making a form in flashmx2004..I drag out onto the stage the UI compnent textinput box..now I want to make this box multiline but it doesnt give me the option to do so. Do I have to make input boxes in a different way?

Motion Guide Ques
Hi all,
Is it possible to create a motion guide, so the object connected to the motion guide is always in the centre of the screen.

What I mean is, if we were trying to go from point A to point B
we could see the full journey of the object travelling along motion guide in the centre of the screen.

A-------->--------->-------->------B

The sort of thing I mean is included, but with no motion guide instead, the car remains in the centre of screen and is able to move around the track which in turns moves the the track below.

Thanks for your time, sorry for the broken language. Hope you can help.

--------------
FLA = MM2004

Pleez Help With Random Keyframe Ques.
I have four different movie clips on four different keyframes (2-5) the first key frame has a clip with an invisible button over it. WHat I would like to achieve is onMouseover of the button in the first frame......I would like the playhead to randomly gotoAndStop on of the other frames (2-5). To give the illusion of random movement. The on mouseout return to the first keyframe. any help greatly appreciated....either a .fla I can study or some AS would be great.

Probably Simple LoadMovie Ques. For JPEGs
I have a target MC that I want to load some JPG's into in my Flash Movie. The Target MC's dimensions are 650x500px. The JPG's are the same. When I attempt to load them, I can notice that something has changed in the tone of the movie clip (I had the target MC a grey color then that color disappears) but the JPG does not load.

I tried a smaller JPG, like 1/4 the size, and it loaded OK. ANyone have a suggestion?

Action Script Ref Code Ques
Hello i keep getting this this action script error when i attempt to render this swf could some one explain what this error message means ......i am not sure what the variables are looking for ....... the version is Flash 8 - the action script is below and the error message is below that.......

#include "lmc_tween.as"
//classes are loaded on this frame
var state:com.collection.State = new com.collection.State(this);
// start program
var main:com.collection.Main = new com.collection.Main(this)
//
bg_img.tween("_alpha",100,1,"linear",.5)
stop()

Error message (below)

**Error** Scene=Scene 1, layer=actions, frame=5:Line 1: Error opening include file lmc_tween.as: File not found.
#include "lmc_tween.as"

**Error** Scene=Scene 1, layer=actions, frame=5:Line 3: The class or interface 'com.collection.State' could not be loaded.
var state:com.collection.State = new com.collection.State(this);

**Error** Scene=Scene 1, layer=actions, frame=5:Line 5: The class or interface 'com.collection.Main' could not be loaded.
var main:com.collection.Main = new com.collection.Main(this)

Total ActionScript Errors: 3 Reported Errors: 3

Action Script Ref Code Ques 2.0
Hello please see this link it is a follow up to the thread i created before....i am stil trying to figure this error out when i generate the flash swf it works but not properly... below is a link to what the swf looks like there are buttons that should show and i get this message (shown below) in the flash error box that says (output) when i hit ctrl+enter to generate the swf.... any suggestions...?

b1,b2,lgText,redText,arrow,a:link,a:hover
yo

http://www.amjaydesign.com/mainCol.html


http://board.flashkit.com/board/showthread.php?t=744878

Simple Ques About Blue Border Box
I'm using flash 8. When you draw something or import a picture flash 8 puts the blue border box around it. Well mine is gone. If I draw something and click on it it is a broken shape. How do I get the blue border box back?thanks

Quick Actionscript Help On This?
I am trying to edit some actionscript. PLEASE help me!!! In my website i have a button that launches an application - here is the code for the button:



ActionScript Code:
onClipEvent (load) {
    this.num = 2;
    this.container_mc.gotoAndStop(this.num);
}
on (rollOver) {
    this.gotoAndPlay("over");
}
on (releaseOutside, rollOut) {
    this.gotoAndPlay("out");
}
on (release) {
    if (_root.flagim == 1) {
        _root.flagim = 0;
        _root.i = this.num;
        _root.imapp.play();
    }
}

I have another button and I would like for it to launch a DUPLICATE of this application. But my problem is that I cannot understand which bit of this script launches the application? THe symbol in my library for the application is called "app-bigim" but i cannot see "app-bigim" in this code??? The only thing that I thought would have been that is "imapp" on the last line but i have no symbol called imapp in my library.

I created a duplicate of "app-bigim" and called it "app-video". SO all i would to do is to edit the code above so that when I press the second button with the new code and it will launch the "app video" instead of "app-bigim".

THanks for the help in advance

Quick Actionscript Help Pls
Quick question... someone else built this and I'm just trying to modify one frame loading action here... does someone have one minute to save me from having to do the full ActionScript 2.0 course here!?

Frame one - intro has a button with action "flipscene" to bypass intro. (plus sound loop playing)


Code:
flipscene = function(){
gotoAndPlay("main","1");
}
endLoop = function() {
myLoop.stop();
}
stop();
I need to insert one line to make it automatically load ("main","1") AFTER the end of the Intro so that it automatically loads the home page, not requiring the "click to proceed" button that is there currently... I've made a few attempts and so far all I seem to have managed is to bypass the intro completely and only load home page... argh. So what would be syntax for

(on end of frame) end = function(){
gotoAndPlay("main","1");
}

The Intro frame seems to be only 1 keyframe, with the images lasting longer but there is no keyframe at the end or option to move through the frames, only frame 1. So much for "if Frame=600, gotoandplay" next frame...

Any ideas?

Html Code Inside Flash Ques
I have a client who wants me too put some html inside the flash actionscript. He's not sure it will work and I'm not sure if it's possible or how to do it. Here's the code any suggestions thanks

<form action="/gift/save/1234" enctype="multipart/form-data"
method="post">
<input name="file" type="file" />
</form>

A Quick ActionScript Shortcut..
I was wondering how one would acheive this bit of ActionScript shortcut...

I have 43 instances of the same movie clip all named "window00" through "window42" embedded in movie clip instance "stage1". I want to pause all 43 instances. To save valuable code, I want to make a loop with an "i" value that will simply run through 43 times, but can't figure out how I can mix strings with ActionScript commmands.

Example:

This works:
Code:
stage1.window15.stop();
This doesn't:

Code:
i = 0;
while (i < 43) {
z = "stage1.window"+i;
z.stop();
i++;
}
Does anyone know of a way to acheive this without listing 43 individual commands?

Quick Search - Actionscript
I am currently trying to develop a quick search facility on each of my webpages and have created an input text box to enable users to enter text or key words for a quick search

At the moment I have the text Quick Search with an input text box next to it

Can anyone help me out with what kind of actionscript I need to put in it so when the user hits return it is sent to the server?

I am working with a computer programmer who is doing the integration of the database and writing the parsers, but I need to know how to create the front end script and form elements?

Any suggestions or recommended tutorials would be really appreciated

Ravenotice

Two Quick Actionscript Questions
is there any eqivalent to pressing the f11 button in IE for action script? and how could i disable and enable buttons using AS?

Mantis

Quick Actionscript Question
I have this code for background music on frame 1 of my scene

//Background Music
background01=new Sound(background01);
background01.attachSound("background01");
_root.background01.start(0,999);
background01Volume=40;
background01.setVolume(background01Volume);

For some reason ever time I come back to this frame using the navigation in my scene my audio controls stop working. I think it has to do with the 'background01' track reloading each time it enters frame 1.

Looking at the code above do you think that would cause a problem?

Quick Actionscript Question
here is my slide show code how can i set the jpg's to be a certain size on display?


pic_arr = ["house2.jpg", "house3.jpg", "house.jpg"];

blank_mc.attachMovie("slideshow", "uuShow", 1, {
_x:125, _y:100, _visible:false, fps:12, nFrames:24, alphaIncr:10,
slides_arric_arr, slideDepth:50, repeat:true});

blank_mc.uuShow.addListener(blank_mc);

blank_mc.onSlideLoaded = function(i) {
(new Color(this._parent["dot"+i+"_mc"])).setRGB(color_arr[i]);
//trace('slide '+ i + ' loaded');
};

blank_mc.onAllSlidesLoaded = function() {
this.uuShow._visible = true;
this.uuShow.beginTransitions();
};

blank_mc.onShowOver = function() {
//set repeat:false in uuShow for this to be called
//trace('slideshow is over');
};

Quick Actionscript Question
hey all, i was hoping you could help me figure out how to fix this little problem. take a look at this following chunk of code, it's a counter that starts at a certain number (startNum) and currently counts upwards. i want to have it start at startNum and count backwards down to a different number (stopNum). i know i have to define stopNum, but i'm not sure what else to do. thanks for any help you can provide.

speed =1;
startNum = "0000025";
stopNum = "0000005";

if (startNum.length<10) {
for (i=0; i<13-startNum.length; i++) {
startNum = "0"+startNum;
}
}
numArray = startNum.split("");
numArray.reverse();
flip = function () {
mc_1.flip();
};
setInterval(flip, speed);
stop();

Quick Actionscript Question
Hi,

I am new to Flash, but I have been having a lot of help from others that do know Flash in letting me create a mini-game. Here is the idea:

I want a box to hitTest with 25 items (roll over them, makes them disappear).

This is all coded already. At the very bottom of my hitTest series of codes, it has the following :

Count++;

Then, in another layer

var Count = 0;

Check in timeline {
if(Count==25) {gotoAndPlay(2); }

What I need help in is figuring out what the correct script is for the CHECK IN TIMELINE part... The person who was helping me couldnt remember, and I can't find a tutorial on this anywhere! If someone could help me out, I'm just one line away from finishing my game! :-) Thanks!!

[F8] Quick ActionScript Qustion.
Alright so heres what i want to do.

I have a movieclip thats called into another movieclip.

That movieclip contains 4 dynamic textboxes .

and this movie clip is called in multiple times when certain buttons are pressed so I use (+i) when I add a new movieclip.

What I want is for the information in these text boxes to be sent out in a php email.

How would I go about doing that.

Any help would be great.

Quick One For Actionscript Guru
found this script to load a textbox with scroller dynamicly but the scroller doesnt display. can anybody tell me whats wrong with the add scroller part.


Code:
script:
on(release){
tmp = new LoadVars();
tmp.load("test.txt");
tmp.onLoad = function() {
createTextField("display",1,5,5,370,200);
display.multiline = true;
display.wordWrap = true;
display.html = true;
display.border = true;
display.borderColor=0xFFBE00;
display.background = true;
display.backgroundColor = 0xeeeeee;
_root.display.htmlText = _root.tmp.blah;
// add scrollbar component, this part does seem to work
_root.attachMovie("FScrollBarSymbol","scroller",this.getNextHighestDepth());
scroller._x = 370;
scroller._y = 5;
scroller.setSize(201);
scroller.setScrollTarget(display);
scrollColors = {lightest:0xFFBE00, medium:0xeeeeee, darker:0xb7770d, darkest:0};
scroller.setStyleProperty("arrow", scrollColors.darkest);
scroller.setStyleProperty("face", scrollColors.medium);
scroller.setStyleProperty("shadow", scrollColors.darker);
scroller.setStyleProperty("darkshadow", scrollColors.darkest);
scroller.setStyleProperty("highlight", scrollColors.lightest);
scroller.setStyleProperty("highlight3d", scrollColors.medium);
scroller.setStyleProperty("scrollTrack", scrollColors.lightest);
};
}
im using flash8 pro if that makes any difference

thanks in advance
john.

Quick Actionscript Question
If you have two superimposed movie clips, how would you refer only to the exposed area of the bottom movie clip? Let's say that there's a large circle with a smaller circle on top of it. If you have...

smallCircle.onPress = function() {
do something...
}

bigCircle.onPress = function() {
do something else...
}

...clicking on the small circle would be interpreted as clicking on the big one as well. How would you get the click to apply only to the samll one?

Quick And Simple Actionscript.
simple. im loading a bunch of buttons w/ sound effects on them, and i want the buttons to appear as they load, so say i have five buttons. i assume that i make five frames and on each frame, put one more button then the last (first frame has 1 buttons, 2nd frame has two buttons, etc). whats the actionscript that basically says "if frame 2 is loaded, go to frame 2 and stop" i know this junk is easy, i just havnt had the time to learn actionscript yet.

Quick Actionscript Question
let's say I have one layer, and in the first frame i have movieclip1, and in the second frame i have movieclip2, i've been trying to figure out how to keep it on the first frame until it finishes the movieclip1 and then move on to frame two with the movieclip2 in it. would anyone know?

Actionscript, Quick Question
Lets say you had five buttons on the stage, and every time a button was clicked, it was removed. When all the buttons were removed, a “win” screen would appear. How would you go about doing this (specifically, how would you be able to tell when all the buttons had been removed) ?

Quick And Simple Actionscript.
simple. im loading a bunch of buttons w/ sound effects on them, and i want the buttons to appear as they load, so say i have five buttons. i assume that i make five frames and on each frame, put one more button then the last (first frame has 1 buttons, 2nd frame has two buttons, etc). whats the actionscript that basically says "if frame 2 is loaded, go to frame 2 and stop" i know this junk is easy, i just havnt had the time to learn actionscript yet.

Quick Q Re: Best Practice Actionscript
Hi,

I understand that it is best best practice to place all actionscript in the first frame of your movie, but how then do you deal with actions that are dependant on what frame youre at?

eg. placing a "stop()" on frame 50.

how would you write that into actionscript that is located on frame 1??

cheers..

Greetings .. Quick Question About CD Actionscript
Hi & tia for any help with this. I have tried searching and third party apps and sop.exe seems to be able to do what I need, which is to simply open a folder from the root of the cd, (non drive letter specific if possible) a folder named "images" but I think I have the code allocated in the wrong place in the file or something.. dunno.

This is my first attempt at using flash to make an autoloadable CD and I have not been able to get this to work using "fscommand" or getURL /../images etc.

I'm not a actionscript wiz and I could really use a pointer in the right direction.

Thanks again,

Bobcajun
rippz@mdirect.net

A Quick Question For The Actionscript Expert...
This statement makes the mask visable:

setProperty ("/mask", _visible, 0);

How do you undo this statement to make the mask unvisable when you no longer what it on your screen?


___________________________________
Thanks,

Grant

I Am Behind In ActionScript... *sigh* --- Quick Help Question... I Think....
Hi all,

Okay. I know I should be more up to date with my version of Flash but, I just moved to MX on PC a month or so ago. I know there's MX 2004 now but, I'm not there yet. When I give this code in "expert mode" it tells me my movie has to be exported as Flash 5 in order to work.


Code:
on (release) {
_root.opener.gotoAndPlay("ON");
}

Is there a new ActionScript script I don't know about?

Thanks all in advance,
Kirk =]

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