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




If Mousover How Do I Write This?



Hi
Attached is my attempt at a sliding mousefollowing flash navigation.
Im programmer but know nothing about actionscript.

I need to somehow scale the red block to proportion of the text it goes on and then stop it when it hits a certain x position.

In lamens terms

if(home == mouseover)
{
redblock(xscale) = 123;
}

if(redblock(xposition) = 91)
{
Stop redblock;
}

How can I convert this to actionscript please?

Thanks



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-12-2005, 11:06 AM


View Complete Forum Thread with Replies

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

Mousover
can anyone help me on mouseovers where the image turns a different color unstead

Mousover
can anyone help me on mouseovers where the image turns a different color unstead

Play Movieclip On Mousover
Got a bit of a problem in coding something that should be fairly simple. I want to load a movieclip and on mouseover play that clip. Then on mouseout I want that clip to play in reverse back to the first frame. I'm a bit of a noob in scripting and I've been driving myself nuts in how to do it. I guess yoyo comes into it somewhere but other than that I'm at a loss. I'd really appreciate any pointers on how to do it.

Onrollout Not Catching In Quick Mousover?
Am having an issue with my button tween scripts. They work good until you just skirt your mouse over the button (without pausing or holding it over the button). When you just pass over it before the onrollover tween is done, it gets stuck and doesnt do the onrollout until you hold the mouse over the button and then take it back out.

Whats the best way to fix this??


Code:
home_mc.onRollOver = function() {
new Tween(home_mc,"_xscale",Back.easeIn,home_mc._xscale,175,1,true);
new Tween(home_mc,"_yscale",Back.easeIn,home_mc._yscale,175,1,true);
}

home_mc.onRollOut = function() {
new Tween(home_mc,"_xscale",Back.easeIn,home_mc._xscale,100,.5,true);
new Tween(home_mc,"_yscale",Back.easeIn,home_mc._yscale,100,.5,true);
}

Moving Movie Clips / Graphics On Mousover
hey.. I'm having a problem. I have a series of buttons in a menu.. when you mouse over, I need a colored bar in a lower layer to slide over behind it. any easy way to do this w/ action script. it also needs to ease out at the end of the move.

I'd rather not have to create a thousand layers and do each reponse to each menu item.. any help would be greatly appreciate! you can also find me online on AIM -- sekritagentgirl

Button Mousover, Make New Graphic Appear But Not Allow It's Mouseover
Ok-- so I'm trying to rebuild my quick site -- http://testing.briangrissom.com -- and I want to be able to do a mouseover of the buttons on the left, and have the graphic (text-based)-- pop up on the bottom right. However, I don't want the graphic to also work as a button, or be able to mouseover (as you can see- right now if you put your mouse over where the text is-- it will automatically choose...)

Flash Can Write To Txt? [FLfile.write]? :confused:
Okay, a while ago I started a project for one computer. I needed a little database to store information. When I started out I was informed that flash cannot write to a txt file and that I would have to use php to do my bidding. Well.... I just found in F8 the FLfile.write command that says otherwise. I haven't tested it, but will. So what is the deal with this? What advantages are there to flash vs. php with writing to a txt file?


Code:
var URI = "file:///c|/temp/mydata.txt";
if (FLfile.write(URI, "xxx")) {
alert("Wrote xxx to " + URI);
}
if (FLfile.write(URI, "aaa", "append")) {
alert("Appended aaa to " + fileURI);
}

Write To .txt
alright probably heard this before.
but i want to the user type their name in on my flash web site, and i want to store it into a .txt file or something. how do i get flash to write to a file.

don't make me switch to director.
thanks. =)

Better Way To Write This?
thanks in advance to those who offer help.



k. question is:

is there a better way to write the following:


// any one of 3 pieces on drop target cause visibility change

if (getProperty("/piece" add 1, _droptarget) eq "/target") {
setProperty ("/target", _visible, 0);
} else if (getProperty("/piece" add 2, _droptarget) eq "/target") {
setProperty ("/target", _visible, 0);
} else if (getProperty("/piece" add 3, _droptarget) eq "/target") {
setProperty ("/target", _visible, 0);
} else if (getProperty("/piece" add 1, _droptarget) ne "/target") {
setProperty ("/target", _visible, 1);
} else if (getProperty("/piece" add 2, _droptarget) ne "/target") {
setProperty ("/target", _visible, 1);
} else if (getProperty("/piece" add 3, _droptarget) ne "/target") {
setProperty ("/target", _visible, 1);
}

Better Way To Write This?--2
the above works...but i tried the following and don't really know why they don't:

