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




Recursive (kinda) Map Maker, Having Trouble With The Code.



code:
function holder(s){
returnMap=Array()
for(i=0;i<s+1;i++){
returnMap.push([])
for(j=0;j<s+1;j++){
returnMap[i].push(0)
}
}
return returnMap
}
function maze(oldPoint,limit){
if(oldPoint[0]>=limit or oldPoint[1]>=limit){
return 0
}
_root.map[oldPoint[0]][oldPoint[1]]=1
dir=random(2)
if(dir==0){
newPoint=[random(limit),oldPoint[1]]
small=(oldPoint[0]<newPoint[0]) ? oldPoint[0]:newPoint[0]
large=(oldPoint[0]>newPoint[0]) ? oldPoint[0]:newPoint[0]
for(i=small;i<large;i++){
_root.map[i][oldPoint[1]]=1
}
}
if(dir==1){
newPoint=[oldPoint[0],random(limit)]
small=(oldPoint[0]<newPoint[0]) ? oldPoint[0]:newPoint[0]
large=(oldPoint[0]>newPoint[0]) ? oldPoint[0]:newPoint[0]
for(i=small;i<large;i++){
_root.map[oldPoint[0]][i]=1
}
}
maze(newPoint,limit)
}
function mainMaze(limit){
_root.map=holder(limit)
maze([0,0],limit)
}
mainMaze(10)


well, the holder() function works, thats for sure. i also know that the whole thing with making the newPoint works too. output doesnt give me any errors. i also tested the initial if statement to see if it doesnt become an infinite loop (flash stops recursion at 256 calls?) and it worked. so what could be the problem with this? also, if anyone has any better (simpler) techniques for making a maze recursively, dont hesitate to post it. thanks in advance..



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-24-2004, 08:23 PM


View Complete Forum Thread with Replies

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

[HELP] My Cluthered Code Needs Recursive Algorithm...
Hello,

I'm building a picture slideshow and want to place my pictures (loaded jpegs) next to each other.
Simple, but the only problem is they all differ in width.

So I came up with a 'main' movieclip wich holds 10 other 'containerMC' movieclips in wich the pics get loaded.

Basically looks like this : http://theremedy.be/scrap/spaz03.htm (click the squares, wait till loading is complete)

Now my question. Could you please be so kind to help me clean up this code.
There's gotta be a cleaner way to script this. If you wish I will reward you with the final working fla.

I use this :


Code:
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pic);
_root.onEnterFrame = function() {
for (i=0; i<10; i++) {
var t = _root.main["containerMC"+i].getBytesTotal(), l = _root.main["containerMC"+i].getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1) {
_root.main["containerMC"+i].i = i;
_root.main.containerMC1._x = 0;
_root.main.containerMC1._y = 0;
var picWidth = _root.main.containerMC1._width;
_root.main.containerMC2._x = picWidth;
_root.main.containerMC2._y = 0;
var picWidth2 = _root.main.containerMC1._width+_root.main.containerMC2._width;
_root.main.containerMC3._x = picWidth2;
_root.main.containerMC3._y = 0;
var picWidth3 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width;
_root.main.containerMC4._x = picWidth3;
_root.main.containerMC4._y = 0;
var picWidth4 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width;
_root.main.containerMC5._x = picWidth4;
_root.main.containerMC5._y = 0;
var picWidth5 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width;
_root.main.containerMC6._x = picWidth5;
_root.main.containerMC6._y = 0;
var picWidth6 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width;
_root.main.containerMC7._x = picWidth6;
_root.main.containerMC7._y = 0;
var picWidth7 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width;
_root.main.containerMC8._x = picWidth7;
_root.main.containerMC8._y = 0;
var picWidth8 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width+_root.main.containerMC8._width;
_root.main.containerMC9._x = picWidth8;
_root.main.containerMC9._y = 0;
var picWidth9 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width+_root.main.containerMC8._width+_root.main.containerMC9._width;
_root.main.containerMC10._x = picWidth9;
_root.main.containerMC10._y = 0;
}
}
};
};


if (_root.welke=="messagerie") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/men/messagerie/0"+i]+".jpg");
}
}
if (_root.welke=="pantofola") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/shoes/pantofola/0"+i]+".jpg");
}
}
if (_root.welke=="anna") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/woman/anna/0"+i]+".jpg");
}
}{

[HELP] My Cluthered Code Needs Recursive Algorithm...
Hello,

I'm building a picture slideshow and want to place my pictures (loaded jpegs) next to each other.
Simple, but the only problem is they all differ in width.

So I came up with a 'main' movieclip wich holds 10 other 'containerMC' movieclips in wich the pics get loaded.

Basically looks like this : http://theremedy.be/scrap/spaz03.htm (click the squares, wait till loading is complete)

Now my question. Could you please be so kind to help me clean up this code.
There's gotta be a cleaner way to script this. If you wish I will reward you with the final working fla.

I use this :


Code:
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pic);
_root.onEnterFrame = function() {
for (i=0; i<10; i++) {
var t = _root.main["containerMC"+i].getBytesTotal(), l = _root.main["containerMC"+i].getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1) {
_root.main["containerMC"+i].i = i;
_root.main.containerMC1._x = 0;
_root.main.containerMC1._y = 0;
var picWidth = _root.main.containerMC1._width;
_root.main.containerMC2._x = picWidth;
_root.main.containerMC2._y = 0;
var picWidth2 = _root.main.containerMC1._width+_root.main.containerMC2._width;
_root.main.containerMC3._x = picWidth2;
_root.main.containerMC3._y = 0;
var picWidth3 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width;
_root.main.containerMC4._x = picWidth3;
_root.main.containerMC4._y = 0;
var picWidth4 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width;
_root.main.containerMC5._x = picWidth4;
_root.main.containerMC5._y = 0;
var picWidth5 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width;
_root.main.containerMC6._x = picWidth5;
_root.main.containerMC6._y = 0;
var picWidth6 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width;
_root.main.containerMC7._x = picWidth6;
_root.main.containerMC7._y = 0;
var picWidth7 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width;
_root.main.containerMC8._x = picWidth7;
_root.main.containerMC8._y = 0;
var picWidth8 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width+_root.main.containerMC8._width;
_root.main.containerMC9._x = picWidth8;
_root.main.containerMC9._y = 0;
var picWidth9 = _root.main.containerMC1._width+_root.main.containerMC2._width+_root.main.containerMC3._width+_root.main.containerMC4._width+_root.main.containerMC5._width+_root.main.containerMC6._width+_root.main.containerMC7._width+_root.main.containerMC8._width+_root.main.containerMC9._width;
_root.main.containerMC10._x = picWidth9;
_root.main.containerMC10._y = 0;
}
}
};
};


