Newbie-How Can I Understand Actionscript In A Simplified Way?
Hi folks,
Thanks for your help for my last post.
Ok... I am trying to learn actionscript but I have dived in the deepend a little. I am a designer and need to know AS at least to a basic level so I can get on with my design stuff.
Can anyone possibly tell me how I can understand actionscript- what "objects" and "variables"... in the most simplified "ABC" way? -Is there any "metaphores" that helped you understand a programming environment such as actionscript?
I guess I need to start right from the beginning and get the foundation right but I'm going in loops. If any of you peeps can help me I would be much delighted.
TIA
Hass
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-11-2004, 06:35 AM
View Complete Forum Thread with Replies
Sponsored Links:
Newbie-How Can I Understand Actionscript In A Simplified Way?
Hi folks,
Thanks for your help for my last post.
Ok... I am trying to learn actionscript but I have dived in the deepend a little. I am a designer and need to know AS at least to a basic level so I can get on with my design stuff.
Can anyone possibly tell me how I can understand actionscript- what "objects" and "variables"... in the most simplified "ABC" way? -Is there any "metaphores" that helped you understand a programming environment such as actionscript?
I guess I need to start right from the beginning and get the foundation right but I'm going in loops. If any of you peeps can help me I would be much delighted.
TIA
Hass
View Replies !
View Related
Newbie Needs Some Help To Understand Better
I am trying to build a photo gallery.... I know, I know... Another photo-gallery!!
It is more like an exercise for me to understand how to program in Flash MX.
Say that I am reading using PHP the content of a folder and I find all the images contained in a certain folder. I want to create as many little "squares" on the screen as many are the pics in the folder and load the 50x50 images inside these little squares to make them selection buttons.
After that when I roll-over any of these small squared buttons I want to show the full size (500x500) image on the screen.
The name of the icon file and the large image file are the same (just located in diff folders), to simplify things a little. So far I have been able to create manually 4 instances of a small movieclip that contains a square (a white square, no image yet) and when I rollover I am showing one of 4 pictures contained in a specific folder by simply hardcoding the path in movieclip actions like the following one:
Code:
on(rollOver){
_root.mcImage.loadMovie("./images/portfolio/nature/IMG_4643.JPG");
}
(each of the 4 buttons has a different path hardcoded into it).
Now of course this is just a first step. Ideally I would like to create an "object" that has the square and that contains a string where I can load the path I want so that when I place the instance on the screen it contains the correct icon image.
Now all this is ideal and I have no clue in which direction to move. Can I create an object like that? Do I instantiate as many copies of it as many files are in the folder? Any other idea?
Please any help would be really appreciated to move somewhere!
thanks!
FG
View Replies !
View Related
Newbie Needs Help To Understand Puzzle.fla
Hi, if your kind enough to help me with this you will have to look at puzzle.fla which comes with Flash MX, its located in your folder at
Flash MX - Tutorials - ActionScript - Finished - puzzle.fla
I am trying to learn Flash by getting to grips with puzzle.fla. I don't understand why the "Dialog Congratulations Movie Clip" has a text component as a group. I thought that grouping was collecting together several shapes to edit as a single shape. When I select the grouped text and do Modify - ungroup the property inspector says its a shape? When the text has been ungrouped if I then click on the "dialog background movie clip" which lives inside the "dialog congratulations movie clip", the text ends up behind the background movie clip. So why does this happen - what decides the order of multiple elements in a single layer.
View Replies !
View Related
Trying To Understand Actionscript
Hello
I have downloaded this .fla and am trying to work out what this code actually means and refers too. Can anyone help by adding comments to what each bit means?
y = _ymouse-125;
setProperty("/rol", _y, X);
X = X-(Y/10);
if (Number(X)>250) {
X = X-150;
}
if (Number(X)<36) {
X = Number(X)+150;
}
height = getProperty("rol", _y);
thanks
Phil
View Replies !
View Related
I Am New To Actionscript And Canīt Quite Understand The Double ==
Hi guys, sorry about this no-brainer but I am new to actionscript and canīt quite get the reason for using a double equals sign (==). Whatīs the difference from a single =. Iīve looked it up in the actionscript dictionary that comes with MX, but still didnīt get it! Duhhh. I have no prior experience with any programming language so if anyone could explain as if I were a 4 year old, I would greatly appreciate it. Thanks.
Nick
View Replies !
View Related
Trying To Understand An Actionscript Statement And Need Assistance
Code:
onClipEvent(load) {
_root.position=-170;
acceleration=0.25;
}
onClipEvent(enterFrame) {
distance=Math.abs(_root.position-_x);
if(distance>1) {
if (_root.position>_x) {
_x+=distance*acceleration;
}
else {
_x-=distance*acceleration;
}
}
}
Note: This is taken from a flash file that makes images scroll upon clicking a right or left scroll button. The image scrolls once per click, its not a continuous scroll.
----------
I'm trying to understand how exactly the code above is working. I was right clicking portions of the code to view flashes builtin help but alot of the things weren't being found withing the help.
For now I have the following questions and will ask more once I understand these first:
1. "acceleration=0.25;" : is acceleration an actual command of flash, or is it more possibly a variable used/declared in another actionscript statement within the flash file?
2. "_root.position-_x" : I sort of understand what "_x" is but as for "position", the flash help gave me an explanation using sound which i don't think is what I'm looking for.
Also i don't understand the usage of the "-" within that statement since i don't see "_x" being declared anywhere in the above code.
3. "onClipEvent(enterFrame)" : Flash help is not providing any information on how "enterFrame" is used.
4. I sort of understand the following but if someone can explain it correctly I will understand better
Code:
if (_root.position>_x) {
_x+=distance*acceleration;
}
else {
_x-=distance*acceleration;
}
----
I'm using Flash CS3 but i don't believe this file was made using CS3. It was initially created by another person which i'm unable to get a hold of.
Thank everyone in advance for any comments, links, replies, and etc that might be able to assist me
View Replies !
View Related
If Else Simplified?
hi
i have the following AS on a frame in my movie:
Code:
if (_root.l1State == "ON")
{
onLine6._visible = true;
onLine6.gotoAndPlay(2);
}
else if (_root.l1State == "OFF")
{
onLine6._visible = false;
}
////////////////////////////////////////////////////////////////////
if (_root.quayState == "ON")
{
onLine6._visible = true;
onLine6.gotoAndPlay(2);
}
else if (_root.quayState == "OFF")
{
onLine6._visible = false;
}
clearly they are clashing so what i need to know is can i simply this so that it reads something like:
if l1State OR quayState is == ON then.......else if l1State == OFF, quayState == OFF then.......
the reason i want the OR in there is because only 1 State can be on at any time.
i actually have 4 States to check but only posted 2 in the script to save reading time.
if anyone can understand this and can help i'd really appreciate it.
thanks in advance,
jb
View Replies !
View Related
Can This Script Be Simplified? ...
Quote:
loadMovie("images/photography/th01.jpg", "th01");
loadMovie("images/photography/th02.jpg", "th02");
loadMovie("images/photography/th03.jpg", "th03");
loadMovie("images/photography/th04.jpg", "th04");
loadMovie("images/photography/th05.jpg", "th05");
...etc
im loading in up to 25 thumbnails, is there a simple bit of script i can use instead of the above each time considering that the images are numbered th01.jpg-th25.jpg and that the MCs are called th01-th25
cheers
ian
View Replies !
View Related
Simplified Question MX
I'm trying an alternate approach to an earlier problem. This time not as long winded...
Any idea why this script doesn't want to work?
function onChange() {
if (brakegroup.br1.getState()) {
item1 = "brakes_1";
} else if (brakegroup.br2.getState()) {
item1 = "brakes_2";
} else if (brakegroup.br3.getState()) {
item1 = "brakes_3";
}
}
My change handler is labeled correctly, as are my radio group and component names.
Thanks!
-B
View Replies !
View Related
Can This Be Code Simplified?
Greetings all,
I am hoping to get some tips to simplify the below:
r1_5.onChanged = function() {
this.text = this.text.toLowerCase();
Selection.setFocus(r1_6);
};
What I have is inputtext fields which users fill in and the cursor then automatically displays in the next appropriate field. I am curious if there is anyway to simplify this. I have simplified my tabindex code, but have not been able to simplify this.
Any guidance will be greatly appreciated. I am using MX.
Thanks!
View Replies !
View Related
Can This Code Be Simplified?
Hi there,
I've got two problems. 1 - I think the code I am using needs to be simplified to use one function but I'm not sure how to do it. I have 9 buttons that each correspond to a block of text which is invisible. When the button is pressed, the text block (movie clip) shows up/fades in using the tween class. This works to a point (until you click too fast, but that's problem two) but the code is too heavy - take a look at this block:
Code:
var active:MovieClip; // our default active textbox nothing
specIntTextBox_btn.onRelease = function () {
if (active != null) {
var fadeOut:Tween = new Tween(active, "_alpha", Elastic.easeOut, 100, 0, 6, true);
}
var fadeIn:Tween = new Tween(specIntTextBox, "_alpha", Elastic.easeOut, 0, 100, 9, true);
active = specIntTextBox;
}
custReqTextBox_btn.onRelease = function () {
if (active != null) {
var fadeOut:Tween = new Tween(active, "_alpha", Elastic.easeOut, 100, 0, 6, true);
}
var fadeIn:Tween = new Tween(custReqTextBox, "_alpha", Elastic.easeOut, 0, 100, 9, true);
active = custReqTextBox;
}
// etc, 7 more blocks like that.
That is 2 of 9 blocks. As you can see they all do the same thing. I know how I'd do this in JavaScript but not sure how to handle it in ActionScript. I'd rather have every single button fire off the same function, and have the button know somehow what text box to show. Then I would not have to repeat this block 9 times.
The other problem is that if you click too quickly then you start getting multiple boxes showing up and it all gets screwed up. There must be a way to avoid this, but I am not sure how.
You can see this page at
http://dev2.pixelmech.com/access/access.php
Click on the left side stack of sources to get to the section I am talking about, then click on of the boxes. You have to click pretty quick on the blocks to see the problem with the text boxes.
Any help is surely appreciated.
Thanks!
Tom
View Replies !
View Related
Can This Code Be Simplified / Altered? - CPU HOG
This code, because of the EnterFrame command is hogging up to 90% of my cpu at all times, this isnt really acceptable for the web so is there a soloution to the following code which resizes and repositions different movieclips?...
help?
Quote:
onClipEvent (enterFrame) {
if (change == true) {
_xscale += (goalw-_xscale)/3;
_yscale += (goalh-_yscale)/3;
//
_root.boxborder._width = _root.box._width+20;
_root.boxborder._height = _root.box._height+20;
//
_root.top._x = 360+(_root.box._width/2+5);
_root.top._width = _root.box._width+5;
//
_root.bottom._x = 360-(_root.box._width/2);
_root.bottom._y = 90+(_root.box._height+20);
_root.bottom._width = (_root.box._width+5);
//
_root.left._x = 360-(_root.box._width/2+5);
_root.left._height = _root.box._height+5;
//
_root.right._x = 360+(_root.box._width/2+10);
_root.right._height = _root.box._height+5;
//
_root.topleft._x = 365-(_root.box._width/2+10);
//
_root.topright._x = 360+(_root.box._width/2+10);
//
_root.bottomleft._x = 360-(_root.box._width/2+5);
_root.bottomleft._y = 90+(_root.box._height+20);
//
_root.bottomright._x = 360+(_root.box._width/2+10);
_root.bottomright._y = 90+(_root.box._height+20);
}
}
View Replies !
View Related
Creating A Simplified Dance
Hello all.
As one of the final touches to my project, I need to have a character dance (at least a few limbs moving), but I don't know how to get started. Something like DancingPaul in its entirety is way too complex, and just being able to create one of those dancing "moves"/animations would be enough. The head doesn't even have to turn.
I plan on having music in the background (Billy Idol's Mony Mony), and preferably, the character would be able to join in once and awhile (opening and closing his mouth).
How would you recommend embarking on this? A hierarchal list of a few limbs, and then using Actionscript to program it all?
View Replies !
View Related
Dynamic Functions? V2.0 (simplified)
i think my last post might have been confusing so here is a simplified version:
Code:
var movies = new Array();
movies[0] = 'overview';
movies[1] = 'east';
movies[2] = 'surveys';
movies[3] = 'core';
loadThumbs();
function loadThumbs()
{
len = movies.length;
for (i=0; i<len; i++)
{
this.attachMovie(movies[i] + '_thumb', 'mc' + movies[i], 100 + i);
eval("this.mc" + movies[i])._x = i * 100;
eval("this.mc" + movies[i]).stop();
}
}
now, i need the to create dynamic functions that will play() the movieclips on roll over...
any comments on the code??? like i said b4 i'm coming from php and although there is definitely a familiarity, code optimizations etc... are appreciated...
what i tried to do is create this function within the loadThumbs()function, however movies[i] is undefined
Code:
eval("this.mc" + movies[i]).onRollOver = function()
{
//eval("mc" + movies[i]).play();
trace movies[i]);
}
take care,
snx
View Replies !
View Related
Flash, XML And Simplified Chinese
yo.
i need to have an XML file with 2 version of text, english and simplified chinese, then I need to load this into flash and display the correct language depending on user selection.
2 questions, firstly will including simplifed chinese within my XML cause any hassles? and secondly what do I do about fonts, do I embed, or is there some way of forcing the browser to install a language pack, or just assume that it is already installed...
any tips would be great, coz i dont have a clue!!
cheers people
vinnie
View Replies !
View Related
Splicing Multidimensional Arrays Simplified
Hi all,
I asked about splicing multidimensional arrays a couple of days ago but I think the post was a little too complicated so I stripped down my problem and hope it'll be more readable and solvable now.
This is the test code:
Code:
a = "a,b,c,d,e,f,g,h,i,j";
a_array = a.split(",");
b_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
combi_array = new Array();
big_array = new Array();
for (i=0; i<a_array.length; i++){
temp_array = new Array();
temp_array.push(a_array[i]);
temp_array.push(b_array[i]);
// create an array that combines a and b //
combi_array.push(temp_array);
// create one array that holds 10 combi_array's //
big_array.push(combi_array);
}
trace (big_array.length);
i=0;
function remove(){
if(i<6){
if(big_array[i].length > 0){
x = Math.floor(Math.random()*big_array[i].length);
trace ("x="+x);
big_array[i].splice(x,1);
trace("big_array["+i+"] len= "+big_array[i].length);
i++;
}
}
else {
i = 0;
}
};
setInterval(remove, 100);
(It does the same thing as the final code which can be seen here:
http://www.flashkit.com/board/showth...22#post3474922)
The output is this:
x=1
big_array[0] len= 9
x=1
big_array[1] len= 8 // so with every loop the length decreases regardless of which array we're at...
x=4
big_array[2] len= 7
x=5
big_array[3] len= 6
x=1
big_array[4] len= 5
x=0
big_array[5] len= 4
x=0
big_array[0] len= 3
x=1
big_array[1] len= 2
x=0
big_array[2] len= 1
x=0
big_array[3] len= 0
What I want is for the length of all the big_arrays to decrease once every six times and not with every loop.
So I want the output to look like this:
x=1
big_array[0] len= 9
x=1
big_array[1] len= 9
x=4
big_array[2] len= 9
x=5
big_array[3] len= 9
x=1
big_array[4] len= 9
x=0
big_array[5] len= 9
x=0
big_array[0] len= 8
x=1
big_array[1] len= 8
x=0
big_array[2] len= 8
x=0
big_array[3] len= 8
etc...
Hope my problem is clear. Thanks in advance for any help, Danielle.
View Replies !
View Related
Flash Database Applications Simplified
As a designer, I don't get a lot of exposure to programming business applications in Flash but once in a while I need to struggle through it. Recently, I began using a product that has eliminated almost all of my fears. Its called Snapp MX (flash.snappmx.com).
The beauty of this product is that it generates most of the code I need to interface forms I create in Flash to my ColdFusion server. This even includes database queries which I have always struggled with. I read that it will also generate code in Java, C# and VB if your not into ColdFusion. One down side, however, is that you need to have a Flash Gateway running. This wasn't a problem for me since it came with my ColdFusion server.
If your like me and you have to traverse this territory on occassion, you owe it to yourself to check out this product.
View Replies !
View Related
Flash Database Applications Simplified
As a designer, I don't get a lot of exposure to programming business applications in Flash but once in a while I need to struggle through it. Recently, I began using a product that has eliminated almost all of my fears. Its called Snapp MX (flash.snappmx.com).
The beauty of this product is that it generates most of the code I need to interface forms I create in Flash to my ColdFusion server. This even includes database queries which I have always struggled with. I read that it will also generate code in Java, C# and VB if your not into ColdFusion. One down side, however, is that you need to have a Flash Gateway running. This wasn't a problem for me since it came with my ColdFusion server.
If your like me and you have to traverse this territory on occassion, you owe it to yourself to check out this product.
View Replies !
View Related
Simplified Tween Class - Free Script
All I have answered more than a few posts where one of the solutions was the use of the tween class. As I know they can be a pain in the but to use, I have developed my own class that makes calling them much simpler. I figured some of you might find this beneficial as well. Since for some reason you can not attach script files using the attach feature, I am just going to paste the code here. To use it, simiply sut and past into actionscript editor and save the file as tweener.as as specified in the instrutions at the top of the file.
PASTE EVERYTHING BELOW THIS LINE
/*
Developed by Jeremy Wischusen - Visual Flow Designs - http://www.visualflowdesigns.com - June, 2006.
This script may be freely distributed and modified as long as the line above (the credits) remains in tact.
Instructions (Flash MX2004 or Flash 8)
1. Create a folder on your hardrive named myASClasses (or choose you own name, just remember the location).
2. Save this file in that folder.
3. Open a new Flash document.
4. Go to Edit Menu >> Prefernces
5. In the dialog box that appears, select ActionScript from the Category menu on the left.
6. Near the bottom of the right side of the panel, there is a button that reads "ActionScript 2.0 Settings", click it.
7. In the dialog box that appears click the browse button (the one that looks like a crosshair).
8. In the folder selection dialog that appears, naviagte the the folder you created in step 1 and select it.
9. Click OK. If it worked, you will now see the folder you created in the list of class paths. These are the default locations that flash looks for class files.
10. Click OK on each of the remaining dialog boxes until you are back the the Flash main program.
You are now ready to begin using this class.
To created a new instance of the class, in the actions panel:
var yourVar:tweener = new tweener(clip_to_be_tweened_mc)
Where:
yourVar is however you want to reference this instance of the class
clip_to_be_tweened_mc is the movie clip that you want to apply the tweens to.
You can now call the methods of this class using:
yourVar.methodName();
for example:
yourVar.fadeOut(3)
would fade the clip that you specified when you created the instance of the class (clip_to_be_tweened_mc) from its current alpha value to 0 over three seconds
Things of note:
Since this class is a simplified way of accessing the tween class, all methods that invoke tweens return that tween. This means that you can use the events and methods of the tween invoked. For example:
var twClip:tweener = new tweener(box_mc);
var shrnk = twClip.shrinkHeight(50, 3);
shrnk.onMotionFinished = function (){
this.yoyo();
}
The only exception to this is the blink() method as this method already invokes the onMotionedFinished event to cycle the blinking via the yoyo() method of the tween class.
Summary of Methods:
yourVar.fadeOut(dur)
dur = number of seconds that the tween should take. if not specified defaults to 3.
fades the movieclip from its current alpha value to 0.
yourVar.fadeIn(dur)
dur = number of seconds that the tween should take. if not specified defaults to 3.
fades the movieclip from its current alpha value to 100.
yourVar.startBlink(dur)
dur = number of seconds that the tween should take. this applied to both the fade in and fade out, so the total length of the tween is twice this number. if not specified defaults to 1.
fades the movieclip from its current alpha value to 100.
yourVar.endBlink(end, dur)
end = the final alpha value that the clip should end at.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.moveUp(pix, dur)
pix = number to subtract from current _y posstion as final destination of tween. if not specfied defaults to 10.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.moveDown(pix, dur)
pix = number to add to current _y posstion as final destination of tween. if not specfied defaults to 10.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.moveLeft(pix, dur)
pix = number to subtract from current _x posstion as final destination of tween. if not specfied defaults to 10.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.moveRight(pix, dur)
pix = number to add to current _x posstion as final destination of tween. if not specfied defaults to 10.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.spinCw(deg, dur)
deg = number to add to current _rotation value. if not specfied defaults to 90.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.spinCcw(deg, dur)
deg = number to subtract from current _rotation value. if not specfied defaults to 90.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.growHeight(endH, dur)
endH = number to add to current _height value. if not specfied defaults to 20.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.shrinkHeight(endH, dur)
endH = number to subtract from current _height value. if not specfied defaults to 20.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.growWidth(endW, dur)
endW = number to add to current _width value. if not specfied defaults to 20.
dur = number of seconds that the tween should take. if not specified defaults to 3.
yourVar.shrinkWidth(endW, dur)
endW = number to subtract from current _width value. if not specfied defaults to 20.
dur = number of seconds that the tween should take. if not specified defaults to 3.
*/
import mx.transitions.Tween;
import mx.transitions.easing. *;
class tweener extends MovieClip
{
var clip_mc : MovieClip
var blinker:Tween
function tweener (passed_mc : MovieClip)
{
clip_mc = passed_mc;
}
function fadeOut (dur : Number)
{
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_alpha", null, clip_mc._alpha, 0, dur, true)
return twn;
}
function fadeIn (dur : Number)
{
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_alpha", null, clip_mc._alpha, 100, dur, true)
return twn;
}
function startBlink (dur : Number)
{
if ( ! dur)
{
dur = 1;
}
blinker = new Tween (clip_mc, "_alpha", null, 100, 0, dur, true)
blinker.onMotionFinished = function ()
{
this.yoyo ();
}
}
function endBlink(end:Number, dur:Number){
delete blinker.onMotionFinished
if ( ! dur)
{
dur = 3;
}
if ( ! end)
{
end = 100;
}
blinker.continueTo(end, dur);
}
function moveUp (pix : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! pix)
{
pix = 10;
}
var twn = new Tween (clip_mc, "_y", null, clip_mc._y, (clip_mc._y - pix) , dur, true )
return twn;
}
function moveDown (pix : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! pix)
{
pix = 10;
}
var twn = new Tween (clip_mc, "_y", null, clip_mc._y, (clip_mc._y + pix) , dur, true )
return twn;
}
function moveLeft (pix : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! pix)
{
pix = 10;
}
var twn = new Tween (clip_mc, "_x", null, clip_mc._x, (clip_mc._x - pix) , dur, true )
return twn;
}
function moveRight (pix : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! pix)
{
pix = 10;
}
var twn = new Tween (clip_mc, "_x", null, clip_mc._x, (clip_mc._x + pix) , dur, true )
return twn;
}
function spinCw (deg : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! deg)
{
deg = 90;
}
var twn = new Tween (clip_mc, "_rotation", null, clip_mc._rotation, (clip_mc._rotation + deg) , dur, true )
return twn;
}
function spinCcw (deg : Number, dur : Number)
{
if ( ! dur)
{
dur = 3;
}
if ( ! deg)
{
deg = 90;
}
var twn = new Tween (clip_mc, "_rotation", null, clip_mc._rotation, (clip_mc._rotation - deg) , dur, true )
return twn;
}
function growWidth (endW : Number, dur : Number)
{
if ( ! endW)
{
endW = 20;
}
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_width", null, clip_mc._width, (clip_mc._width + endW) , dur, true )
return twn;
}
function growHeight (endH : Number, dur : Number)
{
if ( ! endH)
{
endH = 20;
}
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_height", null, clip_mc._height, (clip_mc._height + endH) , dur, true )
return twn;
}
function shrinkWidth (endW : Number, dur : Number)
{
if ( ! endW)
{
endW = 20;
}
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_width", null, clip_mc._width, (clip_mc._width - endW) , dur, true )
return twn;
}
function shrinkHeight (endH : Number, dur : Number)
{
if ( ! endH)
{
endH = 20;
}
if ( ! dur)
{
dur = 3;
}
var twn = new Tween (clip_mc, "_height", null, clip_mc._height, (clip_mc._height - endH) , dur, true )
return twn;
}
}
View Replies !
View Related
Saving Custom Class As Persistent Server Side Object, Simplified
Realized my last post may be too long... the gist of it is can I use this function:
mySharedObject.setProperty("storage",dataNow);
where dataNow is a custom class being passed from a client via:
var p1:Player = new Player();
nc.call ("storeIt",null,p1);
because basically I'm getting a type coercion error upon using this server side function:
client.shareIt = function()
{
fromSSSO=myShared.getProperty("storage")
myShared.send("grabIt",fromSSSO);
}
and on the client side:
public function grabIt (ssP:Player):void
{
var p:Player = ssP;
dispatchEvent (new Event(Client.SENTHERE));
}
Any ideas appreciated.
View Replies !
View Related
Newbie Actionscript Help
I'm trying to creat a gameboard grid with actionscript. I need to on load have a blue movie square duplicate itself into a 5 x 6 grid, each movie assigning itself a name so I can manipulate them later
also I have a dynamic text box that will also duplicate itself on top of those blue squares while feeding a text array into these boxes as they deploy. Again assigning themselves Id so I can manipulate them later.
It might be easier to imagine it a jeopary board, because that's what I'm creating... but I'm new at this, so a few snippets of help or ghosting code would help.
thanks.
RICK!
View Replies !
View Related
Actionscript Newbie Needs Help
I know this can be done, but nothing I've tried has worked consistently.
Flash MX Mac
I am loading a slideshow.swf into an empty mc in my main movie.
The movie I'm loading is the same size as the main movie (don't want to see anything below it).
After clicking through the slideshow.swf, I want to have a "close" button that removes the slideshow.swf and allows the user to select something else on the main movie nav.
What script do I use? Do I apply it to the "close" button in the slideshow.swf or do something inside the main movie?
Thank you in advance, I know someone out there can straighten me out.
View Replies !
View Related
Newbie Needs Help With Actionscript
I am trying to 1) dynamically create a movie clip, and then within that mc, 2) dynamically create a series of questions followed by input boxes for answers.
Variables supply information such as the number of questions (numq), text of the questions (eg., question1), and the size/height the response box should be for that question (eg., response1size).
Below is my code, which is a patchwork of several examples I have seen online and posts on this forum. Right now my FLA consists only of this code and a gray background, but on test/publish it produces nothing (except, of course, the blank gray background).
Can anyone take a look and tell me what needs fixin'?
numq = 3;
question1 = "Question 1...?";
question2 = "Question 2...?";
question3 = "Question 3...?";
response1size = 2;
response2size = 5;
response3size = 9;
currY = 0;
_root.createEmptyMovieClip ("qa", 0);
for(ivar=1;ivar<=numq;ivar++){
qa.createTextField ("tboxquestion"+ivar, ivar+numq, 0, _root[currY], 100, 50);
qa.tboxquestion.type="dynamic";
qa.tboxquestion.text=_root["question"+ivar];
currY += 200;
rsize=20*_root["response"+ivar+"size"];
qa.createTextField ("tboxanswer"+ivar, ivar+2*numq, 0, _root[currY], 100, rsize);
qa.tboxanswer.type="input";
qa.tboxanswer.border= true;
currY += 200;
}
A static-text example of what I am shooting for is at:
http://www.sunsetonline.org/post_example.html
View Replies !
View Related
Some Newbie Actionscript Help.
I'm using This tutorial. It says to put This code in my movieclip
Code:
onClipEvent (mouseMove) {
xmousepos1 = _xmouse;
ymousepos1 = _ymouse;
if (xmousepos1>xmousepos2 && ymousepos1>-98 && ymousepos1<-33) {
_root.scrollclip.nextFrame();
}
if (xmousepos1-98 && ymousepos1<-33) {
_root.scrollclip.prevFrame();
}
if (ymousepos1<-98 || ymousepos1>-33) {
play ();
}
xmousepos2 = _xmouse;
ymousepos2 = _ymouse;
}
On the last page of the tutorial, it goes into those 2 numbers, and that I will have to change them based on my creation. So... I left them alone and tried it out, it's not working. I checked the comments on it as well, but they don't say anything about those numbers. What do they mean? How can I get mine to work? I'm using images as well, but my canvas is differnt size.. I think that may be the problem. My canvas is 2645 x 170 px.
Any help will be GREATLY apprecitated. Thank you very much,
Matt
View Replies !
View Related
Newbie Actionscript Help
new to the boards and actionscript more or less.i am using flash mx pro 2004 and
i am trying to make a draggable graphic that drags when you hold down the mouse button..but i am trying to get it to snap back over the graphic it is revealing once the mouse is released...i am using the following script:
onClipEvent(mouseDown){if(this.hitTest(_root._xmou se,_root._ymouse,false)){this.startDrag(lockCenter );
}
}
onClipEvent(mouseUp){if(this.hitTest(_root._xmouse ,_root._ymouse,false)){this.stopDrag();
}
}
it works aside from not being able to get it to snap back....any help is greatly appreciated thanks in advance
View Replies !
View Related
Actionscript Newbie Needs Help - Please?
Hello -
While I have been using Flash for over 4 years, I have not had the opportunity to really utilize Actionscript. Over time, I have been trying to teach it to myself. I am looking into some tutorials and classes.
However, now I am in a real situation that I desperately need help with. A long time freelance client of mine has a Computer Based Training (CBT) piece that was originally designed in Flash by someone other than me.
This client now wants to make revisions to the CBT. It is like doing private investigation work trying to locate files and understand the way they named everything.
I am trying to get to a MC but I canot find it in the library. This is a MC that plays when the navigation button is clicked. The Actionscript for the button says:
on (release) {
with (_root) {
gotoAndPlay("Module3", 1);
}
}
I have no clue what it means after on (release). I guess I need to find Module3 in order to update that MC but I do not see anything that says Module3 in the library? I am so confused. I am unable to post the FLA file because this is proprietary information as it pertains to software developed by the client.
Any help is greatly appreciated.
Denise
View Replies !
View Related
[F8] - Actionscript Newbie
Hello all. I am extremely new to actionscript in flash. i have a background in technical writing and am moving more in the direction of Flash Developer. I have very little experience coding and the like.
Therefore, got couple of questions.
1. Recommended books to read to help learn actionscript.
2. I found a tutorial about a rain effect. In the tutorial, it says to add provided actionscript to the "Head section of your page." What does this mean?
Thanks.
View Replies !
View Related
Actionscript Newbie
Dear All
I have downloaded an fla file that mimics the Matrix text affect you see in
the film of the same name. I get the following error on the line "fade add i
add .font.letterfield = substring (line1,i,1)":
**Error** Scene=Page 1, layer=Scripts27, frame=7:Line 19: Operator 'add'
must be followed by an operand fade add i add .font.letterfield = substring
(line1,i,1)
I have looked into this issue and I partially understand the problem, but I
would not know where to start. I have attached the full frame code and I
would appreciate any feedback from the group.
Thanks again...
Alastair MacFarlane
kerning = kerningbasis * s1 / 100
kerningvar = s1 / 100
if (1 < line1.length) {
gotoAndPlay(7)
} else {
gotoAndPlay(6)
}
setProperty ("letter",_y,yposstart)
setProperty ("letter",_yscale,s1)
setProperty ("letter",_xscale,s1)
setProperty ("letter",_visible,false)
if (i < line1.length + 1) {
duplicateMovieClip ("fade",fade add i,200 - i)
fade add i add .font.letterfield = substring (line1,i,1)
randy = random(300) - random(300)
scaley = random(100) - random(100)
setProperty (fade add i,_y,yposstart)
setProperty (fade add i,_x,xposstart + i * kerning + rand)
setProperty (fade add i,_yscale,scaley)
setProperty (fade add i,_xscale,s1)
}
duplicateMovieClip ("letter",lettera add i,i)
lettera add add .font.letterfield = substring (line1,i,1)
setProperty (lettera add i,_x,xposstart + i * kerning)
i = i + 1
if (eval("lettera" + line1.length)._currentframe == 85) {
gotoAndPlay(9)
}
View Replies !
View Related
Actionscript Help. Newbie
Hiya, I asked a question similar to this one a few days ago to which FlashTastic kindly helped out with, however unfortunatly the miclevel is not working, I'm more or less a complete actionscript newbie. So I was just hoping if someone could have a look over this and see what the problem is. I have combined the AS I was using first with the one Flashtastic provided, and this is what I have now. If you would like to see the A.S flasttastic provided and the one I was using at first then please go here, Thank for any help.
Attach Code
var $activityTimer:Number;
m = Microphone.get();
attachAudio(m);
m.setUseEchoSuppression(false);
s = new Sound(this);
s.setVolume(0);
m = Microphone.get();
attachAudio(m);
checkActivity = function(micLevel):Void{
if (micLevel <30){
circle._xscale = circle._yscale = m.activityLevel+0;
circle._alpha = 90;
}
else if((micLevel >30) && (micLevel <50)){
yell._xscale = yell._yscale = m.activityLevel+0;
yell._alpha = 90;
}
else if((micLevel >50) && (micLevel <70)){
green._xscale = green._yscale = m.activityLevel+0;
green._alpha = 100;
}
else if(micLevel >70){
red._xscale = red._yscale = m.activityLevel+0;
red._alpha = 60;
p1._xscale = p1._yscale = m.activityLevel+10;
p1._alpha = 100;
}
}
$activityTimer = setInterval(checkActivity,100,m.activityLevel);
View Replies !
View Related
ActionScript Newbie Needs Some Help
Hi to anyone and everyone-
This should be pretty simple, but I don't know where to start. I need to put together some actionscript that will randomly load one of the images in my library each time the site comes up. I have the linkage assigned to each picture (right now they are IMG1 thru IMG10), but I don't know how to a.) get Flash to recognize that those are the pictures I want to deal with, and b.) randomly load one each time the site is opened (or the main page is revisited, or whatever).
If you can help me out, it would be greatly appreciated!
Thanks!
View Replies !
View Related
Actionscript Newbie
Hi,
I'm new to Flash and I'm trying to learn action script by making simple games. One game I'm working on has a user-controlled object (a bug) moves from the bottom of the screen to the top (arrow keys). At the same time, moving across the screen, from left to right, are blocks the user must avoid hitting. Everything works great until the user-controlled bug hits hits a block. I used a hitTest command within an if statement. Everything executes when the condition is true (a hit) except the stop command...the movie keeps running. I have the entire script attached to the bug which is on the main timeline. The blocks that move across the screen move in their own timelines. Any help? (I don't know if I've provided enough info.)
Scigolf
View Replies !
View Related
ActionScript Newbie
I need your help guru's im on a rush!
How can my movie go to a specific frame with "load movie".
I have a button, here is the action that I have on by button:
Code:
on (release) {
loadMovieNum("real.swf", 0);
gotoAndStop(5);
}
When clicked, the button loads the movie correclty but in the first frame. I want my button to lead to the frame 5. How can I do that?
Thx
View Replies !
View Related
Newbie Actionscript
Hey guys nice forums!
I'm new to flash and I would like to know how I would go about making little animated trails of "microdata"(or puffy white lines) move back and forth across this microchip graphic I made... Lines need to be random in movment across the microchip. I'm brand new to actionscript which is really preventing me from creating anything interactive or creative.
Heres a screenshot of the (so-called) micro chip i need this to happen on - http://roccocastoro.tripod.com/microchips.gif (Copy and paste link in browser....
I know I've seen this effect on a different site somewhere but I can't remember - anyone else know>?
Thanks,
Roc
View Replies !
View Related
Actionscript Newbie Help
hi everyone!
i've been doing a little movieclip which has the following actionscript:
ActionScript Code:
onClipEvent (enterFrame) {
myRadians = Math.atan2(_root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
_root.xChange = Math.round(_root._xmouse-this._x);
_root.xMove = Math.round(_root.xChange/5);
this._x += _root.xMove;
}
it basicaly follows the pointer in the x direction. i've put this together from a tutorial file but im not this good at actionscript. my problem is that i need this movieclip to only work on a specific area i can specify through x and y coordinates. can anybody help me with it?
thanx
View Replies !
View Related
Newbie With Actionscript Questions
hello, newbie here to flash using MX, and i have a couple of questions: first off, i have a movie where frame 1 there are 3 buttons. no matter which button is pushed, the next 30 frames or so played will be the same, but the ending frame will be different. how do i get frame 30 to remember which button was pushed back on frame 1 so as to jump to the correct last frame? i don't want to have 3 copies of the 30 frame movie since that takes up so much space, which is why i want the same one playing for all 3 buttons. ALSO, on a different project, i have a simple movie of a guy floating down a river with a tree branch coming up, and i want the user to be able to push a particular letter on the keyboard within 5 frames of the branch and the guy will duck, else if nothing is pushed the guy hits the branch and falls in the water. i can do everything but the key recognition, how do i get it to look for the key press during those 5 frames and then jump to the right scene at the end of the 5 frames if the key press was found? i have little to no experience with actionscript, so please walk me through the process gingerly for both of these questions!
View Replies !
View Related
Rotation With Actionscript - NEWBIE
I'm trying to rotate an object slowly around its center and tweening just doesn't go slow enough. The tween currently runs over 400 frames and that's just far too many, especially when I'm sure that Actionscript would be able to do it alot easier and smoother.
Only problem is that I don't know much actionscript past the standard gotoandplay etc so could anyone let me know the best way to go about this or point me to a site where I could learn basic movement by using actionscript please.
To give a clearer idea of what I'm trying to do click here
Each of these symbols will be opening up a page on the site. Ideally I'd like to have the rotation stop each time one of the symbols is clicked on. For now though I'd just like to know how to rotate using Actionsript cos I know what I'm like, newbie confusion etc.
Hope someone can help. Thanks
View Replies !
View Related
Newbie Question About Actionscript
Arial
Hi, I've just registered here,and I hope I can be part of this freindly community.
I have a newbie question about actionscript... hope you guys will not laugh at my ignorance! But where do you actually put the code into??? For example, a tutorial gives you a string of variables or code, so you copy it, then where do you put it into? I'm using Flash MX.
Thx in advance!
View Replies !
View Related
Newbie Actionscript Problem
Hi - I am having trouble with 3 functions... I need them all to run, but if I place them all in the same layer, only one works... if I place them in different layers, again, only 1 works!
Do I need to combine them somehow?
Here is the code :
this.onLoad = function() {
mySoundLoading = 0;
_root.loadBar._xscale = mySoundLoading;
};
//END onLoad
this.onEnterFrame = function() {
mySoundBytesTotal = _root.myMusic.getBytesTotal();
mySoundBytesLoaded = _root.myMusic.getBytesLoaded();
if (preloadNow == 1 && mySoundBytesLoaded>0) {
mySoundLoading = Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
_root.percentLoadedText = mySoundLoading+"% of track loaded";
_root.loadBar._xscale = mySoundLoading;
if (mySoundLoading == 100) {
preloadNow = 0;
}
}
};
//END onEnterFrame
this.onEnterFrame = function() {
if (clip.getvalue() != "") {
if (stopped != true) {
myMusicDurationText = myMusic.duration/1000;
myMusicPositionText = myMusic.position/1000;
fadeEnd = (songDuration-5);
}
loadedSong = songMusic;
if (fadeEnd<=songPosition && myMusicVolume>0 && playing == true) {
if (myMusicVolume<=1) {
myMusicVolume = 0;
}
_root.myMusic.setVolume(myMusicVolume);
myMusicVolume = myMusicVolume-1;
}
//
//Reverse
if (REV == 1 && myMusicPosition>0) {
_root.myMusic.stop();
myMusicPosition = myMusicPosition-.5;
_root.myMusic.start(myMusicPosition, 0);
}
revButton.onPress = function() {
REV = 1;
myConditionText = "Rewinding";
myMusicPosition = _root.myMusic.position/1000;
//
};
revButton.onRelease = function() {
REV = 0;
myConditionText = "Playing";
playing = true;
};
//Fast Forward
if (FF == 1 && myMusic.position<myMusic.duration) {
_root.myMusic.stop();
myMusicPosition = myMusicPosition+.5;
_root.myMusic.start(myMusicPosition, 0);
}
FFButton.onPress = function() {
FF = 1;
myConditionText = "Forwarding";
myMusicPosition = _root.myMusic.position/1000;
};
FFButton.onRelease = function() {
FF = 0;
myConditionText = "Playing";
playing = true;
};
}
//
};
this.onEnterFrame = function() {
myMusicDuration = _root.myMusic.duration/1000;
myMusicPosition = _root.myMusic.position/1000;
fadeEnd = (myMusicDuration-5);
if (fadeEnd<=songPosition && myMusicVolume>0 && playing == true) {
if (myMusicVolume<=1) {
myMusicVolume = 0;
}
_root.myMusic.setVolume(myMusicVolume);
myMusicVolume = myMusicVolume-1;
}
};
Help would be much appreciated!
Cheers, Steve
View Replies !
View Related
|