n=1;
while (Number(n)<=3){
if (getProperty("/piece" add n,_droptarget) eq "/target"){
setProperty ("/target", _visible, 0);
}else{
setProperty ("/target",visible,1)";
}
n=Number(n)=1;
}


didn't work.



thanks again...

Write To .txt
how using only flash to write varibles or any text to a .txt or ascii based file

Write XML?
After loading XML into an object and manipulating, I want to write my changes back to the file... How do I do this?

How Can I Write This Better
can anyone tell me how to write this more efficiently? there are 31 of these.

if (date01 == 1){
Numbers1.gotoAndStop(3);
}if (NewDate == TheCurrentDate && date01 == 1 && MyCurDate ==01){
Numbers1.gotoAndStop(4);
}if (NewDate == TheCurrentDate && date01 != 1 && MyCurDate ==01){
Numbers1.gotoAndStop(2);
}

i am having problems because date has to equal 01-09 and numbers is set to 1-9...that and i keep getting this error that my script is running poorly whenever i write it.

please help.

Write To Txt
Hallo,
can anyone tell me if there is a way to write from flash into a text file?
Thanks in advance

How To Write This Gam?
Dear all,

Anyone know to write this game like this:
http://jp.shockwave.com/games/puzzle...zookeeper.html

Pls Help, Thx!!

Luca

How Do I Write This?
if(_global.frm != 1 || 2 || 3 || 4 || 5){
_root.transFade.play();
}

Doesn't work naturally.

This does what I want, but once set and I go to another movie, it's set permenantly and I can't have that and don't want to undefine it on ten other buttons.

if(_global.frm == undefined){
_root.transFade.play();
}

Thanks.

Is There A Better Way To Write This?
On the returns this code does not return the correct value for the " <= " some times it works and some times it does not. It only worked 50% of the time with " < or > " until I added the " = ". It still only works 80% of the time. Please help.

if
( pr.text >= mr.text )
{ mh.text = (mh.text - 1 ) ;
messages.text = " YOU HIT. " }

else if

( pr.text <= mr.text )
{ mh.text = mh.text ;
messages.text = " YOU MISS. " }

Is There A Better Way To Write This?
Once I added the two variables (noodA, noodB), my swf started to choke.
Code:
var noodJ = 1;
var noodA = 1000;
var noodB = 1000;
noodleDrop = function (noodA, noodB) {
noodJ++;
rN = Math.random()*noodA+noodB;
trace("rN = "+rN);
if (noodJ>=50) {
noodJ = 1;
}
_root.attachMovie("noodleMC", "noodle"+noodJ, noodJ);
var i = Math.random()*775+25;
var k = Math.random()*15+55;
with (_root["noodle"+noodJ]) {
_x = i;
_y = -10;
_xscale = k;
_yscale = k;
}
clearInterval(noodleInterval);
noodleInterval = setInterval(noodleDrop, rN);
};

Write Out
Is it possible to have flash write something to some sort of retrievable file to be used at a later date? text file maybe?

[F8] Is There A Better Way To Write This?
hi,


Code:
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged = false;

// Block A1
if (eval(this._droptarget) == A1) {
this.onTarget = true;

if (Clip = one) {
if (Person1Choice1 == "") {
Person1Choice1 = "A1";
} else {
Person1Choice2 = "A1";
_root.Person1ReasonDisplay._visible = true;
}
}

if (Clip = two) {
if (Person2Choice1 == "") {
Person2Choice1 = "A1";
} else {
Person2Choice2 = "A1";
_root.Person2ReasonDisplay._visible = true;
}
}
if (Clip = three) {
if (Person3Choice1 == "") {
Person3Choice1 = "A1";
} else {
Person3Choice2 = "A1";
_root.Person3ReasonDisplay._visible = true;
}
}
if (Clip = four) {
if (Person4Choice1 == "") {
Person4Choice1 = "A1";
} else {
Person4Choice2 = "A1";
_root.Person4ReasonDisplay._visible = true;
}
}

}
// Block A2
else if (eval(this._droptarget) == A2) {
this.onTarget = true;

if (Clip = one) {
if (Person1Choice1 == "") {
Person1Choice1 = "A2";
} else {
Person1Choice2 = "A2";
_root.Person1ReasonDisplay._visible = true;
}
}

if (Clip = two) {
if (Person2Choice1 == "") {
Person2Choice1 = "A2";
} else {
Person2Choice2 = "A2";
_root.Person2ReasonDisplay._visible = true;
}
}
if (Clip = three) {
if (Person3Choice1 == "") {
Person3Choice1 = "A2";
} else {
Person3Choice2 = "A2";
_root.Person3ReasonDisplay._visible = true;
}
}
if (Clip = four) {
if (Person4Choice1 == "") {
Person4Choice1 = "A2";
} else {
Person4Choice2 = "A2";
_root.Person4ReasonDisplay._visible = true;
}
}


} else {

this.onTarget = false;
}

