[Flashcoders] Actionscript 3.0 Coding Niggles

2009-03-08 Thread Ali Hitch
Hey guys,

Having problems on the coding side of what I thought would be a very simple
task.

The task is:

I am creating a navigation bar for a website. On the navigation bar, when
the user does a mouse over on a certain area of the bar (invisible button),
a specified movie will play once and will not play again unless the user
does a mouse over again. When the user clicks on the invisible button, it
will perform the action of a link and direct the user to another page.

In a bit more detail:

In flash I have created a document (actionscript 3.0). On the document for
this example, there is a piece of text called labelled 'home'. This text has
been converted into a movieclip labelled home_mc. Inside the movie clip
there are 7 frames. Frame1 = home font size20 | Frame2 = home font size21 |
Frame3 = home font size22 | Frame 4 = home font size23 | Frame 5 = home font
size 22 | Frame6 = home font size21 | Frame7 = home font size20. As you can
probably tell, I am trying to make a growing text effect in flash.

Coming out of the movieclip to Scene 1 I have created another layer called
invivisible button1. This has then been converted to a button called
home_btn and made 'invisible'.

What I have been trying to do with actionscript is make the movieclip
home_mc play once when there is a mouse over event with home_btn (invisible
button), but with all the code I have tried so far nothing has really worked
and when I test the movie, the movieclip home_mc is just constantly playing
and looping back on itself.

The latest code I have tried is:

**Start code**

var home_mc:MovieClip = new MovieClip ();
//home_mc = someClip you embedded;
text_mc.name = myButton;

home_mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
home_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
//adds event listeners



funtion mouseOver (event:MouseEvent):void
{
trace (event.currentTarget.name + mouse over);
// the trace event is asking for the name property (which is like a
method) we set that property above.
//otherwise tracing event.currentTarget just tells us the type of object
we are dealing with = MovieClip
event.currentTarget.play();
//this function can be used on ANY subject that has an event handler -
addEventListener
}

funtion mouseOut (event:MouseEvent):void
{
trace (event.currentTarget.name + mouse out);
event.currentTarget.gotoandstop(1);
}

**end code**

I have had some vague help previously and have read and looked at
tutorials/books but still don't quite get this. I am after all trying to
learn a new programming language without any previous experience with
programming languages.

Any help with this hopefully simple problem would be gratefully appreciated.

Thanks,
Ali Hitch
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Actionscript 3.0 Coding Niggles

2009-03-08 Thread Joel Stransky
is there a stop() on frame 1 of text_mc?

On Sun, Mar 8, 2009 at 3:29 PM, Ali Hitch hitchy@gmail.com wrote:

 Hey guys,

 Having problems on the coding side of what I thought would be a very simple
 task.

 The task is:

 I am creating a navigation bar for a website. On the navigation bar, when
 the user does a mouse over on a certain area of the bar (invisible button),
 a specified movie will play once and will not play again unless the user
 does a mouse over again. When the user clicks on the invisible button, it
 will perform the action of a link and direct the user to another page.

 In a bit more detail:

 In flash I have created a document (actionscript 3.0). On the document for
 this example, there is a piece of text called labelled 'home'. This text
 has
 been converted into a movieclip labelled home_mc. Inside the movie clip
 there are 7 frames. Frame1 = home font size20 | Frame2 = home font size21 |
 Frame3 = home font size22 | Frame 4 = home font size23 | Frame 5 = home
 font
 size 22 | Frame6 = home font size21 | Frame7 = home font size20. As you can
 probably tell, I am trying to make a growing text effect in flash.

 Coming out of the movieclip to Scene 1 I have created another layer called
 invivisible button1. This has then been converted to a button called
 home_btn and made 'invisible'.

 What I have been trying to do with actionscript is make the movieclip
 home_mc play once when there is a mouse over event with home_btn (invisible
 button), but with all the code I have tried so far nothing has really
 worked
 and when I test the movie, the movieclip home_mc is just constantly playing
 and looping back on itself.

 The latest code I have tried is:

 **Start code**

 var home_mc:MovieClip = new MovieClip ();
 //home_mc = someClip you embedded;
 text_mc.name = myButton;

 home_mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
 home_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
 //adds event listeners



 funtion mouseOver (event:MouseEvent):void
 {
trace (event.currentTarget.name + mouse over);
// the trace event is asking for the name property (which is like a
 method) we set that property above.
