[fcs3] Coded Tween/swap Sections Problem
Quote:
Originally Posted by JoeBCC
hi, ive been trying to make myself a portfolio using flash cs3, and so far everythings been running pretty smoothly, ive been following a tutorials by cartoonsmart.com, but ive started running into some trouble now, i created a function that tweens out a section off to the side when i click on a new section, but for some reason the tween refuses to work with certain sections...even tho the code for each section is identical...
BTW i used AS 2.0 NOT 3.0
heres the code:
frame one(the function) [phpcode]function swapSections(){
if (sectionVar == "home"){ new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , 95.0, 800, 30, false); } if (sectionVar == "about"){ new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false); } if (sectionVar == "contact"){ new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false); } if (sectionVar == "sigs"){ new mx.transitions.Tween(sigs_ection, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false); } if (sectionVar == "sites"){ new mx.transitions.Tween(sites_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false); }
} [/phpcode]
frame 50(home) [phpcode] new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1) swapSections();
//variable used in the function above to determine the current section sectionVar = "home";
stop(); [/phpcode]
frame 60 (about me) [phpcode] new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 75, 30, false);
// function called to move out the old section (this function is on frame 1) swapSections();
//variable used in the function above to determine the current section sectionVar = "about"; [/phpcode]
frame 70 (contact me) [phpcode] new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1) swapSections();
//variable used in the function above to determine the current section sectionVar = "contact"; [/phpcode]
frame 80 (sigs) [phpcode] new mx.transitions.Tween(sigs_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1) swapSections();
//variable used in the function above to determine the current section sectionVar = "sigs"; [/phpcode]
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-15-2007, 02:51 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[fcs3] Coded Tween/swap Sections Problem
hi, ive been trying to make myself a portfolio using flash cs3, and so far everythings been running pretty smoothly, ive been following a tutorials by cartoonsmart.com, but ive started running into some trouble now, i created a function that tweens out a section off to the side when i click on a new section, but for some reason the tween refuses to work with certain sections...even tho the code for each section is identical...
BTW i used AS 2.0 NOT 3.0
heres the code:
frame one(the function)
PHP Code:
function swapSections(){
if (sectionVar == "home"){
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , 95.0, 800, 30, false);
}
if (sectionVar == "about"){
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "contact"){
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}
if (sectionVar == "sigs"){
new mx.transitions.Tween(sigs_ection, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "sites"){
new mx.transitions.Tween(sites_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}
}
frame 50(home)
PHP Code:
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "home";
stop();
frame 60 (about me)
PHP Code:
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 75, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "about";
frame 70 (contact me)
PHP Code:
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "contact";
frame 80 (sigs)
PHP Code:
new mx.transitions.Tween(sigs_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "sigs";
[FCS3] Tween Trouble In CS3
My Flash experience is in using Flash8, and I'm currently using CS3 for the first time. I am however using AS2.0, not 3.0.
I'm using several motion tweens between various keyframes in a layer of a movieclip. Each tween is from a keyframe with a symbol instance set at color: Alpha, 0% and the same symbol with color: Alpha, 100%. These appear to be functioning properly. Below that layer I have a layer with almost identical "static" symbols. The intended effect being part of the swf "fades in."
However, by the second frame as the alpha starts to tween in, the entire image (including the normal static layer) is washed out as if the tween layer has 100% opacity over the static fill layer.
I've done the exact same thing in the past using Flash8, so maybe I'm just forgetting something. Thanks for any help!
How Do I Swap Flash Movies In Dreamweaver In Place Of Swap Image?
In Dreamweaver you can swap images on a mouseover event using behaviors.
Instead of swapping images, I want to swap flash movies.
Example:
Build a table
place and play a flash movie in a cell
on a mouseover, replace that flash movie with another flash movie.
Can it be done? It apparently can't be done directly - Dreamweaver won't see flash files as swappable. Perhaps there's a workaround.
Swap Images Or Swap Symbols?
I want to load a bunch of images dynamically -- into different movie clips. And then simply have a master clip which lets me swap out these dynamically loaded clips. Is that possible?
Can I do a swap or replace symbol on the Master to have it be replaced by each loaded clip one after the other?
Could This Be Coded Better?
Hello to you.
I have put togethrt a little movie to practise my ASing and I would like to know if there is a better way. It all works perfectly but I think it's a bit long-winded.
_root.main.highlighter._y = _root.main.button1._y;
_root.main.highlighter._x = _root.main.button1._x;
_root.main.highlighter.gotoAndPlay("ani");
_root.main.button1._alpha = 100;
_root.main.button2._alpha = 10;
_root.main.button3._alpha = 10;
I have three buttons and a content panel. I wanted the clip to play 3 panels of info in 3 second intervals.
The 3 buttons may also be clicked to display the required info panel as and when required otherwise the clip just cycles.
There is a highlighter mc which animates around the button when it's clicked. This also happens when the playhead enteres the corresponding info pane.
I have added the above AS to the first frame of the panel pages and changed the button instance references and the button alpha levels as needed.
As I said, it all works perfectly but there has to be a better way.
Any suggestions?
Thanks in advance.
How Is This Coded ?
Hello everybody.
I was wondering if any of you could kindly show me or point me to a tutorial that shows how to achieve the images moving according to the mouse position, as they have done on this website:
http://www.lastdaysmovie.com/site.html
I notice that each image has its own "friction". Each image seems to move indipendently and at different speeds than the others.
I don't necessarily need to move multiple images. All i need, is to move one big background image of a room in which there are a few items that the user has to look for and interact with.
I have been looking for a tutorial for this, these last days but unfortunately I could not find anything like the site above, also because I wouldn't know how to define search key words to describe that kind of animation.
Any help is greatly appreciated.
Thank you.
[fcs3]
Hello, novice here
Right the basic problem is this:
I have one Main.swf file and I’m importing symbols from a seperate.swf using the import for runtime sharing options. What I have in the Main.swf is a container symbol and in the separate.swf file I have a symbol containing a bmp that needs to scale up at runtime when it is imported by the Main.swf to fit the size of the container symbol. Do you know if this is this possible?
I have the importing/exporting part working fine, it is just the scaling that I can’t get to work. Any ideas
[Fcs3]
hi, ive been trying to make myself a portfolio using flash cs3, and so far everythings been running pretty smoothly, ive been following a tutorials by cartoonsmart.com, but ive started running into some trouble now, i created a function that tweens out a section off to the side when i click on a new section, but for some reason the tween refuses to work with certain sections...even tho the code for each section is identical...
heres the code:
frame one(the function)
Code:
function swapSections(){
if (sectionVar == "home"){
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , 95.0, 800, 30, false);
}
if (sectionVar == "about"){
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "contact"){
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}
if (sectionVar == "sigs"){
new mx.transitions.Tween(sigs_ection, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "sites"){
new mx.transitions.Tween(sites_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}
}
frame 50(home)
Code:
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "home";
stop();
frame 60 (about me)
Code:
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 75, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "about";
frame 70 (contact me)
Code:
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "contact";
frame 80 (sigs)
Code:
new mx.transitions.Tween(sigs_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);
// function called to move out the old section (this function is on frame 1)
swapSections();
//variable used in the function above to determine the current section
sectionVar = "sigs";
[fCS3] Why? Just Why?
Sorry about the unclearness of the title but that's the question i have been asking myself all day!
I am making a part in my flash game where you can select the level. I have made an input text box and set the var name to levelinput. Then i made a button and gave it this code:
Code:
on(release, keyPress"<Enter>"){
if(levelinput.toLowerCase eq "tutorial"){
gotoAndStop("Scene 2", "tutorialstart");
}else if(levelinput.toLowerCase eq "level1"){
gotoAndStop("Scene 3", "hsstart");
}else{
gotoAndStop("Scene 1", "invalidlvl");
}
}
for some reason i always get the invalidlvl frame. I would really appreciate some help guys, cos i haven't even done the main part of the game yet, and i don't like moving on while things don't work.
oh, btw, i made sure the frame labels are correct and used the script assist to confirm it. nothing wrong with the code... I followed a tut on this kind of thing and that didn't work either....
--Coded Movement--
I have a movieClip that I want to slide from it's current position to a new set x position. However it can't be on an (enterFrame) event handler or it will interfere with another code. What I basically want is a bit of code that says ' go from current ._x to new ._x (x) over 1 second, or whatever. I want it to slide rather than just appear at the designated co-ordinate.
Can anyone tell me how to do this please?
Thanks in advance, Felix.
[F8] Coded Animation
I am having a hard time figuring out why the lines that are crossing each other get jerky after you watch it for a little while, and why there becomes a big space once the green lines start. I think it has something to do with the lines not deleting after they get to the end, so it is just taking up a lot of virtual memory. Any help would be much appreciated. Here is the code I am using and the link is to the .swf so you can see what I am talking about. BEWARE, once you leave the .swf open too long it may freeze up your internet browser.
i = 0;
{_x:193, _y:119});
function tweenBall() {
attachMovie("Line_mc", "Line"+i+"_mc", this.getNextHighestDepth(), {_x:193, _y:119});
//trace("in function")
easeType = mx.transitions.easing.None.easeNone;
var begin = this["Line"+i+"_mc"]._x;
var end = 327;
var begin2 = this["Line"+i+"_mc"]._y;
var end2 = 270;
var time = 1.5;
var mc = this["Line"+i+"_mc"];
ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
ballTween2 = new mx.transitions.Tween(mc, "_y", easeType, begin2, end2, time, true);
i++;
trace(i);
}
tweenBall();
function removeclip() {
for (j=0; j<i-1; j++) {
if (this["Line"+j+"_mc"]._x == 327) {
removeMovieClip("Line"+j+"_mc");
}
}
}
k = 0;
{_x:193, _y:119});
function tweenBall2() {
attachMovie("Line2_mc", "Line2"+k+"_mc", this.getNextHighestDepth(), {_x:335, _y:277});
//trace("in function");
easeType = mx.transitions.easing.None.easeNone;
var begin1 = this["Line2"+k+"_mc"]._x;
var end1 = 200;
var begin3 = this["Line2"+k+"_mc"]._y;
var end3 = 132;
var time1 = 1.5;
var mc1 = this["Line2"+k+"_mc"];
ballTween1 = new mx.transitions.Tween(mc1, "_x", easeType, begin1, end1, time1, true);
ballTween3 = new mx.transitions.Tween(mc1, "_y", easeType, begin3, end3, time1, true);
k++;
}
//tweenBall2();
function removeclip1() {
for (l=0; l<k-1; l++) {
if (this["Line2"+l+"_mc"]._x == 200) {
removeMovieClip("Line2"+l+"_mc");
}
}
}
http://www.wisc-online.com/objects/code/code.fla
[F8] Coded Animation HELP PLEASE
I am having a hard time figuring out why the lines that are crossing each other get jerky after you watch it for a little while, and why there becomes a big space once the green lines start. I think it has something to do with the lines not deleting after they get to the end, so it is just taking up a lot of virtual memory. Any help would be much appreciated. Here is the code I am using and the link is to the .swf so you can see what I am talking about. BEWARE, once you leave the .swf open too long it may freeze up your internet browser.
i = 0;
{_x:193, _y:119});
function tweenBall() {
attachMovie("Line_mc", "Line"+i+"_mc", this.getNextHighestDepth(), {_x:193, _y:119});
//trace("in function")
easeType = mx.transitions.easing.None.easeNone;
var begin = this["Line"+i+"_mc"]._x;
var end = 327;
var begin2 = this["Line"+i+"_mc"]._y;
var end2 = 270;
var time = 1.5;
var mc = this["Line"+i+"_mc"];
ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
ballTween2 = new mx.transitions.Tween(mc, "_y", easeType, begin2, end2, time, true);
i++;
trace(i);
}
tweenBall();
function removeclip() {
for (j=0; j<i-1; j++) {
if (this["Line"+j+"_mc"]._x == 327) {
removeMovieClip("Line"+j+"_mc");
}
}
}
k = 0;
{_x:193, _y:119});
function tweenBall2() {
attachMovie("Line2_mc", "Line2"+k+"_mc", this.getNextHighestDepth(), {_x:335, _y:277});
// trace("in function");
easeType = mx.transitions.easing.None.easeNone;
var begin1 = this["Line2"+k+"_mc"]._x;
var end1 = 200;
var begin3 = this["Line2"+k+"_mc"]._y;
var end3 = 132;
var time1 = 1.5;
var mc1 = this["Line2"+k+"_mc"];
ballTween1 = new mx.transitions.Tween(mc1, "_x", easeType, begin1, end1, time1, true);
ballTween3 = new mx.transitions.Tween(mc1, "_y", easeType, begin3, end3, time1, true);
k++;
}
//tweenBall2();
function removeclip1() {
for (l=0; l<k-1; l++) {
if (this["Line2"+l+"_mc"]._x == 200) {
removeMovieClip("Line2"+l+"_mc");
}
}
}
http://www.wisc-online.com/objects/code/code.fla
Coded Timeline
Being a programmer by education, I never really used the timeline and rather created/loaded movieclips, tweened them using mx.transitions.*, and then timed them using setInterval.
This works fine for me, but I would really like some other tips on this way of creating Flash content so that I can improve my production time.
I did consider combining the use of code snippets on the timeline instead of using setInterval but I'd really like to hear from others who code a lot of their Flash content.
Thanks.
Regards,
thorbeck
Coded Animation Help
Hi there, need some assistance with a problem i am having.
I am trying to create a background level for a site I am developing. On the level i want a series of movieclips (just simple squares) that I want to scale up and down (with speed and easing). I need to be able to animate both xscale and yscale. I want to call the action from the navigation on a higher level.
Have tried to find info online but am confused as to how to apply to what I want.
Can anyone assist? I would be extremely grateful.
p.s. I am using Flash MX Professional.
Coded Animation Help
I am having a hard time figuring out why the lines that are crossing each other get jerky after you watch it for a little while, and why there becomes a big space once the green lines start. I think it has something to do with the lines not deleting after they get to the end, so it is just taking up a lot of virtual memory. Any help would be much appreciated. Here is the code I am using and the link is to the .swf so you can see what I am talking about. BEWARE, once you leave the .swf open too long it may freeze up your internet browser.
i = 0;
{_x:193, _y:119});
function tweenBall() {
attachMovie("Line_mc", "Line"+i+"_mc", this.getNextHighestDepth(), {_x:193, _y:119});
//trace("in function")
easeType = mx.transitions.easing.None.easeNone;
var begin = this["Line"+i+"_mc"]._x;
var end = 327;
var begin2 = this["Line"+i+"_mc"]._y;
var end2 = 270;
var time = 1.5;
var mc = this["Line"+i+"_mc"];
ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
ballTween2 = new mx.transitions.Tween(mc, "_y", easeType, begin2, end2, time, true);
i++;
trace(i);
}
tweenBall();
function removeclip() {
for (j=0; j<i-1; j++) {
if (this["Line"+j+"_mc"]._x == 327) {
removeMovieClip("Line"+j+"_mc");
}
}
}
k = 0;
{_x:193, _y:119});
function tweenBall2() {
attachMovie("Line2_mc", "Line2"+k+"_mc", this.getNextHighestDepth(), {_x:335, _y:277});
// trace("in function");
easeType = mx.transitions.easing.None.easeNone;
var begin1 = this["Line2"+k+"_mc"]._x;
var end1 = 200;
var begin3 = this["Line2"+k+"_mc"]._y;
var end3 = 132;
var time1 = 1.5;
var mc1 = this["Line2"+k+"_mc"];
ballTween1 = new mx.transitions.Tween(mc1, "_x", easeType, begin1, end1, time1, true);
ballTween3 = new mx.transitions.Tween(mc1, "_y", easeType, begin3, end3, time1, true);
k++;
}
//tweenBall2();
function removeclip1() {
for (l=0; l<k-1; l++) {
if (this["Line2"+l+"_mc"]._x == 200) {
removeMovieClip("Line2"+l+"_mc");
}
}
}
http://www.wisc-online.com/objects/code/code.fla
AS Coded Counter
i'm creating a counter that counts up - and have made a movie clip that has 10 frames for numbers 0-9. i'm wondering what AS code i would use to make frame 1 wait 10 frames before playing frame 2 (instead of manually doing it i need to us AS - because i get up into the thousands and don't want a movie that is thousands of frames long)... even wait 100 frames before playing frame 2. simple code would be nice. i don't need it to find a date or synch with a clock - i just need it count. i know this is possible but i'm still fairly new at AS. any help is much appreciated...thanks.
[FCS3] Actionscript 2 Or 3?
Hi
I've been learning flash for about a year, and have slowly been trying to get to grips with using actionscript (2). I normally grab bits of script from forums and tutorials and piece and adapt them to how I need.
Thing is, I really want to understand what I'm using and to be able to write my own script. With that in mind, am I best to forget the basic knowledge of AS2 and learn AS3? Or should I attempt to learn AS2 first, then AS3???
Also, if anyone could reccomend a book or tutorial that would be good to learn with, that would be great!!
Thanks
Wayne
[fCS3] Can't Add Actionscript To MC
Ok so i'm trying out fCS3, and I can't seem to add actionscript to MC's. I click on the MC, press the button with the arrow on the bottom pannel/right click then hit actions, and it says that I can't add actionscript to it. Am I pressing the right button or what? and also when I import/open something from F8 that already has actionscript it adds a panel with Actions - MC. and yes I am aware that fCS3 uses actionscript 3, is it that or what am i doing wrong? lol yes a very noob question. ty for any answers
Line Rider-How It Was Coded.
I am trying to develop a movie similar to “line rider”.
I am able to develop a code for drawing a line, and I am also able to increase the _xscale, and _yscale of the line drawn.
However, I am not able to move the line across the stage as in the
original movie. Can anybody help please?
I am giving below the code developed by me for drawing the line:
_______________________________________
//Press the mouse and drag from left to right to draw the line.
var im,moves,drw,thisx,thisy,lastx,lasty;
var i=0;
var lx=[];
var ly=[];
moves = 0;
thisx=0;
lastx=0;
var ply=false;
//_________________________________________
drw=false;
this.createEmptyMovieClip("cnt",10);
cnt.onMouseDown=function() {
if(_xmouse>0&&_ymouse>0&&_ymouse<400)drw=true;
lastx=_xmouse;
lasty=_ymouse;
}
cnt.onMouseUp=function() {
drw=false;
}
cnt.onMouseMove=function() {
if(drw){
ply=true;
thisx = _xmouse;
thisy = _ymouse;
if(thisx-lastx>15){
thisx=lastx+15;
cnt.lineStyle(2, 0x000000, 100);
cnt.moveTo(lastx,lasty);
cnt.lineTo(thisx,thisy);
lastx=thisx;
lasty=thisy;
lx[i]=thisx;
ly[i]=thisy;
im=i;
i++;
}
}
}
stop();
Coded Blend Mode?
I know how to select blend mode when in the flash authoring environment... but what if i want to make a drop down box with the different blend modes and dynamically change the blend mode @ run-time on a movieclip.
to give the user a way to change it.
is that possible?
ty in advance!
Help Reading In Poorly Coded XML
Hi, first post and I've got what I think is a doozie. I have poorly formatted XML that I cannot change unfortunately and I'm wondering if there's a way to pull the data into Flash still.
Here's a sample XML file:
<list>
<url1 artist="artist 1" title="Track 1" time=":15" video="">music/Track1.mp3</url1>
<url1 artist="artist 2" title="Track 2" time=":15" video="">music/Track2.mp3</url1>
</list>
I can get the data from all the normal spots, artist, title, etc. but cannot figure out how to get the data from within the brackets. Any help is GREATLY appreciated!
Hard-coded Rgb Values
Does anyone have a text file with a bunch ( > 100 && < 1000) of hardcoded rgb value (referably "colorful" rather than b&w ). I plan on using them in an array where random values are chosen. I can make my own, and have so far, but it's only 10 values long Looking for a shortcut!
Thanks,
Cheez
Actionscript Coded Colour Ref
Hey guys
I got this code in my movie but someone has decided to be clever and code it all in...
ActionScript Code:
firstcolour = 11583689;
header1 = 14540253;
headerside = 16777215;
headerselect = 2698287;
headerdeselect = 8163481;
Anyone know what these colours stand for??///
Coded Button States Mx
Hi,
I am trying to complete my navigation bar. I have the onRollOver / Out and Release states finished, my only problem now is that onRelease is not reversable. Once I click on another button, my previously pressed button is still in its down state. All my buttons have been created dynamically with no timelines involved. He is the button code that is within a for loop:
[as]
navBar["myBtn"+i].onRollOver = function() {
//create pointer mc over button
var pointer = this.attachMovie("buttonPointer", "pointer_mc", 21);
with (pointer) {
_x = this._width/2 -3;
_y = -2;
_alpha = 0;
}
this.onEnterFrame = function() {
if (this.pointer_mc._y<3) {
this.pointer_mc._y += 1;
this.pointer_mc._alpha += 20;
}
};
this.name_txt.textColor = 0xFFF0FF;
};
navBar["myBtn"+i].onRollOut = function() {
this.onEnterFrame = function() {
this.pointer_mc._y -= 1;
};
this.name_txt.textColor = 0x000000;
};
navBar["myBtn"+i].onRelease = function() {
this.name_txt.textColor = 0xFFFFFF;
this.enabled = false;
}
My question then, is how do you have your button return to its orginal state after another one is clicked.
Oh, i nearly forgot, is it possible too, to create an onRelease action seperate to the one in the above code (as long as i reference right) so that i can loadMovie etc.
cheers
Greg
Coded Button States Mx
Hi,
I am trying to complete my navigation bar. I have the onRollOver / Out and Release states finished, my only problem now is that onRelease is not reversable. Once I click on another button, my previously pressed button is still in its down state. All my buttons have been created dynamically with no timelines involved. He is the button code that is within a for loop:
[as]
navBar["myBtn"+i].onRollOver = function() {
//create pointer mc over button
var pointer = this.attachMovie("buttonPointer", "pointer_mc", 21);
with (pointer) {
_x = this._width/2 -3;
_y = -2;
_alpha = 0;
}
this.onEnterFrame = function() {
if (this.pointer_mc._y<3) {
this.pointer_mc._y += 1;
this.pointer_mc._alpha += 20;
}
};
this.name_txt.textColor = 0xFFF0FF;
};
navBar["myBtn"+i].onRollOut = function() {
this.onEnterFrame = function() {
this.pointer_mc._y -= 1;
};
this.name_txt.textColor = 0x000000;
};
navBar["myBtn"+i].onRelease = function() {
this.name_txt.textColor = 0xFFFFFF;
this.enabled = false;
}
My question then, is how do you have your button return to its orginal state after another one is clicked.
Oh, i nearly forgot, is it possible too, to create an onRelease action seperate to the one in the above code (as long as i reference right) so that i can loadMovie etc.
cheers
Greg
[FCS3]How To Call External SWF's
I am creating an eLearning class using Flash CS3.
I would like to use basic controls to control the class (i.e. play, next, back). What I am trying to figure out is how to each new slide.
Example: At the main menu screen users have three different chapters they can go to, each chapter is a seperate .SWF file. How do I call this SWF so that it loads and plays, without it being in a seperate FLV playback window?
Anybody have any ideas on how to do this? I am sure it is possible, but I am new and ignorant.
I do not want to use the slide show application becaquse it only supports AS 2.
(FCS3) Combo Box Flickers, Why?
Hi, got a combobox inside a mc in a 1.swf that I import into 2.swf but there the combobox just flicker. It works fine when I test it using
´Test Movie´ in flash. And if I go straight to the directory and open 1.swf.
Any ideas?
And another newbie question how do I relabel a datagrid instance? (I am using a script from a mate and I need to relable the datagrid)
Help really appriciated!
B
[FCS3] Point-Roll?
does anyone know a good script for Point-roll that works cross-platform? i've created a point-roll in Flash CS3: hover over Flash movie and unfolding the pane. it needs to play in both IE and Safari/Firefox ? we got it to work in IE but not Safari/Firefox.
thanx much,
Sara
scsirain@yahoo.com
[FCS3] Dynamic Layers
How do I dynamically control which object is shown above or below another? I want to create a rotating menu, where icons are revolving around a vertical axis. So the icons in the foreground will eventually become icons in the background and thus their view will get obstructed by the icons coming into the fore.
I'm figuring that the actionscript is needed to dynamically assign assets to layers. How do I achieve this?
(I haven't touched flash in ages and this may not be the correct place to post this)
[FCS3] Interface Annoyance
This is driving me nuts.
I'm using CS3 and since I like a large screen I'm in the habit of docking everything and collapse/expand my libraries. I also keep my properties panel docked at the bottom. Before, when I opened the library panel, it used to show up over everything. Now, I don't know which wrong button I pressed but the bottom of it keeps getting covered by the properties panel. The only way I can have it on top of properties is if I undock properties, which isn't what I want. Can any gurus out there help me with this annoying issue? Thanks in advance.
[FCS3] Including Php Links
I am working on a HTML/PHP site which uses php links to forward/include a refID. The links within the HTML have changed from standard HTML <a href="page.html"> to PHP <a href="<?writeLink('page.php')?> so the refID will always remain in the address bar for the contact.php page to pick up when relevant.
This is all fine, however I also use an animated Flash map to link to (for example) page.php. How can I update the standard getURL links in my Flash file to carry this RefID onwards?
The writelink code is:
<?
function writeLink($strLink)
{
echo $query_string;
$refId = $_GET["ref"];
if ($refId=="")
{
echo $strLink;
}
else if (parameterAlreadyExists()==true)
{
echo $strLink."?id=".$_GET["id"]."&ref=".$refId;
}
else
{
echo $strLink."?ref=".$refId;
}
}
function parameterAlreadyExists()
{
if ($_GET["id"]=="")
{
return false;
}
else
{
return true;
}
}
Not sure if I'm just being dumb, but I've spent hours trawling through various sites and Flash/PHP tutorials without finding the answer! Any help, as always, would be appreciated.
Class Exclusion In FCS3
Hi all :)
My question is related to the exclusion of classes during the compilation of a fla file (not using the Flex Builder !!!) using AS3. Simply, I'm searching a way to do the same as the exclude.xml using AS2. As I want to set a Document Class to my fla, I cannot use a describeType-solution or a solution
like that :(
Is there a way to do that ? I already launched a topic on Media-Box [FR] but it seems that isn't possible yet...
Best regards !
Flex And Fcs3 Not Playing Well Together
i havent woked on any as3 projects in a few months but now am getting back at it with a new project although now fcs3 and flex dont want to play well together like they used to.
first problem is when i have a movieclip in fcs3 linked to a AS3 class and put another movieclip inside it (in fcs3) and give it a variable name and try to declare it in the AS3 class
Code:
public class Puzzle1 extends MovieClip{
public var myImg:MovieClip;
it gives me this error: 1151: A conflict exists with definition myImg in namespace internal.
my second problem is when i try to pass tat same Puzzle1 class to another class it wont let me
Code:
public var pGrid:PGrid = new PGrid(this);
it gives me this error: 1067: Implicit coercion of a value of type Class to an unrelated type game.p1uzzle1.
but if i pass it in as a MovieClip it works fine, this i know can not be right.
any ideas on what the problem could be?
[FCS3] Class Limit?
There are 77 classes in my project and around 30 of them are linked to MovieClips. If I do a size report it says that my Actionscript classes are 110296 bytes.
I am having a mysterious problem. I have a MovieClip, and I would like to link a class to it in the library.
But I get the following error:
The class or interface 'gui.screens.game.ContinueGame' could not be loaded.
The class at the moment is empty (see code below), although I have tried renaming, deleting and recreating it a few times.
Code:
class gui.screens.game.ContinueGame extends MovieClip {
public function ContinueGame() {
}
}
I have also tried linking the class to other MovieClips that have been successfully linked other classes before - which didn't work.
I have tried linking other classes I have used before to the MovieClip - which worked. So the problem lies with the linking of the specific class. Since I have tried renaming it, I'm wondering if there is you can only link a certain number of classes or something. Or I am missing something obvious and will kick myself when I find it.
[FCS3] Help: Animated Navigation Bar
i'm trying to create a nav toolbar of some sort like the one that was mentioned here.
being an actionscript newbie relying on kirupa tutorials i am stumped on a few items.
questions.
1. how do i make the buttons inside the scrolling mc or any animated mc to work.
2. i am able to swap the z order of the scrolling items using swapDepths using "onRelease"... how do i make it work on something like "onRollOver"?
3. is there a way to maintain the object spacing on the scrolling items while the focused item is enlarged?
...i know there was one more question in my head... i kinda forgot what it was. update this post when i remember it =]
any help would be appreciated.
thanks!
Logging On With Flash (FCS3.AS2)
i've looked on the site and it doesn't quite have what i need (great site btw)
anyway this is what im looking for.
actionscript 2 for;
a stand alone flash program
that several users can log on
and multiple accounts can be made
and it will save and remember where the user was if they log in again
basically i'm making a puzzle flash game
if they finish level 1 level 2 gets unlocked and level 3 after level 2 is complete.
i'm thinking of heading on the lines of
if the user logs on and plays the variables (level 1, level 2, level 3) change from false to true until they complete the previous level (with the exception of level 1 always being true)
then when logging on again if the name and password is the same as previously used then they will be able to resume from either level 1 2 or 3 (they will have to start from the beginning of the puzzle naturally, not from their last move)
so is there any way to do this without mySQL and without PHP? or do i have to use them? because i'm using a stand alone flash file and at most use a simple .txt or an .xml file.
also its preferred that all scripting done on the first frame and not on buttons and using instance names not the var box down in the bottom right hand corner.
(if not ill translate it on my own)
fast help will be greatly appreciated
thanks in advance!!
z~
PS im not a flash wiz or anything... i just know the basics...
Color Coded Buttons With Script? (v MX)
(I'm using flash MX incase you didn't realise :P)
Hi =)
http://shanks.*****nut.net <-- observe the cubes...
they are all part of one mc, because they were made and rendered in 3dsm, and to have the animation, must be grouped together.
But, I want them each to be individual buttons...
The first idea was invisible buttons moving infront.. but in a 200 frame sequence, this is hours of work, which i can't afford unfortunately.
so, I was wondering: is there a way with actionscript, to make the colors into buttons? i mean: can i make white, and the various shades of it, button(1). then green, and the various shades of it, button(2).. and so on.
If not, any other ideas? :P Thanks in advanced people.
// Shanks
Can String Coded Swf's Into One Big Flash Project - Is That Possible?
Hey guys,
I have a quick question before continuing on a very large project. Can I string separate flash projects/coded movies/swf's into one large Falsh final project without making a mess?
At the moment, my project is too large to work on so I'm in the pocess of partitioning it into separate projects respectively so everything stays on the root level for scripting.
I'm trying to make a comprehensible interactive storyboard. What's a good way of attacking this problem? At the moment - I have aproximately 65 screens with various levels in 6 different "scenes" that are linked with the gotoAndPlay action. I want to actionscript my movies but it's too complex.
What do you think - your seasoned techno opinion is desparately needed. If I ever finish - this will be a great educational flash site for kids.
Thanks,
Bluevenus
Hard-coded Playlist XML Url Into Flashvar?
Hey All,
So right now, I have a video player that pulls in all sorts of info (flv url, caption file url, video title, description, preview image, etc.) through an external xml file (playlist.xml). It works great, but I need to change the coding so it's not hard-coded into the FLA, rather from the embed code for the swf.
Any idea how I can do this?
Here's the chunk of AS3 code that's involved in the original loading of the XML data:
Code:
var Loadedxml:XML;
var urlLoader:URLLoader = new URLLoader();
var urlRequest = new URLRequest("playlist.xml");
urlLoader.load(urlRequest);
urlLoader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (evt:Event):void
{
try
{
var Loadedxml:XML= new XML(evt.target.data);
processXML (Loadedxml);
}
catch (evt:TypeError)
{
trace ("Could not parse text into XML");
trace (evt.message);
}
}
And here's the code on the html page:
Code:
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="415" id="AS3_Player_XML_1119" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="AS3_Player_XML_1119.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ecf2fe" /><embed src="AS3_Player_XML_1119.swf" quality="high" bgcolor="#ecf2fe" width="500" height="415" name="AS3_Player_XML_1119" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
Thanks!
Joe
Hard-coded Playlist XML Url Into Flashvar?
Hey All,
So right now, I have a video player that pulls in all sorts of info (flv url, caption file url, video title, description, preview image, etc.) through an external xml file (playlist.xml). It works great, but I need to change the coding so it's not hard-coded into the FLA, rather from the embed code for the swf.
Any idea how I can do this?
Here's the chunk of AS3 code that's involved in the original loading of the XML data:
Code:
var Loadedxml:XML;
var urlLoader:URLLoader = new URLLoader();
var urlRequest = new URLRequest("playlist.xml");
urlLoader.load(urlRequest);
urlLoader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (evt:Event):void
{
try
{
var Loadedxml:XML= new XML(evt.target.data);
processXML (Loadedxml);
}
catch (evt:TypeError)
{
trace ("Could not parse text into XML");
trace (evt.message);
}
}
And here's the code on the html page:
Code:
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="415" id="AS3_Player_XML_1119" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="AS3_Player_XML_1119.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ecf2fe" /><embed src="AS3_Player_XML_1119.swf" quality="high" bgcolor="#ecf2fe" width="500" height="415" name="AS3_Player_XML_1119" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
Thanks!
Joe
Fancy Animated Preloaders, How Are They Coded?
How are all the type of fancy preloaders that most good flash sites have now made?
I mean the type that animate like the 2advanced ones that everyone knows. For example the preloader moves into the frame grows in size then when loading is finished shrinks back and moves off stage before anything else happens. I know all this stuff is done by Actionscript but doesn't it affect all the preload code, and where would it be placed.
I really want to develop such a preloader not exactly sure what it will do yet, but i could do with knowing generally where to start if possible.
Hard-coded Playlist XML Url Into Flashvar?
Hey All,
So right now, I have a video player that pulls in all sorts of info (flv url, caption file url, video title, description, preview image, etc.) through an external xml file (playlist.xml). It works great, but I need to change the coding so it's not hard-coded into the FLA, rather from the embed code for the swf.
Any idea how I can do this?
Here's the chunk of AS3 code that's involved in the original loading of the XML data as well as the html text too.
Thanks!
Joe
Attach Code
AS3 FLASH CODE:
var Loadedxml:XML;
var urlLoader:URLLoader = new URLLoader();
var urlRequest = new URLRequest("playlist.xml");
urlLoader.load(urlRequest);
urlLoader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (evt:Event):void
{
try
{
var Loadedxml:XML= new XML(evt.target.data);
processXML (Loadedxml);
}
catch (evt:TypeError)
{
trace ("Could not parse text into XML");
trace (evt.message);
}
}
HTML CODE:
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="415" id="AS3_Player_XML_1119" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="AS3_Player_XML_1119.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ecf2fe" /><embed src="AS3_Player_XML_1119.swf" quality="high" bgcolor="#ecf2fe" width="500" height="415" name="AS3_Player_XML_1119" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
MediaDisplay Vs FLVplayback - Coded CuePoint
I am running into a problem with the FLVplayback. I like how MediaDisplay lets you code cuePoints...and well almost everything else for it. I was wondering if this was possible for the FLVplayback.
I'd like to be able to add cuePoints, and other parameters to a video using the FLVplayback without having to actually click on the component, and hardcode the info into the component via the parameters menu.
Would it just be better to find a video controller and strictly use the MediaDisplay component?
Coded Tweens Mysteriously Abort
Hi there. I am working on a site where I have coded a number of different Tweens to shift between the menu states. The code works just great on its own, but when I then start loading external SWFs to populate the menu, things start acting a little funny. More specifically, on occasion, one of the Tweens does not complete as it should - it stops part-way and does not fire TweenEvent.MOTION_FINISH. Is there something I could be dong that interrupts the Tween? I am using the Loader class to load the SWF and I use the FLVPlayback class within the SWF - would either of these interfere with the Tweens?
It's quite a frustrating problem. The first time I coded the whole thing I built objects on the stage and then animated them with code... when I ran into the above problem, I figured it could be a problem with my code and decided to redo the whole thing using a class for the menu. But this has the exact same problem - it works fine on its own, but not in conjunction with the external SWF I need to load in.
It doesn't seem to be a problem with my tween code - since it works fine on its own - but just in case, here is my class:
Code:
package {
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
public class Panel extends MovieClip{
public var panelX: Number = 0;
public var tabHeight: Number = 30;
public var panelHeight: Number = 475;
public var panelWidth: Number = 250;
public var fullWidth: Number = 770;
public var tabY: Number = 0 - tabHeight;
public var changeSpeed: Number = .5;
public var currentState: String = "unselected";
public function Panel (col:String,panelNum:Number) {
var mc = new MovieClip();
mc.graphics.beginFill(col);
mc.graphics.drawRect(0,0,panelWidth,panelHeight);
addChild(mc);
if(panelNum == 2) mc.x -= panelWidth/2;
else if(panelNum == 3) mc.x -= panelWidth;
}
public function moveToTab () {
if(currentState == "unselected") {
trace(this);
var mc_tween1: Object = new Tween(this,"y",None.easeNone,this.y,this.y-tabHeight,changeSpeed,true);
var mc_tween2: Object = new Tween(this,"height",None.easeNone,this.height,tabHeight,changeSpeed,true);
//var mc_tween3: Object = new Tween(this,"alpha",None.easeNone,1,.5,changeSpeed,true);
}
if(currentState == "maximized") {
var mc_tween1: Object = new Tween(this,"y",None.easeNone,this.y,this.y-30,changeSpeed,true);
var mc_tween2: Object = new Tween(this,"height",None.easeNone,this.height,tabHeight,changeSpeed,true);
var mc_tween3: Object = new Tween(this,"width",None.easeNone,fullWidth,panelWidth,changeSpeed,true);
}
currentState = "tabbed";
}
public function maximize () {
parent.setChildIndex(this,2);
if(currentState == "unselected") {
var mc_tween2: Object = new Tween(this,"height",None.easeNone,this.height,panelHeight,changeSpeed,true);
var mc_tween3: Object = new Tween(this,"width",None.easeNone,panelWidth,fullWidth,changeSpeed,true);
}
else if(currentState == "tabbed") {
var mc_tween1: Object = new Tween(this,"y",None.easeNone,this.y,this.y+tabHeight,changeSpeed,true);
var mc_tween2: Object = new Tween(this,"height",None.easeNone,this.height,panelHeight,changeSpeed,true);
var mc_tween3: Object = new Tween(this,"width",None.easeNone,panelWidth,fullWidth,changeSpeed,true);
var mc_tween5: Object = new Tween(this,"alpha",None.easeNone,.5,1,changeSpeed,true);
}
currentState = "maximized";
}
}
}
You can see a working version here: http://playwithyourmind.com/freelanc...panel_test.swf
and then the broken version here: http://playwithyourmind.com/freelanc...anel_test1.swf
... just click on the panels to switch between them
Thanks, any insights are greatly appreciated!
Hard-coded Playlist XML Url Into Flashvar?
Hey All,
So right now, I have a video player that pulls in all sorts of info (flv url, caption file url, video title, description, preview image, etc.) through an external xml file (playlist.xml). It works great, but I need to change the coding so it's not hard-coded into the FLA, rather from the embed code for the swf.
Any idea how I can do this?
Here's the chunk of AS3 code that's involved in the original loading of the XML data:
Code:
var Loadedxml:XML;
var urlLoader:URLLoader = new URLLoader();
var urlRequest = new URLRequest("playlist.xml");
urlLoader.load(urlRequest);
urlLoader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (evt:Event):void
{
try
{
var Loadedxml:XML= new XML(evt.target.data);
processXML (Loadedxml);
}
catch (evt:TypeError)
{
trace ("Could not parse text into XML");
trace (evt.message);
}
}
And here's the code on the html page:
Code:
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="415" id="AS3_Player_XML_1119" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="AS3_Player_XML_1119.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ecf2fe" /><embed src="AS3_Player_XML_1119.swf" quality="high" bgcolor="#ecf2fe" width="500" height="415" name="AS3_Player_XML_1119" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
Thanks!
Joe
[FCS3] Problems With Gotoandplay And GetURL?
I just started using Flash CS3 and am trying to do something seemingly very simple. All I want to do is loop Scene 2 and have the flash movie link to a certain web page. I managed to get it to loop Scene 2, but once I added the button with the link, it stopped looping. I'm not sure if I even have the link working either.
I made a mockup of my FLA. This is exactly how I do it in my real FLA.
Any help is appreciated
[fcs3-as2] Save Listbox To File...
Hi again,
Well, using AS2, because I just don`t know whats to great about AS3 above AS2 yet. I`m used to Delphi, so maybe AS3 would be better, but for now, it`s AS2
And to the question;
I`m making a little program. It contains lists witch can be edited (add/remove/edit-line). It`s holding information like programs/games/movies and stuff you`v got on your computer.
All the buttons are working, but I still need one more thing; save the lists to a .txt file(or .ini, or whatever).
How do I do this? Just a simple methode to save all the lines in a way that they can be read back again. (Need help with the read thing too..)
And is there any way to "hold" the information inside the flashfile as long as it`s running? Because, I`v got 5 areas witch loads on different keyframes (depending on what cathegory you click on in the main menu) and each time I switch to another place on the timeline and back again, the text is gone...
Would work to just save/load each time too...
Thanks in advance!
[FCS3]Simple Textbox Problem
Hey guys,
For some reason when i click in a multiline textbox the cursor appears on the 2nd line not the very top line. Does this happen to everyone or is there a way to fix this? Seems a bit unprofessional on my contact form...
Thx
|