im building a drag grid 10 x 10 ( 100 square target blocks (first row A1 - A10 then next row B1 - B10 then so on till you get to J1 - J10))

When i drag one my four dragable targets over the grid and drop one on top of the 100 boxes it fills a variable with the current drop target name

then they will watch a presentation and then the blocks will then be moved again and again another variable will be filled with the new droptaget name. and they will be asked a reason why they have dropped it which will fill another variable (all to be collected later).

my problem is that as there's 100 squares there is going to be alot of code is there a better way i could have written it (ive never really used for loops before) and don't really know how to start.

if anyone could give me some pointers that would be great (i have also uploaded my fla just in case it helps)

Thanks

Charlie

[F8] How Would I Write This?
I know this has to be easy, but my brain is not functioning. I have this so far, but I want the first line to happen first and then the rest of it. So...


Code:
on (release) {
_level0.holder_mc.gotoAndPlay("label") <------I want this to happen first
loader_mc._visible = true;
mcl.loadClip("hole3.swf", holder_mc);
_root.goPlay = false;
}

Essentially I have holder_mc on my main timeline and I load external swfs into it. I want the external swf to play "label" which is the outgoing animation in each before the next swf is loaded in. This was the only way I saw it working, could there be a better way? Thanks for any guidance you can provide.

[F8] Write To Xml
I was just wondering, is it possible to write to an external xml file from inside of flash, and have the changes to the file stay in it permanently?
I've fooled around with the createElement() method... but that doesnt really seem to work how I wanted it to. So if anyone could tell me if this is, in fact, possible, and also give me an example or point me in the direction of a tutorial somewhere that would be much appreciated.
Thanks in advance
Mavrisa

Write To An Xml
Hello.

I know you can read from an xml file into flash. My question is can you change the values and write those values back to the xml? I did a search on the boards for this information but could not find what I was looking for.
If it is possible to do could I get an example of how it is done please?

Thanks in advance.
tcooley2003

Using PHP To Write
Hi,

Can some one point me in the direction of using flash and PHP to write to a website or text field.

Im quiet experienced in PHP but have none in making flash use php.

Thanks.

Is There A Better Way To Write This?
function resetMovie() {
bar1.enabled = false;
bar2.enabled = false;
bar3.enabled = false;
item1.enabled = false;
item2.enabled = false;
item3.enabled = false;
item4.enabled = false;
item5.enabled = false;
item6.enabled = false;
item7.enabled = false;
item8.enabled = false;
}

Where To Write And What?
hi,
Im new to Action Script and I want to aske for your help
I confused from all the places I can write in them Action Script commands,
I dont know where to write.
For example:
I make this minigame
http://pics.sendit.co.il/0706/da0bb3acbb.swf
Now I want to do that when all the shapes are matched the game start agian from the begining.

and this is what I think to do:
create varible named 'K' and when the player matched shape the varible count +1, until 3 and when he reach to 3, I will do this command:
if (K ==3)
gotoAndPlay(1);

but I dont now where to write all of that. plz help me
tzelon

Why Does One Over Write The Other?
//TotalReturnText
_root.createTextField("myText_str", getNextHighestDepth, 132, 221.4, 128, 17);
myText_str.border = false;
myText_str.borderColor = 0xFFFFFF;
myText_str.text = total;
//TotalReturnTextFormat
if (total>=0.0) {
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Tahoma";
my_fmt.bold = false;
my_fmt.size = 11;
my_fmt.color = 0x00CC00F;
my_fmt.align = "center";
myText_str.setTextFormat(my_fmt);
} else if (total<0.0) {
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Tahoma";
my_fmt.bold = false;
my_fmt.size = 11;
my_fmt.color = 0xFF0000F;
my_fmt.align = "center";
myText_str.setTextFormat(my_fmt);
}
//TotalPercentText
_root.createTextField("myText2_str", getNextHighestDepth, 132, 241.4, 128, 17);
myText2_str.border = false;
myText2_str.borderColor = 0xFFFFFF;
myText2_str.text = totalpercent;
//TotalReturnTextFormat
if (totalpercent>=0.0) {
var my2_fmt:TextFormat = new TextFormat();
my2_fmt.font = "Tahoma";
my2_fmt.bold = false;
my2_fmt.size = 11;
my2_fmt.color = 0x00CC00F;
my2_fmt.align = "center";
myText2_str.setTextFormat(my2_fmt);
} else if (totalpercent<0.0) {
var my2_fmt:TextFormat = new TextFormat();
my2_fmt.font = "Tahoma";
my2_fmt.bold = false;
my2_fmt.size = 11;
my2_fmt.color = 0xFF0000F;
my2_fmt.align = "center";
myText2_str.setTextFormat(my2_fmt);
}
}

