Trying To Understand
ok, i need sme help understanding actionscripting. i am currently doing tutorials to try and learn this stuff. but it seems when i have finished a tutorial, and it works, i do not understand how it works. what does all this code do? what does it all mean? please someone, anyone help me find a book or something that explains the meaning of actionscripting.
thanks,
jczeranna
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-27-2002, 10:06 PM
View Complete Forum Thread with Replies
Sponsored Links:
Don't Understand...help
what does the 96.6 and 96.4 mean?
-------------------------------------------------------
if(myscroll._y<(96.6-myscroll._height+myscroll.top))
myscroll._y=myscroll._y+((96.4-myscroll._height)/40);
View Replies !
View Related
I NEED TO UNDERSTAND....................
Let's say I have 3 dynamic text fields on the stage and their variable names are tester1, tester2, and tester3. Is it possible in a "for loop" to change the number part of the variables with an "i" ? For example:
for (i=1,i<=3,i++)
tester[i] = i
)
Should the dynamic text fields on the stage display the the number of "i" ?
I've tried everyway, but I'm not sure if it's possible or if I just have the syntax wrong.
Please help.
Thanks
View Replies !
View Related
Help Me Understand This
Okay, I found this code below and have put it into my movie successfully (it makes an mc follow the mouse).
onClipEvent (enterFrame) {
mousey = _root._Ymouse;
if (mousey<_y) {
followmouse = _y-mousey;
} else {
followmouse = mousey-_y;
}
moveSpeedx = followmouse/10;
if (mousey<_y) {
_Y = _Y-movespeedx;
} else {
_Y = _Y+movespeedx;
}
}
Anyway, while it's all fine and dandy that it works, what's the point if I don't really get how? Would someone take the time to explain it to me? Also, I need to add to this. How would I confine the MC to the height of the MC it is in?
Thanks. YP
View Replies !
View Related
Trying To Understand...
Hi guys,
I'm trying to understand a specific script in the joined menu.
You may have seen it on FK, but I'm unabled to contact the author, it has a wrong e-mail adress.
Here's my question: is it possible to change the URL for frame target, like "_root go to and play (10)" for example.
In fact, I would like it to work that instead of going to a URL, I would like it to move through my main timeline.
Any idea... thanks a lot in advance to the flash professionnals.
Sébastien Lebel
canada
View Replies !
View Related
I Don't Understand..please Help
i have a m/c which which has 4 butoons in it. the m/c performs an animation when a button is rolled over.
i have placed this m/c inside my stage.
the m/c stays on the stage for the entire length of my scene (100 frames) and at every 20th frame, i have text that appears.
And when a button is pressed, i want the scene to jump to the desired 20th frame. but this does not work.
it only jumps to the frame within the m/c.
i have action script that says on release goto and play scene 40 of the main scene.
what am i doing wrong?
thanks for listenting.
huggs
View Replies !
View Related
Ill Never Understand
Ok so your here, and your reading my little help message, so please if no one has answered, if you know, or you know a better way, let me know please.
I decided to try and put together a flash site, just to see if I could do it. Weel I have been working on it for... oh I dont know 2 to 3 months, just learning flash as I go. Ive used it for quite some time and I do feel very comfortable in flash. I can create unique and swift navigation animations, and what I have so far is very good indeed.
Now that I have the main layout layed down, and a story board of exactly where Im going with it, I need now to start placing the flash together and making it fit in a smooth and clean style, percistantly thoughout the entire site.
This is where Im stuck. To give an EXAMPLE of what im trying to get, go to www.2advanced.com , enter the site, and click on any of the main links. If you do, the current body will deload, then a load animation will appear, then the body will reload. This is the effect that I want to achieve.
I do not know anything about actionscript as my only action I know is goto, lol. I feel now that I will need to use more advanced scripting, and seeing as I dont know the slightest about scripting, I dont want to have to learn tons of scripting to get just this one action.
I have the deload, load, and reload animations already created, and they will be the same after everlink. I think the problem may be the way I have it set up. let me explain.
I have in the main scene lets say 3 buttons, a b and c. Each button when clicked will play 5 animations, at 5 different times, on 5 different layers. Here in lies the main problem, depending on the page (frame) I am on, I dont know how to change the FIRST animation that each animation plays. Since as far as I know you can only make a button go to 1 one destination. But what I THINK I need the button to do is actually play the next 3 frames ahead of page a, then jump to page b. as if I was on page c when I click button a, I want it to show it deloading page c, not page a, then load page a. sigh... ill never understand.
Thanks for helping.
View Replies !
View Related
I Don't Understand...
I'm currently making a tile-based game(I thought this question is probably too easy to answer for the games forum) and I have a certain action happen when you click on a tile.
It works if I pull one tile to the side(not dynamically loaded) but the actual tiles the action doesn't work(its a gotoAndStop action to change what the tile looks like).
View Replies !
View Related
Can Someone Help Me Understand How To Do This Right?
Im trying to make poll that uses set variable to add +1 to the variable every time somone votes for it. my real problem is I can't figure out how to get the variables to write to a PHP file meaning whenever I restart the movie it goes back to 0 but for example I want that to be a 1 next time I reload the SWF file.
Ive been spending almost 3 days trying to make this work, but still nothing and Im also still kinda new to PHP
If you can fix my movie so it does what I want it to I will be really happy! Thanks for any help you can give me
heres the Zip file with the stuff im using
also the FLA only has one chice because I just want the script to get working first.
View Replies !
View Related
Cannot Understand.. Help...
Hi.
I tried to use a script that includes "dif_x = current_x-/:xpos;"
and no matter how i follow the source working file to do this, i keep getting an error message
**Error** Symbol=code, layer=Layer 1, frame=1:Line 3: Operator '-' must be followed by an operand
dif_x = current_x-/:xpos;
the funny part is, when i check for the SAME syntax in the action script window of the source working file, there is no error,
but when i check it in my own file, the error above pops up,
and they r excatly the same!!!
is it that i must define some thing?
help!! i am going crazy!!
thanks lots
View Replies !
View Related
I Don't Understand
Ugh! I don't understand Arrays. I'm working on this game and I'm stuck. I need to make an array, I think... and I have tried reading my book, looking at tutorials, etc. to understand arrays but I still can't. Would someone be so kind as to explain Arrays to me in regaurds to Movie clips. Or if you would rather just refer me to an easy-to-understand place that I could read it myself.
If it helps any, I'm running on MX 2004. What I am trying to do is, I have a set of movie clips and when a player clicks on it, i want the frame to change to a different frame within that movie clip. But which frame it will change to will be ramdom. Can that even be done?
I really appriciate any help you could give me or even a point in the right direction. Thanks.
XaXona
View Replies !
View Related
I Don't Understand.
I have a guy that you can move around with the arrow keys, but whenever I publish the movie to see in the web window, (F12).
It doesn't let me move him, and then I try to just test the movie, (in flash) and it does. HELP!
View Replies !
View Related
I Don't Understand
http://www.flashkit.com/movies/Scrip...3848/index.php
I only can see the action scripting on the button, i would like to create my own but it doesn't work. What is happening in this tutorial ? is there a way i can get it to stop easing and to limit the y co-ordinates of the scroll drag ?
Thanks
View Replies !
View Related
Don't Understand Why....
when you click on a link in this file when it goes to open the page it gives a syntax error in IE and the url ends up looking like this.
http:/20%/www.link.com
Can any one explain this and help me fix it? I am using Flash MX 2004
Link to zip File!!!
View Replies !
View Related
Don't Understand
This tutorial is for the exact version of Flash MX I use. However, the person that created this has many parts that are hard to understand.
http://www.flashkit.com/tutorials/In...-750/index.php
Please, can someone send me a link to a tutorial that can teach me how to make scroll bars, so I can scroll text up and down.. I do not use flash 5, or mx2004, I use Flash MX. Please, I've been working on it for 4 hours now, it's 1:15am and I'm horribly frustrated and restless..
I just need to figure out how to create a text field with scroll bar, or however you 'd like to say it..
View Replies !
View Related
Help Me Understand,..please.
I guess I need understanding why one set of code worked over another.
I dont need to know the "correct" code...I want to have a discussion about why it "didnt work" I want to understand, if you will.......
and I will never "learn" if I dont ask.
ok so I was trying to help out a thread here with some code..when I tested it, ..it didnt work.
I tired something like this:
Code:
on (press) {
_root.walk.gotoAndPlay(Math.random()*(_root.walk._totalframes));
}
// and this...
on (press) {
_root.walk.gotoAndPlay(Math.round(Math.random())*(_root.walk._totalframes));
}
but I was finally given this and it worked,...
Code:
on (press) {
_root.walk.gotoAndPlay(random(_root.walk._totalframes));
}
I mean I am a terrible coder....but I'll be d*mn'd...
So I'd like to learn why my code didnt work...what I did wrong....etc..etc.
Thanks
View Replies !
View Related
How Well Do You Understand AS 2.0
the following code works fine. the second set of code doesn't. the difference is calling the function.
....Box1.onRelease = Release1;
this works fine, it calls the function onRelease.
but when you do
.....Box1.onRelease = Release(1);
it calls it once when it enters the frame, then you can't call it with an onRelease action.
Anyone know enough to be able to answer this??
Code:
function Release1():Void
{
trace("release called");
//trace(numb);
mainGame.ans1.textColor = 0x000000;
mainGame.letter1.textColor = 0x000000;
checkAnswer(1);
}
function Release2():Void
{
trace("release called");
//trace(numb);
mainGame.ans2.textColor = 0x000000;
mainGame.letter2.textColor = 0x000000;
checkAnswer(2);
}
function Release3():Void
{
trace("release called");
//trace(numb);
mainGame.ans3.textColor = 0x000000;
mainGame.letter3.textColor = 0x000000;
checkAnswer(3);
}
function Release4():Void
{
trace("release called");
//trace(numb);
mainGame.ans4.textColor = 0x000000;
mainGame.letter4.textColor = 0x000000;
checkAnswer(4);
}
mainGame.ansBox1.onRelease = Release1;
mainGame.ansBox2.onRelease = Release2;
mainGame.ansBox3.onRelease = Release3;
mainGame.ansBox4.onRelease = Release4;
this code DOESN'T work properly.
Code:
function Release(numb:Number):Void
{
trace("release called");
trace(numb);
mainGame["ans" + numb].textColor = 0x000000;
mainGame["letter" + numb].textColor = 0x000000;
checkAnswer(numb);
}
mainGame.ansBox1.onRelease = Release(1);
mainGame.ansBox2.onRelease = Release(2);
mainGame.ansBox3.onRelease = Release(3);
mainGame.ansBox4.onRelease = Release(4);
View Replies !
View Related
I Don't Understand...
Can anyone explain why some sites look super high res and others don't. I realise that you can use high res images but surely the screen only resolves at 72dpi anyway. So why is it when I put images into flash they look a bit fuzzy compared to some of the stuff I see on the net.
Here is an example of a site where the images look really crisp.
http://www.mono-1.com/monoface/main.html
Any explanations would be great.
Thanks
View Replies !
View Related
How To Understand THIS
In a MovieClip created and named "testXML", the codes like this:
var sValue;
loadCodes();
function loadCodes() {
this.sValue = ExternalInterface.call("getXML"); //load XML from HTML
...
}
You can see the "this" keyword is inside the "loadCodes" function (while the loadCodes function is inside the "testXML" MovieClip). What does the word "this" represent, the function "loadCodes" or MovieClip "testXML"?
Thanks
Scott
View Replies !
View Related
Help Me Understand It ...
I want to understand how to make a full browser with a picture for BG and zero px borders ( scaleable ) and with a menu that stays at 1/3 of width and 2/3 of hight.... ?
For example oma.eu
Thank you in advance
A
View Replies !
View Related
[F8] Don't Understand?
ca any one tell me why these don't work (in one case, one of the worked once and then not any more, the first one) In the later 2 scripts I am referencing a button instance. On the last script, the trace works but the start drag dose not:
_root.headder.name_email.onRelease=function() {
getURL ("mailto:rsbelotte@yahoo.com?subject=I have a job for you");
}
this.headder.name_email.onRelease = function() {
trace ("good");
}
this.sound.drag_but.onPress=function() {
this.sound.startDrag;
trace("test");
}
View Replies !
View Related
Help Me Understand
I have the following code:
ActionScript Code:
imagearray = ["images/gr-amf2p.jpg","images/gr-glt2p.jpg","images/gr-lpd2p.jpg","images/gr-cbl2p.jpg","images/gr-jgn2p.jpg"];
//initialize array
var infoArray = new Array();
for (var i = 0; i<=5; i++) {
infoArray[i] = new Array();
}
infoArray[0][0] = "Amber Fantasy";
infoArray[0][1] = "GR-AMF2P";
infoArray[0][2] = "Granite";
infoArray[0][3] = "Italy";
infoArray[0][4] = "images/big/gr-amf2p.jpg";
infoArray[1][0] = "Golden Lightning";
infoArray[1][1] = "GR-GLT2P";
infoArray[1][2] = "Granite";
infoArray[1][3] = "Brazil";
infoArray[1][4] = "images/big/gr-glt2p.jpg";
xPosition = 17;
yPosition = 315;
//loop through and add thumbnails
for(i=0;i<2;i++){
this.attachMovie("thumber", "instThumber"+i, i+1);
this["instThumber"+i].instEmpty.loadMovie(imagearray[i]);
this["instThumber"+i]._x = xPosition;
this["instThumber"+i]._y = yPosition;
xPosition += 105;
trace(infoArray[i][0]); //trace number 1
this["instThumber"+i].onRelease = function() {
trace(infoArray[i][0]); //trace number 2
trace(infoArray[i,0]); //trace number 3
}
}
trace number one yields "Amber Fantasy" on first trip through loop, and "Golden Lightning" on second trip just as I would expect.
trace number 2 i would expect to yield the same thing but it comes up "undefined". what's up with that?
just for fun i did a trace number 3 with java array synax and this come back with something but shows the whole value of the array "Amber Fantasy,GR-AMF2P,Granite,Italy,images/big/gr-amf2p.jpg"
I guess I am confused about how flash handles arrays, but shouldn't trace 1 and 2 yield the same thing?
does it have something to do with the fact that i'm calling the array inside a function? when i execite the "trace(infoArray[i,0])" line it produces the etire contents of the array so i know it can see it.
any help, knowledge, enlightenment is appreciated. thanks
View Replies !
View Related
Help Me Understand This...
I have attached an FLA...its from Jared Tarbell's Levitated.net. Am not able to understand his style of coding (this guy is a genius), also when i try to translate it into my style of coding...it doesnt work.
Cud any one please try to translate it for me...atleast try to explain the camera object he has created in it...its got me very confused
Thanx.
View Replies !
View Related
Help Me Understand Something...
Check this site:
http://www.lockblok.com/mainblok/main.htm
Now what I want to know is how come everytime you click on a different button, the loading always takes place on the same place, and always the same way?
What I'm thinking is that he has the loading graphic (the circulating ring) in 1 frame, and everytime someone clicks on a button it tells them to go to that frame, and then once its loaded it tells to go back to where it was.
Something like that or am I was way off??
View Replies !
View Related
Pls Understand This..
hey hi all,
i need a help pls
pls understand this.
i have a movie in which i have 3 movieclips..lets call them MC1, MC2, MC3.
In this movie i have 3 buttons linking to respective movieclips.
but the button does not show any action.
so far i have the actionscript on the button is:
on (press)
{
targetPath('MC1')
}
pls help me as i am not very good with actionscript
View Replies !
View Related
I Don't Understand This : (
Hiya everyone, once again the infamous x_polar encountered a rather stupid yet annoying problem, please help me solve it as this piece of code is my theoretical foundation of something bigger
Code:
for (var i:Number = 199; i<=240; i++) {
trace( [i])
}
_root.onEnterFrame = function() {
if (this._ymouse == [i]) {
trace("mi");
}
};
What I'm trying to do is check whether the mouse is within that certain field between 199 and 240 on the y row ....
View Replies !
View Related
Please Help Me Understand This.
I have a function that loads text and pictures into two seperate movie clips and sub movie clips, and then sets buttons and arrows for scolling. the script is below:
PHP Code:
// Loaded Text// declare the LoadVars object that // loads in the external textmyData = new LoadVars();// load event myData.onLoad = function() { // allow text to use html _root.headerHolder_mc.headerText_box.html = true; _root.headerHolder_mc.headerText_box.htmlText = this.headerVar; _root.bodyHolder_mc._y = 85; _root.bodyHolder_mc.bodyText_box.autoSize = true; _root.bodyHolder_mc.bodyText_box.multiline = true; _root.bodyHolder_mc.bodyText_box.wordWrap = true; _root.bodyHolder_mc.bodyText_box.html = true; _root.bodyHolder_mc.bodyText_var = this.textVar; // load pictures attachMovie("mask_mc", "maskSmall_mc", _root.getNextHighestDepth(), {_width: 170, _height:400, _x: 610, _y:80}); attachMovie("picturesHolder_mc", "picturesHolder_mc", _root.getNextHighestDepth(), {_x:620, _y:85}); picturesHolder_mc.setMask(maskSmall_mc); attachMovie("upArrow_mc", "upArrowPics_mc", _root.getNextHighestDepth(), {_x:720, _y:490, _alpha:0}); attachMovie("downArrow_mc", "downArrowPics_mc", _root.getNextHighestDepth(), {_x:745, _y:490, _alpha:0}); noPicturesToLoad = this.noPictures; picturesLoaded = 1; pictureStartY = 0; while (picturesLoaded <= noPicturesToLoad) { picHolder_clipName = "picHolder_mc" + picturesLoaded; picturesHolder_mc.attachMovie("picHolder_mc", picHolder_clipName, picturesHolder_mc.getNextHighestDepth(), {_x:0, _y:pictureStartY}); _root.picturesHolder_mc[picHolder_clipName].loadMovie("../images/"+_root.contentVariable+"/thumbs/"+picturesLoaded+".jpg"); pictureStartY += _root.picturesHolder_mc[picHolder_clipName]._height; trace(_root.picturesHolder_mc._height); trace(pictureStartY); picturesLoaded += 1; } trace(_root.picturesHolder_mc[picHolder_clipName]._height); //showPics_tween = new Tween(picturesHolder_mc, "_alpha", Regular.easeInOut, 0, 100, 30, false); showPics_tween.onMotionFinished = function() { new Tween(upArrowPics_mc, "_alpha", Regular.easeInOut, 0, 100, 10, false); new Tween(downArrowPics_mc, "_alpha", Regular.easeInOut, 0, 100, 10, false); } // Set buttons for pictures _root.downArrowPics_mc.onPress = function() { _root.onEnterFrame = function(){ endOfPics = 450 - _root.picturesHolder_mc._height - _root.picturesHolder_mc[picHolder_clipName]._height; if (_root.picturesHolder_mc._y > endOfPics) { _root.picturesHolder_mc._y -= 5; } } } _root.downArrowPics_mc.onRelease = function() { delete _root.onEnterFrame; } _root.upArrowPics_mc.onPress = function() { _root.onEnterFrame = function() { if (_root.picturesHolder_mc._y < 85) { _root.picturesHolder_mc._y += 5; } } } _root.upArrow_mc.onRelease = function() { delete _root.onEnterFrame; }};
The script fails here:
PHP Code:
while (picturesLoaded <= noPicturesToLoad) { picHolder_clipName = "picHolder_mc" + picturesLoaded; picturesHolder_mc.attachMovie("picHolder_mc", picHolder_clipName, picturesHolder_mc.getNextHighestDepth(), {_x:0, _y:pictureStartY}); _root.picturesHolder_mc[picHolder_clipName].loadMovie("../images/"+_root.contentVariable+"/thumbs/"+picturesLoaded+".jpg"); pictureStartY += _root.picturesHolder_mc[picHolder_clipName]._height; trace(_root.picturesHolder_mc._height); trace(pictureStartY); picturesLoaded += 1; }
i loaded an xml file which contains a variable stating how many pictures are there for that particular topic. The idea is that the pictures are then loaded one on top of the other. This way i can have pictures with varying length, yet the same width (its for aestetic purposes; better than constant boxes). WHere the script goes wrong is where i attempt to retreive the hieght of the picture that has been loaded so that i may know where to place the following picture.
I'm going to go and attempt to modify the code so that i check the height of the last picture loaded on the NEXT iteration of the while loop rather than at the end of the while loop as you see above. I'm doing this because i believe that the reason I'm not returning the height, is because the picture hasn't had time to load...
can anyone see something i may have missed?
-Ahmed
View Replies !
View Related
I Don`t Understand That AS
please explain me, why the "code1" creates a smoother transition of alpha and "code2" doesn`t.
code1
Code:
onClipEvent (load) {
brems = 4;
soa = 40;
}
onClipEvent (enterFrame) {
y = soa-_alpha;
setProperty(this, _alpha, _alpha+y/brems);
}
code2
Code:
onClipEvent (load) {
ion = 100;
maria = 1;
}
onClipEvent (enterFrame) {
setProperty(this, _alpha, ion/maria);
}
Both codes are putted on 2 separately mc`s, that contains each ones button
The first button changes the soa`s value from code1
The second button changes the value of maria from code2.
Thank you
View Replies !
View Related
I Don't Understand
I am trying to make a slideshow for a website. I get no errors when I test but the buttons only work in frame one of the slideshow. Here is the code and an image to illustrate where the buttons are located on the timeline.
I tried seperating the code to the frames corresponding with their buttons with no luck. Not sure what I'm doing wrong here.
thanks for any help
//navigation
leftWrap_btn.addEventListener(MouseEvent.CLICK, leftFrameWrap);
right_btn.addEventListener(MouseEvent.CLICK, rightFrame);
left_btn.addEventListener(MouseEvent.CLICK, leftFrame);
rightWrap_btn.addEventListener(MouseEvent.CLICK, rightFrameWrap);
back_btn.addEventListener(MouseEvent.CLICK, back);
function leftFrameWrap(event:MouseEvent):void
{
gotoAndStop(14);
}
function leftFrame(event:MouseEvent):void
{
prevFrame();
}
function rightFrame(event:MouseEvent):void
{
nextFrame();
}
function rightFrameWrap(event:MouseEvent):void
{
gotoAndStop(5);
}
function back(event:MouseEvent):void
{
gotoAndStop(3)
}
//navigation
View Replies !
View Related
Arr~~ I Need To Understand It D:
well i have been looking for tutorial
i still cant understand it :X
sometime i see the sence put stop ();
some dont
i know it asked the sence stop there
but how come some sence u dont need to stop it
why D:
@#%#!#!3!@#@! hope u understand what i mean!!!
View Replies !
View Related
Pls Understand This..
hey hi all,
i need a help pls
pls understand this.
i have a movie in which i have 3 movieclips..lets call them MC1, MC2, MC3.
In this movie i have 3 buttons linking to respective movieclips.
but the button does not show any action.
so far i have the actionscript on the button is:
on (press)
{
targetPath('MC1')
}
pls help me as i am not very good with actionscript
View Replies !
View Related
I Need To Understand This
What is up with this?
I'm writing a newsletter program. I have a script that takes the htmlText of a textarea and stores it so that textarea can be deleted. Now, when that textarea is recreated, I have the htmlText go back into it. --this is so a user can change pages.
The problem I'm having is that my company bought ActivSpell, a commercial software package. It's a spellchecker.
The spellchecker requires a .variable attribute to be set in the textfield. However, I use the htmlText of the textareas extensivly and with this property not commented out the formatting gets screwed up.
I don't fully understand the purpose of the .variable attribute. I'm unsure of what is going on that's screwing me up.
Here is the script for the textarea:
Code:
//***MYTEXTAREA.AS--Creates textfields dynamically***\
//--------------set initial variables---------------\
var xpos:Number = 0;
var ypos:Number = 0;
var h:Number = 11 * 72;//---Standard Page Size---
var w:Number = 8.5 * 72;//---^^^^^^^^^^^^^^^^^^---
var depth:Number = 0;
System.useCodepage=true;//tells Flash to display special characters
//-Receives the values: xp=xpos, yp=ypos, th=text Height, tw=text Width, tn=textarea Name, dp=depth, loc=this-\
_global.myNewTextField = function(xp, yp, th, tw, tn, dp, loc){//Build the textfield
//SET TEXTFIELDS VALUES
xpos = xp != null || undefined ? xp : xpos ;
ypos = yp != null || undefined ? yp : ypos ;
h = th != null || undefined ? th : h ;
w = tw != null || undefined ? tw : w ;
depth = dp != null || undefined ? dp : depth ;
var tname = tn;
this = loc;//Places the textarea on the passed-in area(on the stage or in an mc)
//BUILD THE TEXTFIELD
this.createTextField(tname, depth, xpos, ypos, w, h);
tname = this[tname];
with (tname){
_alpha = 0;
//embedFonts= true;
html = true;
border = true;
background = false;
type = "Input"
multiline = true;
wordWrap = true;
text = "";
selectable = true;
tabEnabled = true;
vScrollPolicy = "off";
hScrollPolicy = "off";
variable = "V-" + tn;
//_name = tn;
}
//SET TEXTFORMAT
tname.setNewTextFormat(new TextFormat("Arial", 10));
//SET UP CONTEXT MENU
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("Copy Code", htmlCopy));
function htmlCopy(){System.setClipboard(tname.htmlText);}
tname.menu = menu_cm;
//SET UP EVENT HANDLERS
tname.onChanged = function(txt){
_root.gettext();this.setNewTextFormat(new TextFormat("Arial"));}
tname.onScroller = function(txtObject){}
tname.onSetFocus = function(whatLostFocus){tname.borderColor = 0x990000;}
tname.onKillFocus = function(whatGotFocus){tname.borderColor = 0x000000;}
//LET THE PARENT PROGRAM KNOW WHAT TEXTFIELD THIS IS
Selection.setFocus(tname);
_root.textFocus = tname;
_root.whereAt();
}
And here is a function that I use to recreate the textfields on a given page.
Code:
//Load pre defined Text Fields
function loadMultipleTAs(wPage:Number, wField:Number){
var spellArray = new Array();
spellArray[0] = "blankText";
currentPageNum = wPage;
fixMargins();
currentPage = "Page-" + currentPageNum;
//Add Background Pic
if (pageBackground[currentPageNum] ne undefined && pageBackground[currentPageNum] ne "None"){
var backGroundImg = pageBackground[currentPageNum];
buildBackImage(backGroundImg);
}
//Cycles and Loads all pictures for this page
var picsOnPage = 0;
for ( var i = 0 ; i <= (myInsPicArray.length - 1) ; i++ ) {
if (myInsPicArray[i].Page == currentPageNum){
picsOnPage++;
var tname = myInsPicArray[i].PicName;
thisImage = myInsPicArray[i].Pic;
thisImageName= myInsPicArray[i].RealPicName;
buildPic(tname, this, myInsPicArray[i].X,
myInsPicArray[i].Y,
myInsPicArray[i].Width,
myInsPicArray[i].Height);
}
}
//Double checks that the page isn't blank
if (textData[currentPageNum].length < 2 || textData[currentPageNum].length eq undefined ){
if (picsOnPage == 0){ myTextPopup(-1); }
} else {
//Cycles and loads the text fields for this page
var totTextA = (textData[currentPageNum].length - 1);
for ( var i = 1 ; i <= totTextA ; i++ ){
if (textData[currentPageNum][i] eq undefined){}
else{
//Trap for the toolbar taking up the topmost inch on the page(8.5 x 12)
var my_y_pos = ta_y[currentPageNum][i];
if (my_y_pos eq null || my_y_pos eq undefined || my_y_pos < 72){my_y_pos = parseFloat(my_y_pos) + 72;}
new myNewTextField(ta_x[currentPageNum][i],//Sends the values: xpos, ypos,
my_y_pos,//--Height, Width, Name, depth & this
ta_h[currentPageNum][i],
ta_w[currentPageNum][i],
("Page-" + currentPageNum + "_" + "TextArea-" + i),
currentDepth++, this
);
ta_y[currentPageNum][i] = my_y_pos;
currentText = "TextArea-" + i;
currentTANum = i;
textFocus = currentPage + "_" + currentText;//Sets textFocus global variable
var cpage = eval(textFocus);
if (textData[currentPageNum][i]){
cpage.htmlText = textData[currentPageNum][i];//Applies saved text to text field
}
//spellArray[i] = "V-Page-" + currentPageNum + "_TextArea-" + i;
spellArray[i] = cpage.variable;
}
}
trace("----TEXTFOCUS---- " + textFocus);
whereAt();
ActivSpell.fieldRefs = spellArray;
}
}
Thanks
View Replies !
View Related
Can Someone Help Me To Understand This?
This seems like a simple thing to do but I'm getting nowhere. I have 10 swf files that I am trying to load into a empty mc entitled "movieHolder". I am not a programmer. Each one is 40k and I want to load them one after another. There is some logic step that I am not understanding. All files are on the same level.
Frame 1: I install movieHolder onstage.
Frame 2: I write in frame on actions layer
stop();
loadMovie("massTransit.swf", "movieHolder");
gotoAndPlay(3);
Frame 3: I write in frame on actions layer (also tried unloadMovie before loading new movie)
stop();
loadMovie("broadcast.swf", "movieHolder");
Both swfs have loop enabled because if I put a stop frame in, it stops the
main movie they are being loaded into. (i think it's the cause)
I have been messing around with stop, play and go to statements between the two frames and I get one movie to play and repeat, play and stop, skip 1st swf and play the second. I cannot get the two to play sequentially.
Thanks for whatever advice you can provide.
View Replies !
View Related
Something Strange ...i Don't Understand Why
Hi everyone
well...i faced something strange in flash & i need ur help
let me first tell u what i want
i wanna create a motion tween between frames 1 & 10 -for example..okey?
motion tween will be alpha where it starts at 0 & ends at 100
well...i used to do it many times & it always worked normally...without changing the shape!
TODAY i faced something sooo funny
i do the same steps exactly but the only thing that happens is the shape changes from small to big! as if i scaled the picture...but i didn't ...i even didn't play with its size...
why is this happening? i used to do motion tweens hundreds of times & its works fine...why this time not???
any help?
thanks for everyone
View Replies !
View Related
You May Not Understand, Because It Is Too Complex :)
I'm sorta new to flash, and I was stumped when I came across this problem. In my project, I have an animation which I want to constantly run...after the press of a button.
my idea(also the wrong one):
Was to make the button have go to the frame, which was frame one, and in the first frame of the animation have the action stop and the last frame action to goto frame two and play.....
If you understand what this madman is trying to say, plz reply
View Replies !
View Related
I Don't Understand HitTest, ...but I Need It.
so,
flash help defines hitTest like this:
anyMovieClip.hitTest(x, y, shapeFlag);
anyMovieClip.hitTest(target);
and examples (I want to do like the first example):
This first example uses hitTest with the x_mouse and y_mouse properties to determine whether the mouse is over the target's bounding box: (WHATS THE TARGET? WHERE IS THAT DEFINED IN THIS EXAMPLE? WHY IS THERE NO 'anyMovieClip'?..does it default to _self?)
if (hitTest( _root._xmouse, _root._ymouse, false));
This second example uses hitTest to determine if the movie clip ball overlaps or intersects with the movie clip square: (WHY MC, COMMA, HITTEST...AGAIN, WHY IS THERE NO 'anymovieclip?)
if(_root.ball, hittest(_root.square)){
trace("ball intersects square");
}
thanks for any help
View Replies !
View Related
I Dont Understand
Hi,
I am putting Flash files into a FrontPage web site.
What is the correct way to do this?
I want the user to be told that he/she does not have Flash.
If you goto my page without Flash nothing happens.
Kind regards
View Replies !
View Related
For Those That Understand PHP And MySQL Only
hey guys i downloaded a tutorial on a guestbook and for some reason it doesn't work.
here's the PHP upload Script:
<?php
//Make sure to change YourUserName and Password to their real values.
$DBhost = "localhost";
$DBuser = "LSD";
$DBpass = "QAZWSX";
$DBName = "FlashTest";
$table = "news";
// Get Current Date and format var Today to add
$TimeStamp = time();
$Year = date("Y", $TimeStamp);
$Month = date("m", $TimeStamp);
$Day = date("d", $TimeStamp);
$Today = "$Year-$Month-$Day";
// End get Date
$Connect = mysql_connect($DBhost, $DBuser, $DBpass) or die("News=Uh Oh, Could not connect");
mysql_select_db($DBName, $Connect);
$result = mysql_query("INSERT INTO $table (UserName, News, TimeAdd) VALUES ('$UserName', '$EnterNews', '$Today')", $Connect);
Print "Status=News has been added";
?>
and here is the action that is added on the submit button:
on (release) {
loadVariablesNum("AddNews.php", "0", "POST");
}
and the MySQL table:
CREATE TABLE news (
ID int(11) NOT NULL auto_increment,
UserName varchar(30) NOT NULL default '',
News text NOT NULL,
TimeAdd date NOT NULL default '0000-00-00',
PRIMARY KEY (ID)
)
All seems to be correct and suppose to work and yet it doesn't it seems to be that the only thing that the database table getting is the date since thats the only variable that desides his value thru the php and not the Flash!!!
plz plz plz plz plz plz plz plz plz plz... guys help me with this thing!!! i must understand WTF is wrong!!!
View Replies !
View Related
Set Mask, Me No Understand
I need help.
I've tried, but don't understand set mask.
Is this true? It is a way to make one movie clip, mask another movie clip?
Do they have to be on the same layer? Can they be different layers?
I can't get the code to work.
It doesn't even appear that I have the option to select two seperate movie clips. It just gives me the parameter to fill in one clip.
What gives?
Thanks.
View Replies !
View Related
I JUST GOT FLASH ... Please Try And Understand ...
Alright im probably the biggest , hugest newb you have on this forum , ive worked with swish for about 1 year and a half ... now i want to switch to flash because i find flash sites of much higher quality...
I would really apprechiate if someone could direct me to a site where i can learn the really fundamental basics of flash ...
Oh by the way i have Flash MX with me here...
I have no clue how or what to start with , need your help :S thanks people
charles
View Replies !
View Related
I Don't Quite Understand This Script.
can anyone explain this script to me? thanks!
onClipEvent (enterFrame) {
x = getProperty("", _x);
y = getProperty("", _y);
x = Number(x)+Number(dx)*.32;
y = Number(y)+Number(dy)*.32;
dx = Number(dx)+Math.random()+1*-.5;
dy = Number(dy)+Math.random()+1*-.5;
if (Number(x)>443) {
dx = dx*-.2;
x = 443;
}
if (Number(y)>260) {
dy = dy*-.2;
y = 260;
}
if (Number(y)<120) {
dy = dy*-.2;
y = 120;
}
if (Number(x)<175) {
dx = dx*-.2;
x = 175;
}
nx = px;
ny = py;
px = x;
py = y;
dx = dx;
setProperty ("", _x, x);
setProperty ("", _y, y);
}
View Replies !
View Related
Was Trying To Understand Swf Format Better...
was trying to understand swf format better...
i was reading some stuff from swfopen.org like
Signature UI8 Signature byte 1 - always 'F'
Signature UI8 Signature byte 2 - always 'W'
Signature UI8 Signature byte 3 - always 'S'
etc.....
but when i opened it in notepad .....some strange language appeared....is there any special editor in which we open swf files.....
and i often read term "SDK" on macromedia.com and on other big sites what it means please explain me little or give me some link where i can learn more about this...
at were-here there were plenty of threads regarding this .....but i don't know that were-here will be up again...
bye and thanx in advance
adnan
View Replies !
View Related
Help To Understand A .fla I've Downloaded
I was studing the following movie
http://www.flashkit.com/movies/Scrip...-143/index.php
and I found it really interesting; the idea to make a scroll box that takes the text from an external txt file is both versatile and easy to update. but I just can't figure out why the background of the textbox is always white; I just can't find a way to edit it and if I replace it with a new dynamic text field with all the parameters the movie doesn't work... is there anyone with enought free time to explain me what's wrong ??
thanx in advance
View Replies !
View Related
Help Me Understand Preloaders
Gday
i am having a problem with my preloader.
i have read the tutorials here and on other sites and whilst the may differ slightly (scripts), the objective is the same. However no matter which script i use ( eg. load on totalbytes or when total frames are loaded) i always haev problems.
The problem is that the preloader will do its job, however it wil then start my main scen halfway thru.
My main scene starts with an animation for 50 frames and then loads a jpeg image. this image is around 40KB. Then another animation for another 50 frames. My preloader will load my main scene at the point where the jpeg image appears.
Am i doing something wrong. Why does it start halfway thru the main scene and not at the beginning.
Thanks
Chris
View Replies !
View Related
I Don't Understand This Script
This script:
set("char"+movie_number+"/letter:char", substring(text, i, 1));
I don't understand the part "/letter:char", what kind of path specification is?.
And another thing, substring values only may be assigned to string variables?.
thank man!.
View Replies !
View Related
Don't Understand Term
I am new to FlashMX, but not to Flash. I need to know what an indentifier is and how it is used to transfer code from Flash 4
Can some one point the way to where I can find out on line--I have books but still don't understand it
THANKS
View Replies !
View Related
Help Understand This Conversion
I'm working with a typer tutorial made in flash 4
when i brought it into mx it converted. Every thing works but the backspace button here is the code:
on (keyPress "<BACKSPACE>") {
if (Number(sign)<>1) {
sign = sign-1;
x_pos = getProperty(sign, _x);
y_pos = getProperty(sign, _y);
removeMovieClip(sign);
gotoAndStop("start");
}
}
What do you think i could change to make this to work. Or if you were to write it back to flash 4 code how would that look like.
or is their a way to prevent mx from converting the code to see how it originally looks like.
thanks
View Replies !
View Related
|