if (_root.welke=="messagerie") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/men/messagerie/0"+i]+".jpg");
}
}
if (_root.welke=="pantofola") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/shoes/pantofola/0"+i]+".jpg");
}
}
if (_root.welke=="anna") {
for (i=0; i<10; i++) {
_root.main["containerMC"+i].loadPic(["images/woman/anna/0"+i]+".jpg");
}
}{

Kinda Urgent Question (code Error = Frozen Flash :S), And Then A URL Question
ok, well i just tried AS for the first time, made a cool movieclip with an invisible button on top, but it looks like i've made a mistake cuz the whole thing just stopped and now my flash is frozen. if i exit, i lose my work (~20 lines) that has taken me the past 3 hours. it may be easy for you, but i really dont wanna go thru this again, so how can i stop a flash program (with hotkeys, cant click any buttons)?

second question, less urgent, but i want to combine my movieclip-button with my website, and have it so when the animation is done, it goes to a specific url. how can i code it to go to a URL? (or just tell me the order of classes i need to use, im familiar with it in java so im sure flash cant be too tough)

thanks a ton, and maybe even saving me hours of work ^^

EDIT: alrite, its kinda past the stage where i know what to do other than exit, but is there an auto-recovery thing where it saved my work :S:S:S:S:S

Trouble With XML Code
I have been using flash for some time now. I am starting to put more dynamic content into my websites as a means of making my SWF's smaller and overall just trying to be more efficient with my time. I am starting to play with XML with flash as a means of managing my updates for events and products. I am new to XML, and just when I think I understand the logic. Something like this happends to me. The problem I have run into is the code below references "3.0 liter" in my XML. When I would usually think that the following line would do it.
index1=DB.childNodes[0].childNodes[1].childNodes[2].firstChild;

Does anybody have a clue as to what I am doing wrong?

on(release){
DB.ignoreWhite=true;
index1=DB.childNodes[1].childNodes[3].childNodes[5].firstChild;
trace(index1);
}

And here is my XML Database

<?xml version="1.0"?>
<cars>
<car>
<make>honda</make>
<model>prelude</model>
<engine>2.2 liter</engine>
<style>sportscar</style>
<horsepower>200HP</horsepower>
</car>
<car>
<make>honda</make>
<model>accord</model>
<engine>3.0 liter</engine>
<style>sedan</style>
<horsepower>180HP</horsepower>
</car>
<car>
<make>honda</make>
<model>civic</model>
<engine>1.6 liter</engine>
<style>coupe</style>
<horsepower>160HP</horsepower>
</car>
</cars>

Im Having Trouble With This Code
Hi!

I dont really know much about actionscript, just very slightly knowledge. Altough I made research it is complex and is not those things that you learn quickly.
Anyway I need to solve a puzzle, I think by completing the code, I made research but is really complex and nothing comes to my head, Im looking forward if anyone could please give me some info or advice. This really is not my area, (my area are S60 devices)

Here it is:



Code:
packagecom.legendsTelegraph.puzzles.puzzle5
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;

import com.caurina.transitions.Tweener;

import com.legendsTelegraph.puzzles.puzzle5.CodeField;
import com.legendsTelegraph.view.buttons.SendButton;
import com.legendsTelegraph.data.TextXml;

public class FloaterContent extends Sprite
{
public static const ON_COMPLETE:String = "onSubmitPuzzle5Complete";private var _codeField :CodeField;
private var _compileButton :SendButton;

public function FloaterContent() {
_codeField = new CodeField();
_codeField.x = 22;
_codeField.y = 20;
addChild ( _codeField );
var codeFieldRect:Rectangle= _codeField.getRect ( this );

_compileButton = new SendButton ( TextXml.getText().puzzle5.compileButton );
_compileButton.x= int ( codeFieldRect.x + codeField.width / 2 );
_compileButton.y= int ( codeFieldRect.bottom ) + 20;
addChild ( _compileButton );

_compileButton.addEventListener ( MouseEvent.MOUSE_UP, onCompile );
}

HERE IS WHERE THE CODE MUST BE COMPLETED

private function animPuzzleOut():void {
_compileButton.removeEventListener ( MouseEvent.MOUSE_UP, onCompile );
Tweener.addTween ( this, { alpha:0, time:1, transition:"easeInOutCubic", onCompletenAnimOut } )
}

HERE ALSO THE CODE MUST BE COMPLETED

Basically I need to finish the code, where I wrote ''Here needs to be completed''

Thanks for hearing me!

Trouble With AS3 Code
I can't seem to get this code to work correctly.

Code:

stop();
StageScaleMode.NO_SCALE;

var zipCode="28227";
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest("http://www.jdmstudio.com/junk/myProxy.php?zip="+ zipCode));

function loadXML(e:Event):void{
   var xml = new XML(e.target.data);
   today.text = "Today";
   //trace(xml);
   var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
   if (loadXML) {
      //today.text = this.firstChild.childNodes[0].childNodes[12].childNodes[7].attributes.day;
      tomorrow.text = this.firstChild.childNodes[0].childNodes[12].childNodes[8].attributes.day;
      for (i = 0; i <= 6; i++) {
         if (tomorrow.text == days[i].slice(0, 3)) {
            tomorrow.text = days[i];
            break;
         }
      }
   }
}

Having Trouble With Background Code
I was wondering if anyone had any idea how to write an action script code that would apon clicking a button(background 3 button) would change a variable and then if the variable was equal to 3 for example it would change into my third background I have already made. Then if you click another button(background 2 button) it would tell the variable to equal 2 and thus telling my animation to go to my second background.

Press button --> variable change --> background = certain variable
this is what I had(don't laugh I'm new!haa haa):

this is what I had for the background code:

if (var1=1) {
gotoAndPlay (1);
}
if (var1=2) {
gotoAndPlay (2);
}


and this is what I had for the button code:

on (release) {
set ("poop", 1);
}

both buttons I made didn't work and it automaticly took me to background 2

Trouble With Code, Cannot Connect
ok, I'm trying to make a checkout system for my design services. I used couple of components and actionscripting.

I've several concerns:
1) How do I make first checkbox second subpage chooser and coding service connected? I want price for 1psd + subpages to change according to what customer chooses in the coding dropdown.
2) I cannot make subpages thing to add up to the totall.
3) I've trouble with dropdown, what kind of variable does it pass back?
4) Also what if customer doesn't want any logo and only selects it, how can I make it so that subpage section and coding thing are inactive?

any help regarding this issues appreciated.

Here is the source code:

PHP Code:



T = (0);

//1psd layout

var checkboxpsd1pListener:Object = new Object();
checkboxpsd1pListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (100);
 } else {
  T = T - (100);
 }
 _root.fielcalc0.text = T
};
psd1p.addEventListener("click", checkboxpsd1pListener);

//logo

var checkboxlogoListener:Object = new Object();
checkboxlogoListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (40);
 } else {
  T = T - (40);
 }
 _root.fielcalc0.text = T
};
logo.addEventListener("click", checkboxlogoListener);

//subpages

SP = (10);
var nstepListener:Object = new Object();
nstepListener.change = function(evt_obj:Object) {
//??????????

 _root.fielcalc0.text = T
};
subpages.addEventListener("change", nstepListener);


//banner

var checkboxbannerListener:Object = new Object();
checkboxbannerListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (10);
 } else {
  T = T - (10);
 }
 _root.fielcalc0.text = T
};
banner.addEventListener("click", checkboxbannerListener);

//coding

var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
 var item_obj:Object = coding.selectedItem;
 var i:String;
 //?????
 _root.fielcalc0.text = T
};
coding.addEventListener("change", cbListener);

//Macromedia Flash Section
//FlashIntro

var checkboxflashintroListener:Object = new Object();
checkboxflashintroListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (250);
 } else {
  T = T - (250);
 }
 _root.fielcalc0.text = T
};
flashintro.addEventListener("click", checkboxflashintroListener);

//flashelements

var checkboxflashelementsListener:Object = new Object();
checkboxflashelementsListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (25);
 } else {
  T = T - (25);
 }
 _root.fielcalc0.text = T
};
flashelements.addEventListener("click", checkboxflashelementsListener);

//flashbanner

var checkboxflashbannerListener:Object = new Object();
checkboxflashbannerListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  T = T + (20);
 } else {
  T = T - (20);
 }
 _root.fielcalc0.text = T
};
flashbanner.addEventListener("click", checkboxflashbannerListener); 





also here is an attached swf file so u understand it better.

Having Trouble With Basic Code
Hi

I have just started using logical operators and require some guidance. Basically Im trying to generate some values, not in an array though just variables.

This is basically what Im trying to do


Code:

a=3
_global.Y1=2;
_global.Y2=4;
_global.Y3=6;
for(i=0;i<=a;i++) {
x[i]=(some formula)*Y[i]
}
Then what I want to happen is the following calculations to take place and variable created;
x1=(some formula)*Y1
x2=(some formula)*Y2
x3=(some formula)*Y3

Can anyone provide assistance on my problem Im not sure where to start.

Thanks

Trouble Converting As1.0 Code To As2.0
any help would be appreciated

ActionScript Code:
function doShape (triClip, x1, y1, x2, y2, x3, y3) {    var abx = x1-x2;    var aby = y1-y2;    var cax = x3-x1;    var cay = y3-y1;    var bcx = x2-x3;    var bcy = y2-y3;    var dir = (cax*bcy-cay*bcx<0) ? 1 : -1;    var ab = abx*abx+aby*aby;    var ca = cax*cax+cay*cay;    var bc = bcx*bcx+bcy*bcy;    var prod = ab*bc*ca;    var sum = ab+bc+ca;    var mx2 = (ab>ca) ? ((ab>bc) ? ab : (bc)) : ((ca>bc) ? ca : (bc));    var hh = prod/mx2/mx2-sum*sum/4/mx2-mx2+sum;    with (triClip) {        if (mx2 == ab) {            var pp = 1.73205081/Math.sqrt(1+2*Math.sqrt((bc-hh)/(ca-hh)));            _rotation = Math.atan2(-aby, -abx)*180/Math.PI;            base.type._rotation = 0;            _x = x2;            _y = y2;        } else if (mx2 == bc) {            var pp = 1.73205081/Math.sqrt(1+2*Math.sqrt((ca-hh)/(ab-hh)));            _rotation = Math.atan2(-bcy, -bcx)*180/Math.PI;            base.type._rotation = 240;            _x = x3;            _y = y3;        } else {            var pp = 1.73205081/Math.sqrt(1+2*Math.sqrt((ab-hh)/(bc-hh)));            _rotation = Math.atan2(-cay, -cax)*180/Math.PI;            base.type._rotation = 120;            _x = x1;            _y = y1;        }        var rr = Math.sqrt(pp*pp+3)/2;        base._xscale = 100*pp;        base._rotation = Math.atan(1.73205081/pp)*180/Math.PI;        _xscale = Math.sqrt(mx2)/rr;        _yscale = 1.15470054*Math.sqrt(hh)*rr/pp*dir;    }}function shapeUpdate () {    _root.doShape(_root.tri1, _root.A._x, _root.A._y, _root.B._x, _root.B._y, _root.C._x, _root.c._y);}_root.activeType = 0;_root.tri1.base.type.gotoAndStop(_root.activeType+1);_root.node = "A";shapeUpdate();_root.node = "X";stop ();

Array Trouble In OO Code Tetris
Aargh!
beginning to question my sanity!! for some reason
the first horiz line is overlooked!! the peace stops on second line just fine(ok, at this point thought it could be logical) but it stops on the last line too(when last is only)!! i'm making no sense i know...
i'm making a tetris clone, with a 10x15 area(12x16 with borders) where i have a 2dim array area[col][row] 0=empty, 1=occupied, ok. i have a 3dim array for peaces shape[rotpos][squareno][0=x,1=y].
to complicate things im trying to make it OO. i made a rotation cw+ccw methods, a refresh, and started coding the vert movement(for this i needed a peace of code to stop my peace if encounters a "1"), but it all seems illogical now
cause it overlooks "1" in area array for first time ONLY,trace says its "0", after playing around with the area array (0,1,0,0,0,1,0,0,0,1,0,0,0,1)->(0,0,0,0,0,1,0,0,0,1,0,0,0,1)->(0,0,0,0,0,0,0,0,0,1,0,0,0,1)etc. etc. it always stops on the 2ND LINE!! OH WHY OH WHY! give me medication!!!

here's the code:

frame 1 (main stage)

area = new Array();
for (l=0; l<12; l++) {
area[l] = new Array(0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1); //1=horiz line
}
no = 50;
for (l=0; l<16; l++) {
area[0][l]="1";
area[11][l]="1";
} //vert lines
for (l=0; l<16; l++) {
line = "";
for (c=0; c<12; c++) {
line += area[c][l];
_root.attachMovie("box", ["pohja"+no], no);

if (area[c][l] == "0") {
_root["pohja"+no].gotoAndStop(5);
} else {
_root["pohja"+no].gotoAndStop(6);
}
_root["pohja"+no]._x = 50+20*c;
_root["pohja"+no]._y = 50+20*l;
no++;
}
trace (line);
}//just a visual aid
function dummyCheck () {
for (r=0; r<15; r++) {
sum = 0;
for (c=0; c<10; c++) {
if (area[c][r] != 0) {
sum++;
}
}
if (sum == 10) {
return r;
}
}
return -1;
}
scrollDown(5);
trace (dummyCheck());
function clearRow (row) {
for (c=0; c<10; c++) {
area[c][row] = 0;
}
}
clearRow(dummyCheck());
trace (dummyCheck());
function scrollDown (row) {
for (r=row; r>0; r--) {
for (c=0; c<10; c++) {
area[c][r] = area[c][r-1];
}
}
area[0] = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
function pala (muoto) {
this.shape = new Array();
for (s=0; s<10; s++) {
this.shape[s] = new Array();
for (s1=0; s1<10; s1++) {
this.shape[s][s1] = new Array();
}
}
if (muoto == "viiva") {
this.shape[0][0][0] = 2;
this.shape[0][0][1] = 1;
this.shape[0][1][0] = 2;
this.shape[0][1][1] = 2;
this.shape[0][2][0] = 2;
this.shape[0][2][1] = 3;
this.shape[0][3][0] = 2;
this.shape[0][3][1] = 4;

this.shape[1][0][0] = 1;
this.shape[1][0][1] = 2;
this.shape[1][1][0] = 2;
this.shape[1][1][1] = 2;
this.shape[1][2][0] = 3;
this.shape[1][2][1] = 2;
this.shape[1][3][0] = 4;
this.shape[1][3][1] = 2;
this.lngth = 2;
}
if (muoto == "s1") {
this.shape[0][0][0] = 1;
this.shape[0][0][1] = 2;
this.shape[0][1][0] = 2;
this.shape[0][1][1] = 2;
this.shape[0][2][0] = 2;
this.shape[0][2][1] = 1;
this.shape[0][3][0] = 3;
this.shape[0][3][1] = 1;

this.shape[1][0][0] = 1;
this.shape[1][0][1] = 1;
this.shape[1][1][0] = 1;
this.shape[1][1][1] = 2;
this.shape[1][2][0] = 2;
this.shape[1][2][1] = 2;
this.shape[1][3][0] = 2;
this.shape[1][3][1] = 3;
this.lngth = 2;
}
if (muoto == "s2") {
this.shape[0][0][0] = 1;
this.shape[0][0][1] = 1;
this.shape[0][1][0] = 2;
this.shape[0][1][1] = 1;
this.shape[0][2][0] = 2;
this.shape[0][2][1] = 2;
this.shape[0][3][0] = 3;
this.shape[0][3][1] = 2;

this.shape[1][0][0] = 2;
this.shape[1][0][1] = 1;
this.shape[1][1][0] = 2;
this.shape[1][1][1] = 2;
this.shape[1][2][0] = 1;
this.shape[1][2][1] = 2;
this.shape[1][3][0] = 1;
this.shape[1][3][1] = 3;
this.lngth = 2;
}
if (muoto == "nelio") {
this.shape[0][0][0] = 1;
this.shape[0][0][1] = 1;
this.shape[0][1][0] = 2;
this.shape[0][1][1] = 1;
this.shape[0][2][0] = 1;
this.shape[0][2][1] = 2;
this.shape[0][3][0] = 2;
this.shape[0][3][1] = 2;
this.lngth = 1;
}
if (muoto == "tee") {
this.shape[0][0][0] = 2;
this.shape[0][0][1] = 1;
this.shape[0][1][0] = 1;
this.shape[0][1][1] = 2;
this.shape[0][2][0] = 2;
this.shape[0][2][1] = 2;
this.shape[0][3][0] = 3;
this.shape[0][3][1] = 2;

this.shape[1][0][0] = 3;
this.shape[1][0][1] = 2;
this.shape[1][1][0] = 2;
this.shape[1][1][1] = 1;
this.shape[1][2][0] = 2;
this.shape[1][2][1] = 2;
this.shape[1][3][0] = 2;
this.shape[1][3][1] = 3;

this.shape[2][0][0] = 2;
this.shape[2][0][1] = 3;
this.shape[2][1][0] = 3;
this.shape[2][1][1] = 2;
this.shape[2][2][0] = 2;
this.shape[2][2][1] = 2;
this.shape[2][3][0] = 1;
this.shape[2][3][1] = 2;

this.shape[3][0][0] = 1;
this.shape[3][0][1] = 2;
this.shape[3][1][0] = 2;
this.shape[3][1][1] = 3;
this.shape[3][2][0] = 2;
this.shape[3][2][1] = 2;
this.shape[3][3][0] = 2;
this.shape[3][3][1] = 1;
this.lngth = 4;
}
if (muoto == "l1") {
this.shape[0][0][0] = 1;
this.shape[0][0][1] = 1;
this.shape[0][1][0] = 1;
this.shape[0][1][1] = 2;
this.shape[0][2][0] = 1;
this.shape[0][2][1] = 3;
this.shape[0][3][0] = 2;
this.shape[0][3][1] = 3;

this.shape[1][0][0] = 3;
this.shape[1][0][1] = 1;
this.shape[1][1][0] = 2;
this.shape[1][1][1] = 1;
this.shape[1][2][0] = 1;
this.shape[1][2][1] = 1;
this.shape[1][3][0] = 1;
this.shape[1][3][1] = 2;

this.shape[2][0][0] = 2;
this.shape[2][0][1] = 3;
this.shape[2][1][0] = 2;
this.shape[2][1][1] = 2;
this.shape[2][2][0] = 2;
this.shape[2][2][1] = 1;
this.shape[2][3][0] = 1;
this.shape[2][3][1] = 1;

this.shape[3][0][0] = 1;
this.shape[3][0][1] = 2;
this.shape[3][1][0] = 2;
this.shape[3][1][1] = 2;
this.shape[3][2][0] = 3;
this.shape[3][2][1] = 2;
this.shape[3][3][0] = 3;
this.shape[3][3][1] = 1;
this.lngth = 4;
}
if (muoto == "l2") {
this.shape[0][0][0] = 1;
this.shape[0][0][1] = 3;
this.shape[0][1][0] = 2;
this.shape[0][1][1] = 3;
this.shape[0][2][0] = 2;
this.shape[0][2][1] = 2;
this.shape[0][3][0] = 2;
this.shape[0][3][1] = 1;

this.shape[1][0][0] = 1;
this.shape[1][0][1] = 1;
this.shape[1][1][0] = 1;
this.shape[1][1][1] = 2;
this.shape[1][2][0] = 2;
this.shape[1][2][1] = 2;
this.shape[1][3][0] = 3;
this.shape[1][3][1] = 2;

this.shape[2][0][0] = 2;
this.shape[2][0][1] = 1;
this.shape[2][1][0] = 1;
this.shape[2][1][1] = 1;
this.shape[2][2][0] = 1;
this.shape[2][2][1] = 2;
this.shape[2][3][0] = 1;
this.shape[2][3][1] = 3;

this.shape[3][0][0] = 3;
this.shape[3][0][1] = 2;
this.shape[3][1][0] = 3;
this.shape[3][1][1] = 1;
this.shape[3][2][0] = 2;
this.shape[3][2][1] = 1;
this.shape[3][3][0] = 1;
this.shape[3][3][1] = 1;
this.lngth = 4;
}
this.dir = 0;
}

pala.prototype.rotcw = function () {
if (++this.dir == this.lngth) {
this.dir = 0;}dir = this.dir;
for (l=0; l<4; l++) {
_root["nelio"+l]._x = 50+this.X*20+this.shape[dir][l][0]*20;
_root["nelio"+l]._y = 50+this.Y*20+this.shape[dir][l][1]*20;
}
};

pala.prototype.rotccw = function () {
if (--this.dir<0) {
this.dir = this.lngth-1;
}
dir = this.dir;
for (l=0; l<4; l++) {
_root["nelio"+l]._x = 50+this.X*20+this.shape[dir][l][0]*20;
_root["nelio"+l]._y = 50+this.Y*20+this.shape[dir][l][1]*20;
}
};

pala.prototype.refresh = function () {
dir = this.dir;
for (l=0; l<4; l++) {
_root["nelio"+l]._x = 50+this.X*20+this.shape[dir][l][0]*20;
_root["nelio"+l]._y = 50+this.Y*20+this.shape[dir][l][1]*20;
}
};


pala.prototype.moveok = function (Xmov, Ymov) {
dir = this.dir;
ok = true;
for (l=0; l<4; l++) {
c=Xmov+this.X+this.shape[dir][l][0];
r=Ymov+this.Y+this.shape[dir][l][1];
if (_parent.area[c][r] == "1") ok = false;

trace(_parent.area[c][r]);

}
return ok;
}; //something wrong with this????

peace = new pala("tee");//init a peace to screen[viiva,tee,s1,s2,l1,l2,nelio]
peace.X = 0;
peace.Y = -1;
dir = 0;
for (l=0; l<4; l++) {
_root.attachMovie("box", ["nelio"+l], l+2000); //box is 6 frame mc, 20x20 square with diff. colors each frame
_root["nelio"+l].gotoAndStop(l+1);
_root["nelio"+l]._x = 50+peace.X*20+peace.shape[dir][l][0]*20;
_root["nelio"+l]._y = 50+peace.Y*20+peace.shape[dir][l][1]*20;
}
trace (viiva.lngth);

and a control mc on stage has following code:

onClipEvent(enterFrame) {
if(Key.isDown(Key.UP) ) _root.peace.rotcw();
if(Key.isDown(Key.DOWN) ) _root.peace.rotccw();
c++;
if(c==5){
c=0;
//trace(_root.peace.Y);
if(_root.peace.moveok(0,1)){
_root.peace.Y++;
_root.peace.refresh();
}
}
}

i know ill have to abstract the code more (get rid of direct references[_root] etc. ) im going to do it after i get the damn thing to work!! (movement) the worst thing is, i know flash isnt fool proof! awhile ago i made a cup game, u know under one cup is a pea or something, shuffle them fast, and u have follow the "pea"... a STRANGE bug forced me to use a "dummy" cup at one point!! After adding it (it had no reference, code, only a instace name(witch wasnt referenced) ) and the damn thing worked!! ,but help me out with this one, and ill give it to u as a gift!!! (or if u ask me nicely, lol)

Phef, in case u missed it, im tired, hope i made SOME sense, lol!

PS. all u have to do is copy/paste the code; make 1 mc 6 frames 20x20 square, diff. colors each frame, and export it in library;

S@m

I Am Having Trouble Converting Some Code In A Function
Hi fellow flashers,
I am having trouble turning some code into a function. Currently I have the below code working beautifully from this clip:
_root.quotes.container
the code is attached to the clip and looks like this:

Code:
onClipEvent(enterFrame)
{
frame=_parent._currentframe;
trace("frame number is "+frame); // temporary for debugging
trace(_root.nextQuote); // temporary for debugging
_root.textFilePath=fullpath; // temporary for debugging
_root.quoteXpos=this._x; // temporary for debugging
_root.charsnumber=this.quote.length; // temporary for debugging

if(_root.nextQuote == false)
{
if(this._x<=0 && flag<>1)
{
this._x=_root.quoteStartPosition;
fullPath = _root.partialQuotePath+_root.currentPiece+frame+".txt";
loadVariables (fullpath, _root.quotes.container);
this._alpha=0;
flag=1; // set dynamic animation flag
}
if(this._x>0)
{
this._x=this._x-_root.quoteMoveSpeed;
}
if(this._alpha<100)
{
this._alpha=this._alpha+_root.quoteFadeSpeed;
}
}
else if(_root.nextQuote == true)
{
flag=0; // reset dynamic animation flag
if(this._x<=0)
{
this._x=this._x-_root.quoteMoveSpeed;
}
if(this._alpha>0)
{
this._alpha=this._alpha-_root.quoteFadeSpeed;
}
else if(this._alpha<=0)
{
_root.quoteTimer.gotoAndPlay(1); // start up the timer clip again
_parent.gotoAndStop(_parent._currentframe+1)
}
}
else{trace("something funky must be going on");}
}
I tried moving the code to the first frame of the main timeline and turning it into a function called doQuotes()
and then calling the function from the _root.quotes.container clip like this:

Code:
onClipEvent(enterFrame)
{
_root.doQuotes();
}
That didnt work so I figured I had to refrence the clip with an absoulute path like
Code:
_root.quotes.container._alpha
instead of calling it like I was:

Code:
this._alpha

That didn't work either. I have a feeling this problem something really simple. Does anyone know what I am doing wrong?
ThanksX200,000
~dev

Tab Trouble - Trying To Use V5 Code With V6 Symbol Naming
Hi there,

I'm exporting a movie as v6, but I'm trying to get it to use this v5 code, where the named symbol items are button choices that I want the user to tab through.

I know that there is a (sort of) conflict there, but is it enough to stop this code from working? Becasue it's not, and apart form that, I don't know why.

BTW, I've tried the v6 syntax tabbing, and it seems to be having trouble as well - but I think that's a whole different matter.

Here's the code I'm trying to use:

code:
on (keyPress "<Tab>") {
if (selection.getfocus() == "_level0.conheca") {
selection.setfocus("_level0.lojas");
} else if (selection.getfocus() == "_level0.lojas") {
selection.setfocus("_level0.restaurantes");
} else if (selection.getfocus() == "_level0.restaurantes") {
selection.setfocus("_level0.cinema");
} else if (selection.getfocus() == "_level0.cinema") {
selection.setfocus("_level0.academia");
} else if (selection.getfocus() == "_level0.academia") {
selection.setfocus("_level0.escritorios");
} else if (selection.getfocus() == "_level0.escritorios") {
selection.setfocus("_level0.outros");
} else if (selection.getfocus() == "_level0.outros") {
selection.setfocus("_level0.localizacao");
} else if (selection.getfocus() == "_level0.localizacao") {
selection.setfocus("_level0.fale");
} else if (selection.getfocus() == "_level0.fale") {
selection.setfocus("_level0.home");
} else if (selection.getfocus() == "_level0.home") {
selection.setfocus("_level0.conheca");
}
}

Trouble With Mailto In HTML Code.
I have the following code:code: contactEmail.htmlText = "<a href='mailto:" + this.contactEmail +"' target='_blank'>" + this.contactEmail + "</a>";I can't see anything wrong with it. It should launch the default email program as it would do if it were a link on a webpage.

I remember reasing something about Flash having trouble doing this??
Not sure though.

My use is for a CD ROM and my Flash file won't be on a website - does this make any difference?

Thanks.


OM

Having Trouble With Simple Guestbook Code
Hi guys, I've been having trouble with a php driven guestbook and I think I've traced the origin of the problem. I went and made a little text box called 'Guestbook' and theres the following code in frame one of the movie:


Code:
NumLow = 0;
NumHigh = 10;
loadVariablesNum("GuestBook.php?NumLow="+NumLow+"&NumHigh="+NumHigh+"&R="+random(999), 0);


I also have a PHP file in the directory, when I export this all works fine. The only problem is that my website is actually loading in the guestbook through an attachmovie method. How do I alter the code above to make it work?

The heriarchy so far is _root.stage.holdery*

with HOLDERY being the movie clip containing the guestbook.

Thanks for any help!

Trouble Modifying Existing Code
Hi,

I am so new to ActionScript that I'm not even sure how to describe my problem. I am creating a mini slide show for our website that's very similar to the one created in the tutorial, "Building Your First Flash Application" in the "Exploring Studio 8" book that came with my software. The example in the tutorial was for four images and text to rotate using a Next button. I created a new slide show using 8 images and modified the code to reflect that; however, every time you cycle through the slides after the first time, the first picture zooms past and that screen is blank (or at least the picture is not there--the text appears as it should). I'm thinking that there is a variable that should be set to reflect that there are 8 slides, but I can't for the life of me figure out what it is. Should I copy the script here?

Thanks!

Jean

Trouble With Code/links Not Working
Hi--

I tried to post this before, but no one replied, so I'm posting it again...

I am loading external swfs into an empty mc on the main stage. The links are on the "nav" page loaded in "empty_mc01". The home page comes in automatically in "empty_mc02". Those work fine. When you select a link on the "nav" page it plays an outro for the homepage, the link is held, and at the end of the outro it is coded to load whatever link was selected. Those work fine, except it does not load the selected link. I've checked and re-checked that all the file locations are included. This only happens when i publish, by the way. When i test in Flash, it works fine. It's probably some small thing i overlooked, but any insight would be very appreciated.

Thanks
I can post the code or you can check my last post which is:
hierarchy of layers??

Trouble With Code/Links Still Not Working
Hi--

I thought that it was working but I was wrong. I am loading external swfs into empty mcs on the main stage. When you select a link, the current page goes through an outro using:

ActionScript Code:
on(press){
      _root.selectedLink = "link01";
      _root.empty_mc01(gotoAndPlay 60);
}

When the outro is complete the code is as follows:

ActionScript Code:
if (._root.selectedLink == "link01"){
      _root.empty_mc01.loadMovie("rootfolder/folder01/folder02/movie.swf");
}

The outro works fine, except it does not load the movie. I have tried every possible variation. Typing the full address in the selectedLink tag and the loadMovie tag and moving all the folders to the same folder. When I tested it Flash, it worked fine, Dreamweaver and Frontpage, it worked okay(the page loaded), except the top links worked once and then stopped working. It's only when i publish. I've checked the books I have, except I don't know exactly what I'm looking for.

Any help would be appreciated.

Thanks

Trouble With Code For Re-scaling A Layer
I know that this is an AS3 forum, but I couldn't find a JSFL forum, and this is the closest.

I need to re-scale half of an entire layer because the client wants the objects a little bigger.

Below is what I wrote to achieve that, but some frames are twice the size they should be. They seem to occur at the end of a series of keyframes, but not always.

//simplifying variables
var doc = fl.getDocumentDOM();
var tmLn = doc.getTimeline();
var curLayer = tmLn.currentLayer;
var curFrame = tmLn.currentFrame;
var frmArray = tmLn.layers[curLayer].frames;
var n = frmArray.length - 40;

//lock all the other layers
tmLn.setLayerProperty('locked', true, 'others');

//code to run through the frames of the current layer and rescale
for (i = curFrame; i < n; i++) {
if (i==frmArray.startFrame) { //check to see if the frame is a keyframe. needed? correct?
doc.selectAll();
doc.setTransformationPoint({x:369, y:269.9}); //scale from the same point.
doc.scaleSelection(1.61, 1.61); //scale
TmLn.currentFrame = i + 1; //next frame
}
}

Thanks for helping.

Trouble With Mailto In HTML Code.
I have the following code:
ActionScript Code:
contactEmail.htmlText = "<a href='mailto:" + this.contactEmail +"' target='_blank'>" + this.contactEmail + "</a>";
I can't see anything wrong with it. It should launch the default email program as it would do if it were a link on a webpage.

I remember reasing something about Flash having trouble doing this??
Not sure though.

My use is for a CD ROM and my Flash file won't be on a website - does this make any difference?

Thanks.


OM

Second Set Of Eyes Trouble With A Simple Code
Hi,

Can some one l;ook this code over and see if there is a mistake that will not allow for the combobox to have the text in it be sized to 10 point. I have done 2 other just like this and they work.

//Tabbing through fields
name_txt.tabIndex = 1;
phone_txt.tabIndex = 2;
time_txt.tabIndex = 3;
zip_txt.tabIndex = 4;
submit_bt.tabIndex = 5;
focusManager.defaultPushButton = submit_bt;

//Style for the Input Fields and Combo Box
zzFStyleFormat = new FStyleFormat();
zzFStyleFormat.background = 0x003333;
zzFStyleFormat.selection = 0x006666;
zzFStyleFormat.textColor = 0xCCCCCC;
zzFStyleFormat.textSize = 10;
zzFStyleFormat.arrow = 0xFFFFFF;
zzFStyleFormat.face = 0x009999;
zzFStyleFormat.scrollTrack = 0x000000;
zzFStyleFormat.shadow = 0x006666;
zzFStyleFormat.darkshadow = 0x003333;
zzFStyleFormat.highlight = 0x00CCCC;
zzFStyleFormat.highlight3D = 0x006666;
//Apply style to Input Fields and Combo Box
zzFStyleFormat.addListener(time_txt);
zzFStyleFormat.addListener(name_txt);
zzFStyleFormat.addListener(phone_txt);
zzFStyleFormat.addListener(zip_txt);

//Combo Box
// populate the combobox
zzmyLabels = new Array ("Select","Morning","Afternoon","Evening");
for (zz=0;zz<zzmyLabels.length;zz++) {
time_txt.addItem (zzmyLabels[zz]) ;
}
// function to display the selection
function zzcomboDisplay (component) {
time_txt = component.getSelectedItem().label ;
}
// We assign the function to the combobox
time_txt.setChangeHandler ("zzcomboDisplay") ;

//input text field lables
name_txt.text = "Enter your name";
phone_txt.text = "Phone number";
zip_txt.text = "Zip";

//clear input text field onFocus, if something typed in don't clear input text field, if nothing typed in rename input text field onFocusKill
name_txt.onSetFocus = function() {
if (name_txt.text == "Enter your name") {
name_txt.text = "";
}
};
name_txt.onKillFocus = function() {
if (name_txt.text == "") {
name_txt.text = "Enter your name";
}
};
phone_txt.onSetFocus = function() {
if (phone_txt.text == "Phone number") {
phone_txt.text = "";
}
};
phone_txt.onKillFocus = function() {
if (phone_txt.text == "") {
phone_txt.text = "Phone number";
}
};
zip_txt.onSetFocus = function() {
if (zip_txt.text == "Zip") {
zip_txt.text = "";
}
};
zip_txt.onKillFocus = function() {
if (zip_txt.text == "") {
zip_txt.text = "Zip";
}
};



//Submits data from fields in form
submit_bt.onRelease = function() {
subject = "Cover What's Yours";
recipient = "";
redirect = "";
loadVariables("ccMailer.jsp", "", "POST");
gotoAndStop("thanks");
};

stop();

Trouble With Code Generated Tile
Trying to make a simple tile with the drawing API, but it is doing some weird stuff and looks bad, any ideas?

ActionScript Code:
_global.tileBG = function () {    createEmptyMovieClip("tile", 400)    with(tile){        lineStyle(1, 0xCC0066, 100, false, "none", "none", "miter", 1);        moveTo(1, 1);        lineTo(1, 1);        moveTo(6,1)        lineTo(1, 6);        moveTo(2,7)        lineTo(7, 2);        moveTo(7,7)        lineTo(7, 7);        lineStyle(1, 0x660033, 100, false, "none", "none", "miter", 1);        moveTo(2, 1);        lineTo(1, 2);        moveTo(5,1)        lineTo(1, 5);        moveTo(3,7)        lineTo(7, 3);        moveTo(6,7)        lineTo(7, 6);        lineStyle(1, 0xFF0099, 100, false, "none", "none", "miter", 1);        moveTo(7, 1);        lineTo(1, 7);        lineStyle(1, 0x000000, 100, false, "none", "none", "miter", 1);        moveTo(3, 1);        lineTo(1, 3);        moveTo(4,1)        lineTo(1, 4);        moveTo(4,7)        lineTo(7, 4);        moveTo(5,7)        lineTo(7, 5);    }    x_max = Math.round(Stage.width/5);    y_max = Math.round(Stage.height/5);    var i:Number = 0;    for (x=0; x<=x_max; x++) {        for (y=0; y<=y_max; y++) {            bg = tile.duplicateMovieClip("tile"+x+y, i)            bg._x = 6*x;            bg._y = 6*y;            i++;        }    }};tileBG();


http://www.JoshuaJonah.com/tile.swf
http://www.JoshuaJonah.com/tile.fla

Trouble Pushing Some Code Into An Array
Hi,

I’m trying to create an xml-based slideshow in flash and am having trouble pushing some code into an array.

The following is an extract showing how my xml file is structured:


Code:
<slideshow>
<garment url="formal01.jpg">
<title>Classic Design Formal Suit</title>
<style>5993</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black</colours>
<sizes>87cm to 152cm</sizes>
</garment>

<garment url="formal02.jpg">
<title>Another title goes here</title>
<style>5994</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black, White</colours>
<sizes>87cm to 137cm</sizes>
</garment>

</slideshow>
The urls are stored as attributes within the garment tag and the rest of the caption is stored with separate tags nested within the garment tags:

In my .fla file I have the following code:


Code:
var ssx:XML = new XML();
ssx.ignoreWhite = true;

var currentIndex:Number = 0;
var captions:Array = new Array();
var urls:Array = new Array();

ssx.onLoad = function(success) {
if (success) {
var ss:Array = ssx.firstChild.childNodes; //stores pictures as separate elements
for (i=0;i<ss.length;i++) {
urls.push("images/" + ss[i].attributes.url);
captions.push(ss[i].childNodes[0].firstChild.nodeValue);
}
frame_mc.images_mc.loadMovie(urls[currentIndex]);
captions_txt.htmlText = captions[currentIndex];
}
else
{
trace("XML file failed to load.");
}
}

ssx.load("formalwear.xml");
With the for loop I'm trying cycle through the ss array, pull out the url attributes as well as the rest of the caption, and assign the values to the arrays called "captions" and "urls".

Since my url was stored as an attribute, the following line of code works to push the url into the urls array:

urls.push("images/" + ss[i].attributes.url);

...however, the captions line entered as follows doesn’t push the captions into the captions array:

captions.push(ss[i].childNodes[0].firstChild.nodeValue);

It only outputs the information contained in the <title> tag, ie. Classic Design Formal Suit

Since the caption isn't stored as an attribute, I assume I need the following code to be pushed into the captions array, but I don’t know how to do it.


Code:
var caption:String = ""
caption += "<b>"
caption += ss[0].childNodes[0].firstChild.nodeValue;
caption += "

</b>";
caption += "<b>Style Number</b>
"
caption += ss[0].childNodes[1].firstChild.nodeValue;
caption += "

";
caption += "<b>Description</b>
"
caption += ss[0].childNodes[2].firstChild.nodeValue;
caption += "

";
caption += "<b>Price</b>
"
caption += ss[0].childNodes[3].firstChild.nodeValue;
caption += "

";
caption += "<b>Colours</b>
"
caption += ss[0].childNodes[4].firstChild.nodeValue;
caption += "

";
caption += "<b>Sizes</b>
"
caption += ss[0].childNodes[5].firstChild.nodeValue;
Can someone tell me how I can fix the code?

Appreciate any help offered.

Trouble Pushing Code Into An Array
Hi,

I’m trying to create an xml-based slideshow in flash and am having trouble pushing some code into an array.

The following is an extract showing how my xml file is structured:

CODE<slideshow>
<garment url="formal01.jpg">
<title>Classic Design Formal Suit</title>
<style>5993</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black</colours>
<sizes>87cm to 152cm</sizes>
</garment>

<garment url="formal02.jpg">
<title>Another title goes here</title>
<style>5994</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black, White</colours>
<sizes>87cm to 137cm</sizes>
</garment>

</slideshow>

Trouble With Mailto In HTML Code.
I have the following code:
ActionScript Code:
contactEmail.htmlText = "<a href='mailto:" + this.contactEmail +"' target='_blank'>" + this.contactEmail + "</a>";

I can't see anything wrong with it. It should launch the default email program as it would do if it were a link on a webpage.

I remember reasing something about Flash having trouble doing this??
Not sure though.

My use is for a CD ROM and my Flash file won't be on a website - does this make any difference?

Thanks.


OM

Font Maker?
Anyone know a good FREE fontmaker so that i dont have to keep dragging my own things into the stage? it would Look better too thanks

Font Maker?
Anyone know a good FREE fontmaker so that i dont have to keep dragging my own things into the stage? it would Look better too thanks

Jpeg To Swf Maker
There used to be an application helper that would take a folder of jpegs or png's and convert them into .swf files. Could someone please let me know what that program was called or if it still exists.
Thank you....

Trouble In Load Txt After Wroten By Asp(and I Post My Code)
hey,someone help
i write some asp code:writeline("c="&myvariable),then the text wrote
c=variable,but it added a ENTER end of it,so,when i use loadvariable(mytext,0) in my flash to load the text,it did not work,
oh,how can i do with the unwanted ENTER,let flash load my text?
and i changed the code:writeline("c="&myvariable) to writeline("c="&replace(application("countnum"),vbc rlf,"")) ,but i am failing in it,it always added a ENTER at the end,why?

this is my txt text:
c=28

this is my homepage code:
<HTML>
<HEAD>
<TITLE>counter3</TITLE>
<%
if isempty(session("conn")) then
application.lock
set counterfile=server.createobject("scripting.filesys temobject")
set temp=counterfile.opentextfile(server.mappath("coun t.txt"),1,true,false)
application("countnum")=temp.readline
application("countnum")=mid(application("countnum" ),3)
application("countnum")=application("countnum")+1
temp.close
%>
</HEAD>
<BODY bgcolor="">
visiters£º<%=application("countnum")%>
<%
set temp=counterfile.createtextfile(server.mappath("co unt.txt"),true,false)
temp.writeline("c="&replace(application("countnum" ),vbcrlf,""))
temp.close
application.unlock
else
response.write "visiters£º"&application("countnum")
end if
session("conn")=true
%>
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550 HEIGHT=400 align="top">
<PARAM NAME=movie VALUE="counter3.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=>
<EMBED src="counter3.swf>" quality=high bgcolor= WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" align="top" width="550"></EMBED>
</OBJECT>
</BODY>

</HTML>

this is my flash code:
loadVariablesNum ("count.txt", 0);
num = c;
j = num.length;
s = Number(num.charAt(j-2));
g = Number(num.charAt(j-1));
with (siwei) {
gotoAndStop(s+1);
}
with (gewei) {
gotoAndStop(g+1);
}

Trouble Puting Working Code Into A Function
In my flash file i have a palette im using to fill shapes with a colour.
The code works when it's inside a button but not when i put it in my function.
I think is is a simple code formating problem, can anyone help spot the error please?

Thanks very much for your time, ive made the attached flash file as easy to use as I can.

John

my function code looks like..

code:

var testmc:MovieClip;
var fill:Function;

function Fill (testbtn:Button):Void{
lockroot="true"
iColor = new Color(this);
iColor.setRGB(_lockroot.fillColor);
delete iColor;
}

testbtn.onPress = function(Fill):Void{};

[ActionScript 2.0/MX] Trouble With Flash 5 Code Compatibilty.
Hello people, I read a tutorial here ages back (I can't find it now) Anyway, it was about something different but I got this code from it and it works only when the SWF is exported in Flash 5 version.


PHP Code:



onClipEvent (enterFrame) {
    new_dest = _xmouse+_x;
    pos = _x;
    vel = ((dest-.1*pos)/9+vel*0.9);
    _x += vel;
    dest = new_dest-_x;





Where does the compatibilty problem lay? and How can we make it work on Flash MX or MX 2004?

Thanks in advance.

[ActionScript 2.0/MX] Trouble With Flash 5 Code Compatibilty.
Hello people, I read a tutorial here ages back (I can't find it now) Anyway, it was about something different but I got this code from it and it works only when the SWF is exported in Flash 5 version.


PHP Code:



onClipEvent (enterFrame) {
    new_dest = _xmouse+_x;
    pos = _x;
    vel = ((dest-.1*pos)/9+vel*0.9);
    _x += vel;
    dest = new_dest-_x;





Where does the compatibilty problem lay? and How can we make it work on Flash MX or MX 2004?

Thanks in advance.

I Need A Voice-maker-program
Hi all!

I need a Voice maker program, just like that one in Windows XP Pro. edition. Where can I find it???????????

Thanx

Screen Saver Maker
hi there

I was wondering if there is a posibility to create a screen saver in flash, but with dynamic content.

with a .txt file for exemple in loadvariable.

it's kind of urgent if someone knows

thanks!

Flash Saver Maker
has anyone ever used flash saver maker to make an exe for self installing a screensaver? I have made a few and a friend recently put it on his machine and got an interesting message from his firewall software:
127.0.0.1 Port 3060

127.0.0.1 is a loopback address, not a valid Internet IP address

A loopback address is a special IP address that a computer uses to refer to itself. Many Windows programs send information to the loopback address before sending information out to the network or to the Internet. Some programs may use the loopback address even when they are not about to send information to the network or the Internet, due to some peculiarities in the way Windows handles TCP/IP. Any address that begins with "127" is a loopback address. The most commonly used loopback address is 127.0.0.1. This address cannot be used as the IP address of a computer on the Internet. It only has meaning on the computer that generated it. Therefore, if this is an inbound alert, the source address was probably forged in order to hide the identity of the sender. ======

is the saver maker installing some spyware or is this a legitimate setup function?

Mac Icon Maker Software
Hi

Does anyone know of a decent mac icon maker software? Got to isert a section of icons downloads on a flash site.

Note: Icon needs to sit on invisible background.

Thanks
Jess

Free Font Maker
does anyone know of a free font maker, perhaps for flash as well?

and, is a pixel fotn much better than ttfs?

Xara Menu Maker
somebody familier with this software?

Jbum's Kaleidoscope Maker
I'm working on a new Flash movie called "Make your own kaleidoscope". It's still in progress, but I thought some of you might find this fun to play with in its current half-baked state.

Make your own Kaleidoscope

For the curious, the code is very similar to the kaleidoscope code in my Bestiary examples, but I've added a little interactivity to it.

- Jim

Textfield Table Maker
I have a client who wanted me to post a bunch of tables (sports scoring) on his site. Each table had a different number of columns and rows depending on the info. I got tired of hard coding all the tables by hand so I made this little table maker and I thought I would share it with the class. Just let me know if you use it. I am posting it here because I do have a tech question, at the very bottom of the script there is a buttonMaker function where you can pass button name, function, X and Y as parameters. In this instance can you pass parameters in the function reference? I could not figure that out so I made a sloppy work around but would love to know a better way.


Code:
/////////////////////////////////////////
/////////// CREATE TABLE ////////////////
/////////////////////////////////////////
var tableFormat:TextFormat = new TextFormat();
var tableFormat2:TextFormat = new TextFormat();
tableFormat.font = "_sans";
tableFormat.size = 11;
tableFormat.align = "center";
tableFormat2.bold = true;
tableFormat2.font = "_sans";
tableFormat2.align = "center";
//
this.createTextField("columns_txt", 1, 5, 10, 50, 20);
columns_txt.type = "input";
columns_txt.border = true;
columns_txt.background = true;
columns_txt.text = "3";
//
columns_txt.setTextFormat(tableFormat);
//
columns_txt.onSetFocus = function() {
columns_txt.text = "";
};
columns_txt.onChanged = function() {
columns_txt.setTextFormat(tableFormat);
};
//
space = 5;
this.createEmptyMovieClip("tbaleMakerHolder_mc", _root.getNextHighestDepth());
makeHeaders = function () {
columns_txt.setTextFormat(tableFormat);
_root.createTextField("rowNum_txt", _root.getNextHighestDepth(), space, 40, 50, 20);
_root.rowNum_txt.type = "input";
_root.rowNum_txt.background = true;
_root.rowNum_txt.border = true;
_root.rowNum_txt.text = "5";
rowNum_txt.setTextFormat(tableFormat);
c = Number(columns_txt.text);
function doThis() {
setColumnFunction(c, _root.rowNum_txt);
}
if (c != NaN) {
for (i = 0; i < c; i++) {
_root.createTextField("columnHeader" + i, _root.getNextHighestDepth(), (100 * i) + space, space, 90, 20);
_Hdr = _root["columnHeader" + i];
_Hdr.type = "input";
_Hdr.border = true;
_Hdr.background = true;
_Hdr.html = true;
_Hdr.htmlText = "true";
_Hdr.text = "Clmn " + Number(i + 1) + " Hdr";
_Hdr.setTextFormat(tableFormat2);
setHandlers(_Hdr, tableFormat2);
_root.header_array.push(_Hdr.text);
}
//after column titles have displayed:
_root.columns_txt.removeTextField();
}
makeButton("Add Number of Rows", doThis, 5, 65);
};
//
function setColumnFunction(_c, _txt) {
_txt.onSetFocus = function() {
_txt.text = "";
};
//_txt.onChanged = function() {
r = Number(_txt.text);
_r = 0;
__c = 0;
totalRC = r * _c;
for (z = 0; z < totalRC; z++) {
_root.createTextField("field_" + __c + "_" + _r, _root.getNextHighestDepth(), (100 * _r) + space, (30 * __c) + (space * 7), 90, 20);
_T = _root["field_" + __c + "_" + _r];
_T.type = "input";
_T.border = true;
_T.background = true;
_T.html = true;
_T.htmlText = "true";
_T.text = "R " + Number(__c + 1) + " : C " + Number(_r + 1);
_T.setTextFormat(tableFormat);
setHandlers(_T, tableFormat);
__c++;
if (__c > r - 1) {
__c = 0;
_r++;
}
currentX = _T._x;
currentY = _T._y;
}
//after all is done:
_txt.removeTextField();
makeButton("Make A Nice Table", makeTable, 5, currentY + 30);
//};
}
//
function setHandlers(t, f) {
t.onSetFocus = function() {
t.text = "";
//trace(this);
};
t.onChanged = function() {
t.setTextFormat(f);
};
t.onKillFocus = function() {
};
}
//
var header_array:Array = new Array();
//
//
//
//
//
//
//
//
/////////////////////////////////////////
/////////// POST TABLE //////////////////
/////////////////////////////////////////
//Output
columnSpace = 100;
function makeTable() {
//make hearders
traceOutput();
//function makeOutPut() {
var tableFormat:TextFormat = new TextFormat();
_root.createTextField("table_txt", 1, 20, 350, 1100, 600);
table_txt.wordWrap = true;
table_txt.multiline = true;
table_txt.html = true;
tableFormat.font = "_sans";
//
rowHeaders = "";
for (ttl = 0; ttl < c; ttl++) {
thisHeader = _root["columnHeader" + ttl];
rowHeaders += "<b>" + thisHeader.text + " </b>";
}
rowHeaders += "";
var _rowHeaders = rowHeaders;
//make rows
for (rowNum = 0; rowNum < r; rowNum++) {
var thisRow = "";
for (col = 0; col < c; col++) {
thisField = _root["field_" + rowNum + "_" + col];
//trace(thisField.text);
thisRow += thisField.text + " ";
}
if (rows_init != true) {
rows_init = true;
rows = thisRow + "" + newline;
} else {
rows += thisRow + "" + newline;
}
}
var _rows = rows;
//make column spacing
cSpace = "<textformat tabstops='[";
for (cS = 0; cS < c; cS++) {
if (cS < c - 1) {
cSpace += (Number((cS + 1) * columnSpace)) + ",";
} else {
cSpace += (Number((cS + 1) * columnSpace));
}
}
cSpace += "]'>";
_cSpace = cSpace;
//
table_txt.htmlText += _cSpace;
table_txt.htmlText += _rowHeaders;
table_txt.htmlText += _rows;
table_txt.htmlText += "</textformat>";
table_txt.setTextFormat(tableFormat);
}
//
function traceOutput() {
//c comes from set tables as
rowHeaders = """;
for (ttl = 0; ttl < c; ttl++) {
thisHeader = _root["columnHeader" + ttl];
rowHeaders += "<b>" + thisHeader.text + " </b>";
}
rowHeaders += """;
ttl_init = false;
for (rowNum = 0; rowNum < r; rowNum++) {
var thisRow = "";
for (col = 0; col < c; col++) {
thisField = _root["field_" + rowNum + "_" + col];
//trace(thisField.text);
thisRow += thisField.text + "\" + "t";
}
if (rows_init != true) {
rows_init = true;
rows = "table_txt.htmlText +="" + thisRow + "";" + newline;
} else {
rows += "table_txt.htmlText +="" + thisRow + "";" + newline;
}
}
rows_init = false;
cSpace = "table_txt.htmlText = "<textformat tabstops='[";
for (cS = 0; cS < c; cS++) {
if (cS < c - 1) {
cSpace += (Number((cS + 1) * columnSpace)) + ",";
} else {
cSpace += (Number((cS + 1) * columnSpace));
}
}
cSpace += "]'>";";
outPut = "var tableFormat:TextFormat = new TextFormat();" + newline;
outPut += "this.createTextField("table_txt", 1, 0, 0, 800, 600);" + newline;
outPut += "table_txt.wordWrap = true;" + newline;
outPut += "table_txt.multiline = true;" + newline;
outPut += "table_txt.html = true;" + newline;
outPut += "tableFormat.font = "_sans";" + newline;
outPut += cSpace + newline;
outPut += "table_txt.htmlText +=" + rowHeaders + ";" + newline;
outPut += rows;
outPut += "table_txt.htmlText += "</textformat>";" + newline;
outPut += "table_txt.setTextFormat(tableFormat);";
trace(outPut);
}
//
function makeButton(_nm, _fncn, X, Y) {
removeMovieClip(_root.button);
_root.createEmptyMovieClip("button", _root.getNextHighestDepth());
var btnTxt_frmt:TextFormat = new TextFormat();
btnTxt_frmt.font = "_sans";
btnTxt_frmt.size = 11;
btnTxt_frmt.bold = true;
btnTxt_frmt.align = "left";
button.createTextField("button_txt", 1, 5, 5, 1000, 25);
button.button_txt.text = _nm;
tX = button.button_txt.textWidth + 30;
button.button_txt.setTextFormat(btnTxt_frmt);
button.beginFill(0x0000ff, 30);
button.lineStyle(.5, 0xff0000, 100);
button.moveTo(0, 0);
button.lineTo(tX, 0);
button.lineTo(tX, 25);
button.lineTo(0, 25);
button.lineTo(0, 0);
button.endFill();
button._x = X;
button._y = Y;
button.onPress = function() {
_fncn();
};
}
makeButton("Add Number of Columns", makeHeaders, 5, 35);
When you test it in flash authoring tool you enter the number of columns you want then the number of rows. Then you change the column headers to be what you want and enter the data like you would in excel. Then click "Make a Nice Table". This will give you a table to look at plus it will trace the script needed to reproduce that code anywhere. Just copy the trace into another FLA and you are good as gold. It aint the prettiest thing but it works.

Improvements I would like to make:
I would like to dynamically draw colored regions behind the text to seperate rows to make it easier to read. My problem is that MAC and PC display text a bit differently so I need those colored areas to account for that somehow.
Any ideas

Thanks, hope this is of some use to some one.

Square/Triangle Maker
I want the user to be able to make a square and a triangle (click buttons to switch between the 2 modes, I already have a drawing button) then rub them out. (rub out any piece of the shape without the whole shape disappearing.

Thanks!

[F8] Flash Kit Used To Have A Text FX Maker?
flashkit used ot have a textswf effect maker for free here is it still around?

Making A Rpg Maker Game
Me and a few of my friends are making a game on rpg maker butwe decided we needed cutscenes thats a must but unfortunatly were not all very skilled in flash so if anyone is intrested email me at Maskero@gmail.com ooo and if this is considered spam sorry heh

Grid Maker With Resize
Hi,

I'm working on a flash gallery. The gallery is working fine. But I was wondering if someone can tell me how to resize the pictures.

Flash Music Maker
I'm trying to create something close to: http://www.indabamusic.com/studio/sessions/launch/361

Anyone with more experience can tell me how it's possible to:

- save mixes as mp3 files
- do the volume automation (click on the "A" on each track to activate it)
- make the green sound "oscilloscope"

Advice On Flash Maker
I have downloaded some flash maker software and they are not up to speed.
slideshw maker and sothink swf..

I did go thru the FAQ's here and many sites.

All I want is a script to:
make 2 or images in transition fade in fade out (tween) and add some fade in out fade out text...

strangely, Slideshowmaker had images that fade in fade out but no animated text..
sothink had the fade-in fade-out of text in various formats but not the image fade-in fade-out feature.. who woulda' thought.

I do have Macromedia Flash player 8.

BTW, I found a supposedly great tutorial on Flash 8 for what I wanted then there's a step or button in my flash 8 that does not do what they have. the rectangle button upon clicking and cursos becomes a "+" sign in state area is not true.

So any recommendations on a moderately priced less than $25 easy to use program would help me a lot. or tutorials, NO Video tutorials...though..I can read well.

ohh..and prefer one where upon accessing the site there not a loading feature there for 5 seconds or longer.

Thanks

Xml-based Slideshow - Trouble Pushing Code Into An Array
Hi,

I’m trying to create an xml-based slideshow in flash and am having trouble pushing some code into an array.

The following is an extract showing how my xml file is structured:


Code:
<slideshow>
<garment url="formal01.jpg">
<title>Classic Design Formal Suit</title>
<style>5993</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black</colours>
<sizes>87cm to 152cm</sizes>
</garment>

<garment url="formal02.jpg">
<title>Another title goes here</title>
<style>5994</style>
<description>Olorperat illaor sim dio od dolore velit atie modiatem adio et ipit praesectem erit, vel ipsuscip er sit velit ipisciduis nulla.</description>
<price>$???</price>
<colours>Black, White</colours>
<sizes>87cm to 137cm</sizes>
</garment>

</slideshow>
The urls are stored as attributes within the garment tag and the rest of the caption is stored with separate tags nested within the garment tags:

In my .fla file I have the following code:


Code:
var ssx:XML = new XML();
ssx.ignoreWhite = true;

var currentIndex:Number = 0;
var captions:Array = new Array();
var urls:Array = new Array();

ssx.onLoad = function(success) {
if (success) {
var ss:Array = ssx.firstChild.childNodes; //stores pictures as separate elements
for (i=0;i<ss.length;i++) {
urls.push("images/" + ss[i].attributes.url);
captions.push(ss[i].childNodes[0].firstChild.nodeValue);
}
frame_mc.images_mc.loadMovie(urls[currentIndex]);
captions_txt.htmlText = captions[currentIndex];
}
else
{
trace("XML file failed to load.");
}
}

ssx.load("formalwear.xml");
With the for loop I'm trying cycle through the ss array, pull out the url attributes as well as the rest of the caption, and assign the values to the arrays called "captions" and "urls".

Since my url was stored as an attribute, the following line of code works to push the url into the urls array:

urls.push("images/" + ss[i].attributes.url);

...however, the captions line entered as follows doesn’t push the captions into the captions array:

captions.push(ss[i].childNodes[0].firstChild.nodeValue);

It only outputs the information contained in the <title> tag, ie. Classic Design Formal Suit

Since the caption isn't stored as an attribute, I assume I need the following code to be pushed into the captions array, but I don’t know how to do it.


Code:
var caption:String = ""
caption += "<b>"
caption += ss[0].childNodes[0].firstChild.nodeValue;
caption += "

</b>";
caption += "<b>Style Number</b>
"
caption += ss[0].childNodes[1].firstChild.nodeValue;
caption += "

";
caption += "<b>Description</b>
"
caption += ss[0].childNodes[2].firstChild.nodeValue;
caption += "

";
caption += "<b>Price</b>
"
caption += ss[0].childNodes[3].firstChild.nodeValue;
caption += "

";
caption += "<b>Colours</b>
"
caption += ss[0].childNodes[4].firstChild.nodeValue;
caption += "

";
caption += "<b>Sizes</b>
"
caption += ss[0].childNodes[5].firstChild.nodeValue;
Can someone tell me how I can fix the code?

Appreciate any help offered.

Trouble Customizing Sbeener Photo Gallery Code
Not sure if this problem has been sorted out already in an earlier post if so, please direct me to where it is. Tnx.

Basically my photos wont show up on the final swf, even after i've customized the this.pathToPics and this.pArray codes. The pics are in a subfolder where the swf itself is saved. Directing the this.pathToPics to this subfolder and listing the pics on the this.pArray should do the trick right? Or is there something else? Anything else i need to change in the code? Please help!

Trouble Customizing Sbeener Photo Gallery Code
Not sure if this problem has been sorted out already in an earlier post if so, please direct me to where it is. Tnx.

Basically my photos wont show up on the final swf, even after i've customized the this.pathToPics and this.pArray codes. The pics are in a subfolder where the swf itself is saved. Directing the this.pathToPics to this subfolder and listing the pics on the this.pArray should do the trick right? Or is there something else? Anything else i need to change in the code? Please help!

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