Write Xml From Exe
Can you write to an xml file from an executable flash file somehow? No internet connectivity, and no server side. Is there a third party solution for this?

Can We Write Into XML
Hi,
I have a big dout running in my mind that can we save a xml file from an swf., that is i have done so many projects from which you can read contents from xml but can we write in to xml that is all is my dout.......

I will be greatly honoured if anybody could help.

Write XML
Hi , I want write into XML file exemple new node or rewrite atribute if tis is possible do with action script?

Thanx

XML Write
Hi,
It's my first post here and i wish to get the help i need!

Is it possible to let Flash write on an XML file (adding Nodes)?

I want to write a script that modify the existing XML file, it will be chipped with the rest of the files on CDs.

Using PHP To Write XML
Is it possible to write to an XML file with PHP?

I have a simple Flash/XML slideshow-esque presentation that uses images+audio.

I want to hand it over to a client but I think managing the XML is too advanced for them.

I'm thinking I might need to hand over an HTML form with some PHP to allow them to upload assets and add/delete slides. If I could make it in Flash, that would be even better. I'm thinking that if I do it in Flash, I can set an interval to keep reloading the XML in so the client can see their edits as they create a presentation.

I've used PHP to write to .txt files for simple hit counters etc. that I've used in Flash, but this is a bit over my head.

Anyone?

Is There A Better Way To Write This
on (press) {
loadMovie("ccPort_41.swf","imageLoader2");
}

something like