//otherwise tracing event.currentTarget just tells us the type of object
 we are dealing with = MovieClip
event.currentTarget.play();
//this function can be used on ANY subject that has an event handler -
 addEventListener
 }

 funtion mouseOut (event:MouseEvent):void
 {
trace (event.currentTarget.name + mouse out);
event.currentTarget.gotoandstop(1);
 }

 **end code**

 I have had some vague help previously and have read and looked at
 tutorials/books but still don't quite get this. I am after all trying to
 learn a new programming language without any previous experience with
 programming languages.

 Any help with this hopefully simple problem would be gratefully
 appreciated.

 Thanks,
 Ali Hitch
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Lint for ActionScript?

2009-03-08 Thread Meinte van't Kruis
flex develop has a bit more of the 'you did something wrong' warnings
before compiling. But frankly, I find it just plain annoying. I love hitting
ctrl-s every few seconds, and after each hit flexdev will check and find
new errors of unfinished code lines.

On Fri, Mar 6, 2009 at 7:13 PM, Todd Kerpelman t...@kerp.net wrote:

 Oh, I use FD and love it. But I'm looking for something that can give me
 more advanced compiler warnings, like, Hey, you declared this variable and
 never used it or You've got a fall-through in a case statement or This
 piece of code appears to be unreachable.

 I've checked out the EnabledWarnings.xml file, which is helpful, but it
 doesn't really give me everything I was hoping for.

 --T

 2009/3/5 liutoday today...@hotmail.com

 
 
 
   Date: Thu, 5 Mar 2009 17:11:49 -0800
   From: t...@kerp.net
   To: flashcoders@chattyfig.figleaf.com
   Subject: [Flashcoders] Lint for ActionScript?
  
   Hey, guys.
  
   Anybody have any decent Lint-like tools that they've been using for
   ActionScript? Google hasn't given me anything very useful, except the
   recommendation that a Lint tool for JavaScript might work, which I'm
  kinda
   skeptical about.
  
   --T
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
  how about flahDevelop.
 
  _
  Live Search视频搜索,快速检索视频的利器!
  http://www.live.com/?scope=video
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
M.A. van't Kruis
http://www.malatze.nl/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Actionscript 3.0 Coding Niggles

2009-03-08 Thread Ashim D'Silva
just put a stop() on the last frame (when the text is big)