on (press) {
load.my_loader.my_swf

How To Write
Is it posible to write a variable from a .swf in a .txt or a .xml ??

I have never been able to use "send", "XML.send, "XML.createElement" or "XML.appendChild"

If u can explain to me in "noob terms" so i can understand or simply make a script that does this.

Tx a lott!

How Do I Write This?
Code:
function myFunction(myMC) {
myMC.attachMovie(myMC, myMC, getNextHighestDepth());
}

myFunction(test);
I want this to attach a MC from my library called "test" to a movieclip holder called "test" on the canvas and have it named test. In the end, the instance path would be _root.test.test.

The problem is myMC (the one right after the first parenthesis) is not populating correctly because it is not being read by Flash properly.

The typeof myMC is movieclip. I can String(myMC), but still no hope. How do I get this done?

How Would I Write This?
I have a movieclip that is loading other movie clips upon request like this...

this.box.clipholder.attachMovie("mc1","mc11",1);

NOW, here is my problem. How would i tell the attached movieclip to gotoAndPlay. I need it to play WITHOUT specifying the exact movie clip that is attached, just whichever movieclip that is currently loaded in the clipholder.

Make sense?

How To Write % In Txt?
Hello
I know there is rule how to write % so I can see in the loaded text from txt file.
So, how do I have to write "%"?

Write XML
Hi , I want write into XML file exemple new node or rewrite atribute if tis is possible do with action script?

Thanx

Write To XML
I know this has probably been asked before, but i have searched sitepoint forums and google and havent found what i am looking for.

Is it possible for actionscript to write to a text/xml file without the use of a web server?

This is very important as i am writing a program in flash and i need to be able to write to files without a server because not every user is going to have a web server.

How Can I Write This Better
can anyone tell me how to write this more efficiently? there are 31 of these.

if (date01 == 1){
Numbers1.gotoAndStop(3);
}if (NewDate == TheCurrentDate && date01 == 1 && MyCurDate ==01){
Numbers1.gotoAndStop(4);
}if (NewDate == TheCurrentDate && date01 != 1 && MyCurDate ==01){
Numbers1.gotoAndStop(2);
}

i am having problems because date has to equal 01-09 and numbers is set to 1-9...that and i keep getting this error that my script is running poorly whenever i write it.

please help.

How To Write This BUT In AS3.0
hi, here is a code to make flash player write as old machine but it written in AS2.0, i found it in the tutorials section.
CAN somebody help me to write similer code but in AS3.0, am new to AS3.0
here is the link for the tutorial

http://www.gotoandlearn.com/play?id=55

=============================================
var str:String = "some text here";
var sInt = setInterval(writeIt,1);
var count:Number = 0;
var s:Sound = new Sound();
s.attachSound("type");
function writeIt() {
if(count == 0) {
s.start(0,1000);
}
theText.text = str.substring(0,count);
count += 5;
if(count > str.length) {
clearInterval(sInt);
s.stop();
}
}
=================================================

How Do I Write This?
I have a dynamic field (currentPage) and an input field(gotoPage).

currentPage is at 20.

When I type in 25 on the gotoPage and press enter. I would like when I press enter that the following command will be sent.

if inputPage is greater than 20, it will send the following _level0.pageDirection = "next";
if inputPage is less than 20 it will send the following
_level0.pageDirection = "back";

This is my code so far

Code:

function checkEnter()
{
if (Key.isDown(Key.ENTER))
{
_level0.instrMv.gotoAndStop(++_level0.gotoPgInput);
_level0.gotoPgInput = "";
}
}

How Would I Write This?
I have a button that when the mouse rollover it makes a man jump. The man jumping movie has 20 frames to make the jump.

What I wanted to do was make the man jump and if the mouse is still over the button it will jump again.

What Im doing is this. On the button I have

Code:

on(rollOver){
_level0.manjump.gotoAndPlay(2);
_level0.jump = yes;
}

on(rollOut){
_level0.jump = no;
}



Then inside the first frame of my manjump movie, I place this script

Code:

if(_level0.jump == "yes"){
_level0.manjump.play();
}else{
stop();
}



Is there another way of writing this?
Like on the first frame on manjump movie it could be like:
if the mouse is over the button, play, if not stop. Would I be using hitTest for this?

Write In Registry ? Help ?
I was wondering if I could use Flash to ingerate in Windows registry file.
Somebody help ?

What To Write For The Script?
i got seven buttons, how can i make each one of them after press, play frame 1 - 10 then load a movie.

Write To A Txt File?
Hi, I have forgotten how to write a variable to a text file.

Can someone please remind me..

Cheers,

M@

How Would I Start To Write That
i was thinking some thing like this, the way it works is that ive got a sprite of the guy attached to a little blob that has all the script for the movermet on it. then i just attached the movie of the guy after

how could i start constructing this would it needs to be something like

if x of spriteblob thing is between 10-15 set _x _y scale of guys sprite + 5% os somthing.?????

then between 16-20, then 21-25 etc etc etc

Write XML File
Dear guys,
I need update a XML file, exactly I have to change some attributes.
At this moment the procedure that I've wrote is explained below:

FILE XML (miofile.xml)

<principale>
<progetto_1 attributo_01="animale_01" attributo_02="animale_02"
attributo_03="animale_03" ></progetto_1>
</principale>

FILE PHP (miofile.php)

<?
$fp = fopen("miofile.xml","w");
$prova = $mioXML;
fwrite($fp,$prova);
fclose($fp);
?>

NOW THE ACTION IN FALSH (after the download about miofile.xml):

on (release) {
mioXML = new XML (provaXML);
mioXML.firstChild.childNodes[1].removeNode();
nuovo = mioXML.createElement ("progetto_01");
nuovo.attributes.attributo_03 = testo_03;
nuovo.attributes.attributo_02 = testo_02;
nuovo.attributes.attributo_01 = testo_01;
nuovo.appendChild(attributo);
mioXML.firstChild.appendChild(nuovo);
loadVariablesNum ("miofile.php", 0, "POST");
}

QUESTION: to update an attribute you must delete all node and recreate it writing
all attributes, or exist another method maybe easier?

where testo_01 testo_02 e testo_03 are input fields ...
send and the result is:

<principale>

<progetto_01 attributo_01="mucca" attributo_02="topo"
attributo_03="cane"></progetto_01></principale>

HERE THE ISSUE:

1- the slash --> (es. attribute_01="mucca")
I don't Know because create them( ); then with slashes the document will be a non valid XML

2- the right method to send all should be using send() and not with loadVariable; but
If I try with send() (es. mioXML.send( miofile.php ) don't write anything.... maybe is wrong the concept of PHP file?

But aboveall is the procedure right?
In particular about the PHP file, I write the file TXT using PHP, but I don't Know if is the same for XML

Thanks in advance
Roberto

Response.write Help Please.
This does what I need it to do (outputs exactly what it does and NOTHING more):

<%
response.write ("&text1=The+Borse")
response.write ("&value1=4")
%>

NOW - what I need to do is have those response.writes come from a database.
(i.e. the database will hold the values for text1 and value1)

How can I do this - I know it cant be too difficult - but I am learing I just don't know the format/code to make a connection to the database and use those response.writes to output the same thing.

I need it in ASP btw.

Thanks in Advance,
Oznob

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