2009/3/9 Joel Stransky stranskydes...@gmail.com

 is there a stop() on frame 1 of text_mc?

 On Sun, Mar 8, 2009 at 3:29 PM, Ali Hitch hitchy@gmail.com wrote:

  Hey guys,
 
  Having problems on the coding side of what I thought would be a very
 simple
  task.
 
  The task is:
 
  I am creating a navigation bar for a website. On the navigation bar, when
  the user does a mouse over on a certain area of the bar (invisible
 button),
  a specified movie will play once and will not play again unless the user
  does a mouse over again. When the user clicks on the invisible button, it
  will perform the action of a link and direct the user to another page.
 
  In a bit more detail:
 
  In flash I have created a document (actionscript 3.0). On the document
 for
  this example, there is a piece of text called labelled 'home'. This text
  has
  been converted into a movieclip labelled home_mc. Inside the movie clip
  there are 7 frames. Frame1 = home font size20 | Frame2 = home font size21
 |
  Frame3 = home font size22 | Frame 4 = home font size23 | Frame 5 = home
  font
  size 22 | Frame6 = home font size21 | Frame7 = home font size20. As you
 can
  probably tell, I am trying to make a growing text effect in flash.
 
  Coming out of the movieclip to Scene 1 I have created another layer
 called
  invivisible button1. This has then been converted to a button called
  home_btn and made 'invisible'.
 
  What I have been trying to do with actionscript is make the movieclip
  home_mc play once when there is a mouse over event with home_btn
 (invisible
  button), but with all the code I have tried so far nothing has really
  worked
  and when I test the movie, the movieclip home_mc is just constantly
 playing
  and looping back on itself.
 
  The latest code I have tried is:
 
  **Start code**
 
  var home_mc:MovieClip = new MovieClip ();
  //home_mc = someClip you embedded;
  text_mc.name = myButton;
 
  home_mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
  home_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
  //adds event listeners
 
 
 
  funtion mouseOver (event:MouseEvent):void
  {
 trace (event.currentTarget.name + mouse over);
 // the trace event is asking for the name property (which is like a
  method) we set that property above.
 //otherwise tracing event.currentTarget just tells us the type of
 object
  we are dealing with = MovieClip
 event.currentTarget.play();
 //this function can be used on ANY subject that has an event handler -
  addEventListener
  }
 
  funtion mouseOut (event:MouseEvent):void
  {
 trace (event.currentTarget.name + mouse out);
 event.currentTarget.gotoandstop(1);
  }
 
  **end code**
 
  I have had some vague help previously and have read and looked at
  tutorials/books but still don't quite get this. I am after all trying to
  learn a new programming language without any previous experience with
  programming languages.
 
  Any help with this hopefully simple problem would be gratefully
  appreciated.
 
  Thanks,
  Ali Hitch
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 --Joel Stransky
 stranskydesign.com
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
The Random Lines
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] find and delete XML nodes

2009-03-08 Thread Muzak

One way to do it is to look for the child elements which id is *not* b.
Then replace the original child elements with the new ones, or in other words, set the remaining elements as the children of the 
parent:


var s:String = 'parentchild id=a /child id=b /child id=a /child id=b 
//parent';
var xml:XML = new XML(s);
trace(before: , xml.toXMLString());
trace(--);

var elements:XMLList = xml.child.(@id != b);
trace(elements: , elements.toXMLString());
trace(--);

xml.setChildren(elements);
trace(after: , xml.toXMLString());


//output:
before:  parent
 child id=a/
 child id=b/
 child id=a/
 child id=b/
/parent
--
elements:  child id=a/
child id=a/
--
after:  parent
 child id=a/
 child id=a/
/parent

regards,
Muzak

- Original Message - 
From: Joel Stransky j...@stranskydesign.com

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, March 09, 2009 4:38 AM
Subject: [Flashcoders] find and delete XML nodes



I have some xml nodes where I need to evaluate their attributes and delete
them if they meet certain criteria. It's probably simple but its late and
brain fatigue is setting in.

Say I had this node

parent
 child id=a /
 child id=b /
 child id=a /
 child id=b /
/parent

How would I find and delete any child who's id is b ?
--
--Joel Stransky
stranskydesign.com


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] find and delete XML nodes

2009-03-08 Thread liutoday



 Date: Sun, 8 Mar 2009 23:38:17 -0400
 From: j...@stranskydesign.com
 To: flashcoders@chattyfig.figleaf.com
 Subject: [Flashcoders] find and delete XML nodes
 
 I have some xml nodes where I need to evaluate their attributes and delete
 them if they meet certain criteria. It's probably simple but its late and
 brain fatigue is setting in.
 
 Say I had this node
 
 parent
   child id=a /
   child id=b /
   child id=a /
   child id=b /
 /parent
 
 How would I find and delete any child who's id is b ?
 -- 
 --Joel Stransky
 stranskydesign.com
 ___


delete xml.child.(@id==b);




_
MSN安全保护中心,免费修复系统漏洞,保护MSN安全!
http://im.live.cn/safe/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders