[Flashcoders] FLAR: accessing the marker rotation properties

2010-09-08 Thread Isaac Alves
Hello,

I'm working on a flAR project and I would like to have control over marker's
rotation (actually I want the app. to detect the marker, and after that,
stop detecting it and the code would tween its rotation properties) I don't
need actually to rotate the marker, I could rotate the object that is added
to the marker. I could add an object outside of the marker, directly into
the display list, but I would then need to get the marker's rotation
properties. Does anyone knows how to do it?

Does anyone know a good forum focused on Augmented Reality in Flash ?

Thanks in advance!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] RE: RE: swf behaving differently in different domain and other issues loading swf (Isaac Alves) (Keith Reinfeld)

2009-09-24 Thread Isaac Alves
Keith,

I´m sorry but the only reply I-ve found from you here (at least on
this topic) was this one where you talked about checking the xml file,
and I-ve only received it now, actually 45 minutes ago in my gmail
inbox

That aside I try to answer all the replies, but since I-ve been doing
so much work I believe some I don´t have the time or forget to answer
and there are maybe some that I don´t even notice ...

Anyway I appreciate your help and I-m sorry for that!
Isaac

ps: Sometimes I get kind of lost on this list, and I believe I haven´t
been using it correctly actually, for example, I have a doubt on how
to reply a message and include the original message in a way that I
don´t need to copy and paste the message, thus have the replied
message with the characters  in front of the lines and all that...

ps2: I solved this swf issue (you can see the message 9 on the issue n 25)

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


[Flashcoders] building custom libraries and components using FlashDevelop and Flex SDK

2009-09-24 Thread Isaac Alves
Hello,

I'm giving a try on FlashDevelop with Flex SDK, and a lot of things
are new to me . My study background is on Graphic Design, so I know
little about programming.

One of the reasons I´m migrating to FD it is that I would like to
build my own libraries (menus , slideshows, and other stuff) and gain
productivity as well as flexibility.

For example I´ve been creating animations and menus for a lot of
websites, and so far I´m doing it like this:

I use a class I´ve made called SimpleMenu (which I copy, paste and
make changes for each project)

in the FLA file I have a movieclip (which I also copy, paste and make
changes for each project) of a menu Item and sometimes also the
menuSubItem, if needed.

and in the document class of the main .fla file I write something like that:

public var menuWhatever:SimpleMenu = new SimpleMenu;

// params: path, xPos, yPos, widthOffset, heightOffset, nColumns
menuWhatever.createSimpleMenu(String(menuXMLPath), 5, 143, 16, 5, 8);

The point is:

I feel that copy and pasting code and MovieClips from other projects
is not quite the best practice regarding ActionScript.

I believe that I could do this kind of stuff in a more efficient and
organized way by building my own components (SWC files? ) and
associating them to classes, and so on, but I have many doubts and
feel kind of lost and a little overwhelmed.

I would like to get some advices and tips on how to build my own
libraries and components, taking as start point this way of getting
things done that I-ve briefly described...

That´s it, thank you in advance!
Isaac

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


[Flashcoders] swf behaving differently in different domain and other issues loading swf

2009-09-23 Thread Isaac Alves
Good morning,

I´ve been experiencing some problems with swf files.

First one:

http://www.swingebalada.com.br/index.php

In this website, the logo and menu animations work nice when the home
page is loaded (index.php)
But in the internal pages (i.e: index.php?cmd=eventos) the animation
doesn´t happen.

The header swf file doesn´t receive any parameter in the internal pages.
What-s going on?

Second problem:

In this website, the menu works perfectly in the internal server of
our network, and in this case, the swf file receives a parameter to
highlight the menu item of the page that is currently opened.
Unfortunatelly I cannot give you access to it, but I can send the fla
and swf file , just in case.

But on this page it just doesn´t work:

http://clientes.agenciahive.com.br/acoriana/index.php

In Firefox, the swf gets loaded but the links doesn´t work, and the
animations sometimes stuck. In IE6, the swf doesn´t even get loaded
and it throws an error.

Thanks a lot !!
Isaac

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


[Flashcoders] RE: swf behaving differently in different domain and other issues loading swf (Isaac Alves)

2009-09-23 Thread Isaac Alves
update:

in the acoriana website, the flash-menu is now working perfectly in
Firefox, i fixed the problem.

but it still remains the mistery of not loading swf in IE6 .

cheers!


Message: 16
Date: Wed, 23 Sep 2009 11:28:59 -0300
From: Isaac Alves isaacal...@gmail.com
Subject: [Flashcoders] swf behaving differently in different domain
   and other issues loading swf
To: flashcoders@chattyfig.figleaf.com
Message-ID:
   9719fa510909230728x6270b640lc703cc61cf3ad...@mail.gmail.com
Content-Type: text/plain; charset=ISO-8859-1

Good morning,

I´ve been experiencing some problems with swf files.

First one:

http://www.swingebalada.com.br/index.php

In this website, the logo and menu animations work nice when the home
page is loaded (index.php)
But in the internal pages (i.e: index.php?cmd=eventos) the animation
doesn´t happen.

The header swf file doesn´t receive any parameter in the internal pages.
What-s going on?

Second problem:

In this website, the menu works perfectly in the internal server of
our network, and in this case, the swf file receives a parameter to
highlight the menu item of the page that is currently opened.
Unfortunatelly I cannot give you access to it, but I can send the fla
and swf file , just in case.

But on this page it just doesn´t work:

http://clientes.agenciahive.com.br/acoriana/index.php

In Firefox, the swf gets loaded but the links doesn´t work, and the
animations sometimes stuck. In IE6, the swf doesn´t even get loaded
and it throws an error.

Thanks a lot !!
Isaac

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


[Flashcoders] RE: swf behaving differently in different domain and other issues loading swf (Isaac Alves)

2009-09-23 Thread Isaac Alves
Hi, both problems solved!

The first one was easy, actually there was a conditional that was
stopping the animation whenever the swf file was loaded inside an
internal page, that is, not the home page. ( I didn´t realize it
before cause the code was a bit messy and was made by someone else).

The second problem was tricky. There swf was embedded via jQuery (see
code below) and there were some javascript functions inside the same
file that were stopping the swf file to be loaded inside IE6. So we
had to check the functions one by one to see which ones were stopping
the swf to load.

hope this will help someone else .

Cheers!

var cmdpaginaflash = $('#flashvar_cmd').val();
var langpaginaflash = $('#lang').val();

// Menu
$('.nav').flash({
swf: 'swf/nav.swf',
width: 208,
height: 231,
wmode: 'transparent',
expressInstall: true,
flashvars: {
cmd: cmdpaginaflash,
lang: langpaginaflash
}
});

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


Re: [Flashcoders] panels / workspace CS4 bug

2009-09-18 Thread Isaac Alves
Pedro, that works, but this way I´m forced to always have this actions
buttons on the screen (when I press F9) and that is quite boring ,
cause (at least for me) it stands in front of important stuff . I ´m
used to F9 to open /close the acitons panel.

I´ll give a try on FlashDevelop!

thanks everyone for replying,
cheers

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


[Flashcoders] RE: listener (completeHandler ) doesn´t run after file is loaded.

2009-09-17 Thread Isaac Alves
solved.

I was using an instance of Loader class to load a XML file, when i
should use an instance of URLLoader class.

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


[Flashcoders] panels / workspace CS4 bug

2009-09-17 Thread Isaac Alves
why my actions panel on flash cs4 often gets its height (I don´t know
how ), higher than the screen height in a way i cannot resize it back
?

Thus, the only way out of this is reseting a default workspace, and
then I lose my saved workspace.

does it happens to you people too?
maybe I should try the flashBuilder...

thanks !!

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


[Flashcoders] listener (completeHandler) does n´t run after file is loaded.

2009-09-16 Thread Isaac Alves
hi list, i-m getting completely insane cause of an as3 problem.

i-ve never had this problem before.

in the code below , I try to load 2 XML files.
the first one gets loaded and the loaderCompleteHander function runs
normally after the event completion.

but the  loaderCompleteHander2 function doesn´t run at all.
the xml gets loaded, as I-ve checked with the progressListener function.
I-ve tried manythings. for example , removing all code concerning the
first xml to be loaded. or switching both xml files, tried different
codes. I-m getting insane, cause it-s something very basic.
code:

var topURLRequest:URLRequest = new URLRequest(topPath);
topLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loaderCompleteHandler);
topLoader.load(topURLRequest);

var textSlideshowReq:URLRequest = new URLRequest(textSlideshowPath);
textSlideshowLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loaderCompleteHandler2);
textSlideshowLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
progressListener);
textSlideshowLoader.load(textSlideshowReq);

private function loaderCompleteHandler2(e:Event):void
{
trace ( RU);
}

no RUN.
please help.
Isaac

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


[Flashcoders] RE: listener (completeHandler ) doesn´t run after file is loaded.

2009-09-16 Thread Isaac Alves
well, solved... though it remains a mystery that bugs me.

function progressListener (e:ProgressEvent):void
{
trace(Downloaded  + e.bytesLoaded +  out of  + 
e.bytesTotal +  bytes);
if ( e.bytesLoaded == e.bytesTotal)
{
loaderCompleteHandler2(null);
}
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help. mouseEvent doesn´t work o n SWF loaded with JavaScript.

2009-09-15 Thread Isaac Alves
solved !!
 xml problem...
thanks .
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] RE: Re: time based smooth animation w/ GTween. HELP! (Jack Doyle)

2009-09-15 Thread Isaac Alves
Hi Jack,

Thank you for the explanations. I've been gradually changing to
TweenLite  TweenMax, and so far I'm very happy with it, I've achieved
good results with the filter tween and color matrix.  yoyo's really
cool too.

About that other situation, I was trying to have a time-based tween
animation, in order to have a smoother animation . I guess I
misunderstood the renderTime method. I wanted the flash player to
render the tween each 10ms. (cause with a 30fps frame rate, it would
render each 33ms, right? ) just to see what happened... the default
timing mode is frame based, right ?

cheers!

Hey Isaac. What exactly are you trying to accomplish with the
renderTime(10)? Your example tween was only 1 second long, so where does the
10 come from? If you want to skip to a certain time in a TweenMax tween,
make sure you're using the latest v11 (http://blog.greensock.com/v11beta/)
and just set the currentTime property like myTween.currentTime = 10 would
make it go to the 10-second point. Or use the currentProgress property
(always between 0 and 1 where 0.5 is halfway finished) like
myTween.currentProgress = 0.5. Don’t use renderTime() - use the currentTime,
currentProgress, totalTime, or totalProgress getters/setters. The
convenience of these getters/setters is that they can easily be tweened for
advanced effects.

And there's an easier way to accomplish your repeatReverse() functionality.
Just use the yoyo and repeat features like:

var plantaTween:TweenMax = new TweenMax(planta, 1, {y:414, repeat:1,
yoyo:true, ease:Sine.easeInOut});

That'll repeat it once and since yoyo is true, it'll play forward the first
time through and backwards the second time through.

Full ASDoc documentation is at http://www.greensock.com/as/docs/tween/

Again, make sure you've got v11: http://blog.greensock.com/v11beta/. Feel
free to use the forums at http://forums.greensock.com for these types of
questions. I try to be pretty active in responding there.

Jack

PS For the record, TweenLite/Max does NOT use a Timer to drive updates. It's
ENTER_FRAME driven which is generally optimal for many reasons (I won't bore
you with an explanation here). You can have any tween base its timing on
frames instead of time if you prefer (new in v11) by setting useFrames:true.

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


[Flashcoders] RE: retreieving a node that contains a specific attribute from an XML list

2009-09-13 Thread Isaac Alves
Hi,

thank you all.

I've managed to do it like this, based on what Cor wrote me:

function clickItemTitle(e:Event):void {
_link = String(e.target.frameLink);

var node:int;

for (var i:Number = 0; i  conteudo.length(); i++)
{
if (conteudo[...@id == _link)
{
node = i;
}
}
trace (node:  + node);


then I just use conteudo[node] to access the content.

I was trying to do that without using a for loop ,  but maybe it
wouldn't be possible. anyway I believe there's no need to avoid a loop
here, even if there's 1200 nodes in my XML, right?

Allandt, I actually didn't understand the use of toXMLString(), at
least in this situation..

cheers!
isaac

--

Message: 5
Date: Sun, 13 Sep 2009 12:44:10 +0100
From: allandt bik-elliott alla...@gmail.com
Subject: Re: [Flashcoders] retreieving a node that contains a specific
   attribute   from an XML list.
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Message-ID: 51f4e795-f48c-4c62-8ffd-586daafb1...@gmail.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes

also if you're tracing xml, you could try trace(myXML.toXMLString());
which will make sure that even the root node of the xml is traced

a


On 13 Sep 2009, at 06:39, Cor wrote:

 Try this:

 trace (conteudo.slide[...@id);
 trace (conteudo.slide[...@id);
 trace (conteudo.slide[0].tit);



 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of
 Isaac Alves
 Sent: zondag 13 september 2009 2:00
 To: flashcoders@chattyfig.figleaf.com
 Subject: [Flashcoders] retreieving a node that contains a specific
 attribute
 from an XML list.

 I have an XMLList  and I would like to retrieve a node in this list
 that contain a specfic attribute.

 here is how my XMLlist conteudo is organized. trace (conteudo)
 throws:

 slide id=apresentacao
  titApresentação/tit
  txt (lots of text...)/txt
 /slide
 slide id=sumario
  titApresentação/tit
  txt (lots of text...)/txt
 /slide
 etc...

 I've tried the following ways:

 //gets all nodes that contain the attribue id.  that is , the same
 as trace(conteudo), cause every node contain an
 //  id attribute. i don't need them all to contain the
 attribute, but i've made so, trying to avoid errors. so there a lot of
 //  nodes in which the id attribute is equal to  .
 //trace (conteudo.(hasOwnProperty(@id));

 //this one doesn't throws an error, but doesn't retrieve anything
 //trace (conteudo.(hasOwnProperty(@id == apresentacao)));

 //throws the error:   ReferenceError: Error #1065: A variável
 apresentacao não foi definida. (variable not defined)
 //trace (conteudo.(hasOwnProperty(@id == apresentacao)));

 //  same reference error...
 //trace (conteudo.(hasOwnProperty(@id == apresentacao)));

 //   why it doesn't work like this? same reference errpr
 //trace (node i want:  + conteudo.(@id == apresentacao));

 //  this one doesn't throws an error, but doesn't retrieve
 anything
 //trace (vamo ve:  + conteudo.(@id == apresentacao));

 //throws all the attributes @id that exist inside the xmllist,
 concatenated
 //trace ( + conteu...@id);

 //again, here it throws all the attributes @id that exist inside
 the xmllist , concatenated
 //if (conteudo.(hasOwnProperty(@id == apresentacao)))
 //{
 //trace (tem o id: );
 //trace (conteu...@id);
 //}

 help please!!

 ___
 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

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


[Flashcoders] retreieving a node that contains a specific attribute from an XML list.

2009-09-12 Thread Isaac Alves
I have an XMLList  and I would like to retrieve a node in this list
that contain a specfic attribute.

here is how my XMLlist conteudo is organized. trace (conteudo) throws:

slide id=apresentacao
  titApresentação/tit
  txt (lots of text...)/txt
/slide
slide id=sumario
  titApresentação/tit
  txt (lots of text...)/txt
/slide
etc...

I've tried the following ways:

//  gets all nodes that contain the attribue id.  that is , the same
as trace(conteudo), cause every node contain an
//  id attribute. i don't need them all to contain the
attribute, but i've made so, trying to avoid errors. so there a lot of
//  nodes in which the id attribute is equal to  .
//  trace (conteudo.(hasOwnProperty(@id));

//  this one doesn't throws an error, but doesn't retrieve anything
//  trace (conteudo.(hasOwnProperty(@id == apresentacao)));

//  throws the error:   ReferenceError: Error #1065: A variável
apresentacao não foi definida. (variable not defined)
//  trace (conteudo.(hasOwnProperty(@id == apresentacao)));

//  same reference error...
//  trace (conteudo.(hasOwnProperty(@id == apresentacao)));

//   why it doesn't work like this? same reference errpr
//  trace (node i want:  + conteudo.(@id == apresentacao));

//  this one doesn't throws an error, but doesn't retrieve anything
//  trace (vamo ve:  + conteudo.(@id == apresentacao));

//  throws all the attributes @id that exist inside the xmllist, 
concatenated
//  trace ( + conteu...@id);

//  again, here it throws all the attributes @id that exist inside
the xmllist , concatenated
//  if (conteudo.(hasOwnProperty(@id == apresentacao)))
//  {
//  trace (tem o id: );
//  trace (conteu...@id);
//  }

 help please!!

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


[Flashcoders] time based smooth animation w/ GTween. HELP!

2009-09-11 Thread Isaac Alves
Hello!

I would like to create a time based and very smooth animation with
GTween (or another one).
But I´m used to GTween , though.

here is my code:

var plantaTween = new GTween(planta, 1.5, {y: 414}, {delay: 0.8,
reversed: true, reflect: true, repeat: 999, ease:Quartic.easeInOut});

I´ve read the following examples in Gtween´s documentation and
somewhere else but i can-t quite understand it ..

 GTween.timingMode = GTween.TIME;

at http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html

should I use:
  plantaTween.timingMode = GTween.TIME;
or:
  GTween.timingMode = GTween.TIME; ?

What does the latter exactly means? it doesn´t do nothing. maybe cause
the default timeInterval property is 25ms. how do i set it ?

the first one throws a reference error Error #1056:

and i-ve seen this also at the documentation
http://www.gskinner.com/libraries/gtween/docs/

 Implementation
 public static function get timeInterval():uint
 public function set timeInterval(value:uint):void

 Implementation
 public static function get timingMode():String
 public function set timingMode(value:String):void

but cannot figure out how to implement it...

help ! thanks !

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


[Flashcoders] Re: slideshow works w/ ctrl Enter in Flash but not when exported....

2009-09-11 Thread Isaac Alves
solved . it is a problem with GTween  completeListener parameter.

it had a function in it , as:  completeListener: function () {bla bal
bla bla }

usually doesn´t work.

so i did:

completeListener: someFunction

and then declared the function somewhre else.

thanks!
cheers

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


[Flashcoders] slideshow works w/ ctrl Enter in Flash but not when exported....

2009-09-10 Thread Isaac Alves
Hello,

I have a FLA project with a slideshow .

When I test movie inside Flash (by pressing ctrl + enter), the
slideshow works well.

But if i run the .swf file  outside of Flash interface , it doesn´t
work, it doesn´t change the images.

Why ? How can it happen?

Thanks!

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


[Flashcoders] 1120: Access of undefined property

2009-09-03 Thread Isaac Alves
could someone please tell me why in the following script , the flash
runtime doesn´t recognize the var counter?
1120: Access of undefined property counter.

package
{
  public class StringUtils
  { 
public var counter:int = 0;

public static function generateRandomString(newLength:uint = 1,
userAlphabet:String =
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789):String
{
trace (counter);

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


[Flashcoders] smoothly rotating a dynamic loaded image with AS2

2009-09-02 Thread Isaac Alves
Hello list, i-d like to smoothly rotate an image loaded in an as2 swf file.
no tween, just rotate and leave it there.
it doesn´t work. i´ve tried lot of things and no success. actually i-m
used to as2, i don´t understand as2 very well.

here is the code:

mcBanner2.loadMovie(linksBanners[1]);

var bitmap:BitmapData=new
BitmapData(mcBanner2._width,mcBanner2._height,true,0);

var charObj:Object=new Object();
charObj.rotation = -3;
var angle_in_radians = Math.PI * 2 * (charObj.rotation / 360);

var rotationMatrix:Matrix = new Matrix();
//  rotationMatrix.translate(-16,-16);
rotationMatrix.rotate(0.1);
//  rotationMatrix.translate(16,16);

var rectangleTrans:Transform = new Transform(mcBanner2);
rectangleTrans.matrix = rotationMatrix;

var myColorTransform:ColorTransform = new ColorTransform(0, 0, 1, 1,
0, 0, 255, 0);
var myRectangle:Rectangle = new Rectangle(0, 0, 100, 80);
var smooth:Boolean = true;

bitmap.draw(mcBanner2,rotationMatrix, myColorTransform, normal,
myRectangle, smooth);
//  mcBanner2._rotation=-3; // this doesn´t work.
mcBanner2.attachBitmap(bitmap,100,auto,true);
mcBanner2._xscale=100;
mcBanner2._yscale=100;

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


[Flashcoders] Re: a function tells to move to a frame and then update content in that frame

2009-08-28 Thread Isaac Alves
oops the code down there should be:

function updateContent(e:Event):void {

   container.gotoAndStop(2);

   link = String(e.target.frameLink);
   counter = 0;

   if (content[link].tit != undefined)
   {
   container._tit.text = content[link].tit;
   counter ++;
   }
   else
   {
   container._tit.text = ;
   }
etc...

2009/8/28 Isaac Alves isaacal...@gmail.com:
 Hello!

 In the following code, i tell the Flash runtime to go to frame2 and
 update the content of this frame.

 The problem is that, the first time this function runs it throws the error:

 TypeError: Error #1009:

 I believe that happens because it tries to update container._tit
 before render the screen, so it will be still in frame 1. It goes to
 frame 2 but doesn't update the _tit textfield.

 I've tried to solve it this way: instead of using gotoAndStop(2) i've
 called another functiion with that statement and updateAfterEvent();

 but it seems that it is not a method of the Event class.

 Any solution ??
 thanks in advance!!



 function updateContent(e:Event):void {

        gotoAndStop(2);

        link = String(e.target.frameLink);
        counter = 0;

        if (content[link].tit != undefined)
        {
                container._tit.text = content[link].tit;
                counter ++;
        }
        else
        {
                container._tit.text = ;
        }
 etc...


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


[Flashcoders] a function tells to move to a frame and then update content in that frame

2009-08-28 Thread Isaac Alves
Hello!

In the following code, i tell the Flash runtime to go to frame2 and
update the content of this frame.

The problem is that, the first time this function runs it throws the error:

TypeError: Error #1009:

I believe that happens because it tries to update container._tit
before render the screen, so it will be still in frame 1. It goes to
frame 2 but doesn't update the _tit textfield.

I've tried to solve it this way: instead of using gotoAndStop(2) i've
called another functiion with that statement and updateAfterEvent();

but it seems that it is not a method of the Event class.

Any solution ??
thanks in advance!!



function updateContent(e:Event):void {

gotoAndStop(2);

link = String(e.target.frameLink);
counter = 0;

if (content[link].tit != undefined)
{
container._tit.text = content[link].tit;
counter ++;
}
else
{
container._tit.text = ;
}
etc...
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: a function tells to move to a frame and then update content in that frame

2009-08-28 Thread Isaac Alves
HEy Jason, don't worry, that's not a porno web site.

tit is for title ..:D

if that's not the answer you were expecting,  it is not a website, it
is a powerpoint-like-presentation to be run off-line, with a whole
bunch of an endless content (that is, a terrible nightmare), that i
have to pick from .doc files.

so everything is in an xml file, and this function puts the content of
a specific element in the content.xml file and organizes it all on the
display list.

that was the only way i found to do this kind of job, otherwise (if i
put content directly into the .fla file)  the flash application gets
extremelly lagged and thus impossible to work, which was making me
completely insane .

so... that's i'mtrying to build this function that tells a certain
moviecli'p to go to a specific frame and then update content in that
frame, like searching text in an xml file and putting in the textfield
on that frame.

i'll have to do that because this updateContent function won't fit in
some specific frames of the presentation

thanks!


2009/8/28 Isaac Alves isaacal...@gmail.com:
 oops the code down there should be:

 function updateContent(e:Event):void {

       container.gotoAndStop(2);

       link = String(e.target.frameLink);
       counter = 0;

       if (content[link].tit != undefined)
       {
               container._tit.text = content[link].tit;
               counter ++;
       }
       else
       {
               container._tit.text = ;
       }
 etc...

 2009/8/28 Isaac Alves isaacal...@gmail.com:
 Hello!

 In the following code, i tell the Flash runtime to go to frame2 and
 update the content of this frame.

 The problem is that, the first time this function runs it throws the error:

 TypeError: Error #1009:

 I believe that happens because it tries to update container._tit
 before render the screen, so it will be still in frame 1. It goes to
 frame 2 but doesn't update the _tit textfield.

 I've tried to solve it this way: instead of using gotoAndStop(2) i've
 called another functiion with that statement and updateAfterEvent();

 but it seems that it is not a method of the Event class.

 Any solution ??
 thanks in advance!!



 function updateContent(e:Event):void {

        gotoAndStop(2);

        link = String(e.target.frameLink);
        counter = 0;

        if (content[link].tit != undefined)
        {
                container._tit.text = content[link].tit;
                counter ++;
        }
        else
        {
                container._tit.text = ;
        }
 etc...



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


[Flashcoders] Re: accessing a text node inside another node in a XMLList

2009-08-28 Thread Isaac Alves
I´ve realized actually that flash recognizes the XMLList as having 9
children, ignoring the tags slide

when I was expecting three children , each one of them with also 3
children ( the tags item).

Why?

2009/8/28 Isaac Alves isaacal...@gmail.com:
 Hello list,

 I have the following XML ( i get that by tracing
 tabsContentSlideshow which is a XMLList.
 I-d like to use something like

 tabsContentSlideshow[slide][1]

 slide is an integer, so for example, if the slide 2 is showing, this
 statement would return the first node item inside the second node
 slide, that is:

  item label=ss1_title link=# type=_selfSLIDE 2/item

 but it doesn´t work like that.
 how could I do it ??

 thanks in advance !


 slide
  item label=ss1_title link=# type=_selfCONECTE-SE/item
  item label=ss1_subtitleBem-vindo ao Conecte-se!/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide
 slide
  item label=ss1_title link=# type=_selfSLIDE 2/item
  item label=ss1_subtitleBem-vindo ao slide 2/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide
 slide
  item label=ss1_title link=# type=_selfSLIDE 3/item
  item label=ss1_subtitleBem-vindo ao slide 3/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide


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


[Flashcoders] accessing a text node inside another node in a XMLList

2009-08-28 Thread Isaac Alves
Hello list,

I have the following XML ( i get that by tracing
tabsContentSlideshow which is a XMLList.
I-d like to use something like

tabsContentSlideshow[slide][1]

slide is an integer, so for example, if the slide 2 is showing, this
statement would return the first node item inside the second node
slide, that is:

  item label=ss1_title link=# type=_selfSLIDE 2/item

but it doesn´t work like that.
how could I do it ??

thanks in advance !


slide
  item label=ss1_title link=# type=_selfCONECTE-SE/item
  item label=ss1_subtitleBem-vindo ao Conecte-se!/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
células, que se reúnem semanalmente. Nós oramos e desejamos que você
desenvolva bons relacionamentos, um propósito, envolvimento e encontre
alegria. Vamos servir ao Senhor juntos!/item
/slide
slide
  item label=ss1_title link=# type=_selfSLIDE 2/item
  item label=ss1_subtitleBem-vindo ao slide 2/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
células, que se reúnem semanalmente. Nós oramos e desejamos que você
desenvolva bons relacionamentos, um propósito, envolvimento e encontre
alegria. Vamos servir ao Senhor juntos!/item
/slide
slide
  item label=ss1_title link=# type=_selfSLIDE 3/item
  item label=ss1_subtitleBem-vindo ao slide 3/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
células, que se reúnem semanalmente. Nós oramos e desejamos que você
desenvolva bons relacionamentos, um propósito, envolvimento e encontre
alegria. Vamos servir ao Senhor juntos!/item
/slide

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


[Flashcoders] Re: accessing a text node inside another node in a XMLList

2009-08-28 Thread Isaac Alves
Ok I´ve realized now something.

I had before in the script:
tabsContentSlideshow = myXML.slideshow.children();

I´ve replaced with:
tabsContentSlideshow = myXML.slideshow;

Then if i trace  tabsContentSlideshow.children()[0]  it will show :

slide
  item label=ss1_title link=# type=_selfCONECTE-SE/item
  item label=ss1_subtitleBem-vindo ao Conecte-se!/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
células, que se reúnem semanalmente. Nós oramos e desejamos que você
desenvolva bons relacionamentos, um propósito, envolvimento e encontre
alegria. Vamos servir ao Senhor juntos!/item
/slide

alright. now how can I retrieve the text that´s inside the tag item ??

ok i-ve just discovered:

trace (dfdf:  + tabsContentSlideshow.children()[0].item[1]);

:D

thank you people



2009/8/28 Isaac Alves isaacal...@gmail.com:
 I´ve realized actually that flash recognizes the XMLList as having 9
 children, ignoring the tags slide

 when I was expecting three children , each one of them with also 3
 children ( the tags item).

 Why?

 2009/8/28 Isaac Alves isaacal...@gmail.com:
 Hello list,

 I have the following XML ( i get that by tracing
 tabsContentSlideshow which is a XMLList.
 I-d like to use something like

 tabsContentSlideshow[slide][1]

 slide is an integer, so for example, if the slide 2 is showing, this
 statement would return the first node item inside the second node
 slide, that is:

  item label=ss1_title link=# type=_selfSLIDE 2/item

 but it doesn´t work like that.
 how could I do it ??

 thanks in advance !


 slide
  item label=ss1_title link=# type=_selfCONECTE-SE/item
  item label=ss1_subtitleBem-vindo ao Conecte-se!/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide
 slide
  item label=ss1_title link=# type=_selfSLIDE 2/item
  item label=ss1_subtitleBem-vindo ao slide 2/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide
 slide
  item label=ss1_title link=# type=_selfSLIDE 3/item
  item label=ss1_subtitleBem-vindo ao slide 3/item
  item label=ss1_textAqui você encontra vida! Grupos pequenos,
 células, que se reúnem semanalmente. Nós oramos e desejamos que você
 desenvolva bons relacionamentos, um propósito, envolvimento e encontre
 alegria. Vamos servir ao Senhor juntos!/item
 /slide



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


[Flashcoders] help with frame navigation and xml

2009-08-26 Thread Isaac Alves
Hi,

I'd like to have a function that tells a MovieClip to go to a specific
frame and then in this frame, look for a scpecific tag in an XML file,
based on the frame's label, and then take some text (a  bunch of
actually) that is in the XML node and put it on a TextField.

For example, clicking on a Next Frame button it will go to the next
frame (which has a label intro) of the movieclip and then search
content.xml for the tag that contains the attribute name equal to
intro and then put the content of the @text node into an empty
TextField that is already positioned in this intro frame.

Am I obligated to have the code in this specfic frame?

I'm doing it because if I have too much text within textfields in an
FLA file it becomes incredibly lagged and therefore impossible to
work.

I've tried to use the event ENTER.FRAME to do that but it rendered the
SWF lagged and consomming way too much memory...

Help !! Thanks in advance!!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] buttons not able to control movieclip's timeline

2009-08-13 Thread Isaac Alves
 i have 2 buttons (prev  and next) that should control the timeline of a
moviclip called container

but it just doesn't work. at first it moves to the second frame on this
movieclip then the container shows always the same content ( it has
different content for each frame), the content of the second frame.

though ,  the output panel shows:

prev. cf: 2
next. cf: 1

function btnContainerClick(e:MouseEvent):void
{
if (e.target.name == btn_prev)
trace (prev. cf:  + container.currentFrame);
//container.gotoAndStop(container.currentFrame - 1);
  container.prevFrame();
//container.gotoAndStop(2);

if (e.target.name == btn_next)
trace (next. cf:  + container.currentFrame);
//container.gotoAndStop(container.currentFrame + 1);
  container.nextFrame();
//container.gotoAndStop(5);
}

i get absolutely no clue of what's going on and i'm getting nuts.
i really appreciate any help. thanks a lot.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] manage conent of multiple frames with a single framescript

2009-08-06 Thread Isaac Alves
I would lke to know if I can manage the content of multiple frames without
having to create a script for each frame.

project:
This is part of a type of powerpoint style presentation in flash. another
time I'll certainly try to do it by loading everything in the XML, and no
frame Nav. then the listener should not only tween the textfields and
movieclips, but also get the values of these objects by xml.

a mouse click calls a function that fades out a textfield in a frame, go to
another frame and fades in the textfield that is in that frame.

 Code:

function changeFrame(e):void
{
if (_txt){
new GTween(_txt, 0.3 ,{alpha:0});
}
var timer:Timer = new Timer(300, 1);
timer.addEventListener(TimerEvent.TIMER, function(){
e.target.addEventListener(Event.ENTER_FRAME, updateFrame);
gotoAndStop(e.target.frameLink);
   });
timer.start();
}

function updateFrame(e:Event):void
{

if (_txt){
_txt.alpha =0;
new GTween(_txt, fadeDuration ,{alpha:1});

}

e.target.removeEventListener(Event.ENTER_FRAME, updateFrame);
timer.reset();
}

problem:
when it changes frame, the actual movieclip or textfield will be there with
alpha 1. so it blinks, between the two alpha animations.

conditions:
the fade should function with many movieclips, some of which won't exist in
every frame, that's why the verification ( if (!_txt)... ) But for the
moment I'm doing it like this.

I surely don't want to write scripts in every frame, so that's the reason I
wrote the code like this.

And anyway, I somehow feel that I shouldn't do it that way. What do you
people think about it ?

Thanks in advance !
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: Flashcoders Digest, Vol 22, Issue 32

2009-07-30 Thread Isaac Alves
i-ve just done that , it worked out well  thanks!


 The last time I came across this problem, I used an MOUSE_MOVE loop to
 check everytime if the x and y mouse positions were inside the stage
 area, and if not I called the same function that should be called on the
 MOUSE_LEAVE event...

 Ruy Adorno
 http://www.ruyadorno.com

 Isaac Alves wrote:
  Hello,
 
  Is there any workaround to the issue with Adobe Flash where a Flash Movie
  does not receive a MOUSE_LEAVE event if the mouse is dragged outside of
 the
  movie? Neither when i MOUSE_UP outside the stage.
 
  stage.addEventListener(Event.MOUSE_LEAVE, dropIt);
 
  function dropIt(e1:MouseEvent = null, e2:Event = null):void {
  textField.text =  OK ;  // extreme debug method
  full_mc.stopDrag();
  stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
  stage.removeEventListener(Event.MOUSE_LEAVE, dropIt);
  }
 
  That actually works when I run the SWF file, and even on IE.
 
  But on Firefox and Chrome nothing happens, it continues dragging the
  MovieClip when the cursor returns to stage. The dropIt function doesn´t
 run
  ( the textField.text doesn´t update)
 
  Thanks a lot!
  Isaac




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


[Flashcoders] as3 -re-dimensioning spirte but not its children

2009-07-29 Thread Isaac Alves
Hi list,

Is it possible to alter the width or height of a sprite dynamically without
altering the width and height of its children ?

Even when I add children to a Sprite that had its dimensions altered
dynamically, these children have their dimensions changed.

Could I do something like sprite.resetScaleXandY ?

What do you suggest in this kind of situation?

Thanks in advance,
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Flash doesn´t detect MOUSE_LEAV E event while dragging outside stage on Firefox

2009-07-28 Thread Isaac Alves
Hello,

Is there any workaround to the issue with Adobe Flash where a Flash Movie
does not receive a MOUSE_LEAVE event if the mouse is dragged outside of the
movie? Neither when i MOUSE_UP outside the stage.

stage.addEventListener(Event.MOUSE_LEAVE, dropIt);

function dropIt(e1:MouseEvent = null, e2:Event = null):void {
textField.text =  OK ;  // extreme debug method
full_mc.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
stage.removeEventListener(Event.MOUSE_LEAVE, dropIt);
}

That actually works when I run the SWF file, and even on IE.

But on Firefox and Chrome nothing happens, it continues dragging the
MovieClip when the cursor returns to stage. The dropIt function doesn´t run
( the textField.text doesn´t update)

Thanks a lot!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] problem with a 2 level menu

2009-07-24 Thread Isaac Alves
Hello ! I'm trying to build a 2 level menu, and its submenus are quite big,
they contain a lot of sub-items.

I'm trying to find a simple way to do it (actually I just want that it work)
, but I'm having lots of problems.

As you will be able to see in the code below, I'm placing the dynamically
created subMenu mc inside the menuItem mc.

Each aba mc should get their width and height according to the w and h of
the subMenu it contains.

i've erased the biggest part of the code so I can concentrate in this
problem.

you can see it here: http://iialves.com/apres/
here is the code:

var xmlPath:String = menu.xml;
var myXMLLoader:URLLoader = new URLLoader();
var menuItems:XMLList;
var totalMenuItems:int;

var menu_mc:MovieClip = new MovieClip();
var square:MovieClip;
var menuArray:Array = new Array;
//var subMenuArray:Array = new Array;

var itemWidth:Number;

// MENU (INDEX)
function processXML (e:Event):void{
var myXML:XML = new XML(e.target.data);
//myXML.ignoreWhitespace = true;
menuItems = myXML.children(); //substitui myXML.IMAGE; parece fazer a
mesma coisa
totalMenuItems = menuItems.length();
myXMLLoader.removeEventListener(Event.COMPLETE, processXML);
myXMLLoader = null;
iniciarMenu();
}

function iniciarMenu ():void{
for (var i:Number = 0; i  totalMenuItems; i++){

var menuItem:MenuItem = new MenuItem();
menuItem.bt_title._txt.autoSize =  TextFieldAutoSize.LEFT;
menuItem.bt_title._txt.text = menuitems[...@label;
menuItem.bt_title._txt.antiAliasType = AntiAliasType.ADVANCED;

itemWidth = stage.stageWidth/totalMenuItems;
menuItem.menufill.width = itemWidth;

menuItem.x = i*(stage.stageWidth/totalMenuItems);

menuItem.mouseChildren = true;
menuItem.bt_title.mouseEnabled = false;
menuItem.bt_title.mouseChildren = false;
menuItem.menufill.mouseEnabled = false;
menuItem.aba.mouseEnabled = false;

menuItem.indice = i;

var subMenu:MovieClip = new MovieClip();
subMenu.name = sub_menu;  // Is there something wrong with this?
subMenu.alpha = 0;
subMenu.visible = false;
subMenu.mouseChildren = false;
//subMenu.mouseEnabled = false;

menuItem.addChild(subMenu);

menuArray[i] = menuItem;
menu_mc.addChild(menuItem);

createSubMenu(i);

menuItem.aba.alpha = 0;
menuItem.aba.width = subMenu.width;
menuItem.aba.height = 45 + subMenu.height;


//subMenu.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSub);
}

menu_mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
menu_mc.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
menu_mc.addEventListener(MouseEvent.CLICK, itemClicked);

//stage.dispatchEvent(new Event(Event.RESIZE));
}

function createSubMenu(i:int):void{
var subItems:XMLList = menuItems[i].children();

var rows:int = 11;
var yCounter:Number = 0;
var xCounter:Number = 0;

for (var j:Number = 0; j  subItems.length(); j++){

var subMenuItem:SubMenuItem = new SubMenuItem();
subMenuItem.bt_title._txt.autoSize =  TextFieldAutoSize.LEFT;
subMenuItem.bt_title._txt.text = subItems[j];

if (subitems[...@level == 1){
subMenuItem.bt_title._txt.textColor = 0xCC;
}
if (subitems[...@level == 2){
subMenuItem.bt_title._txt.textColor = 0xD0F858;
}
if (subitems[...@level == 3){
subMenuItem.bt_title._txt.x += 10;
}

subMenuItem.bt_title._txt.antiAliasType = AntiAliasType.ADVANCED;

subMenuItem.y = 45 + yCounter*(subMenuItem.height);
subMenuItem.x = xCounter*subMenuItem.width;

//subMenuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSub);

if (yCounter  rows){
yCounter = 0;
xCounter ++;
} else{
yCounter ++;
}

subMenuItem.mouseChildren = false;
//subMenuItem.mouseEnabled = false;

// getChildAt(3) refers to the the movieclip sub_menu
// because menuArray[i].sub_menu returns undefined. why?
menuArray[i].getChildAt(3).addChild(subMenuItem);

}
//subMenu.addEventListener(MouseEvent.MOUSE_OVER, mouseOverSub);
}

function mouseOverSub(e:MouseEvent):void {
trace ( MOUSE OVER SUBMENU ITEM FINALLY WORKS );
}

function mouseOverItem(e:Event):void {
var item:MenuItem = e.target as MenuItem;

trace (ch2.name:  + item.getChildAt(2).name); //returns bt_title
trace (item.bt_title); //returns [object MovieClip]  great.
trace (ch3.name:  + item.getChildAt(3).name); //returns sub_menu
trace (item.sub_menu); //returns undefined   WHY

item.aba.visible = true;
item.aba.alpha = 1;
item.getChildAt(3).visible = true;
item.getChildAt(3).alpha = 1;
}

function mouseOutItem(e:Event):void {
var item:MenuItem = e.target as MenuItem;

item.aba.visible = false;

[Flashcoders] Re: Flashcoders Digest, Vol 22, Issue 26

2009-07-24 Thread Isaac Alves
Actually this is no lockroot problem, like I thought it was for a moment.
A friend told me it might be that but after a little thinking its clear that
it isn´t . cause  this gets the same movieclip.  it is then really weird
for me why does it returns different number of children 
 ok
i´ve solved the problem.

this function was called by the top.swf timeline as:  infoBox.intro();

when running top.swf ok. but when running preloader.swf  that will load
top.swf, it didn´t work.

What is the problem in calling a function (from main time line of swf Y)
that is in a movieclipZ ( that´s inside the maintime line of Y), and then
have a swf X loading the swf Y??

Thanks!


 Hi fellows, I´m having a weird problem here:

 This code is inside the movieclip Info_1, which is a child of the stage
 in
 top.swf.

 function intro():void{
trace (this:  + this);
trace (thischldren:  + this.numChildren);
trace (child 0:  + this.getChildAt(0));
trace (child 0name:  + this.getChildAt(0).name);
 (...)

 and i-m using is a preloader.swf that loads top.swf.
 when running  top.swf it traces:

 this: [object Info_1]
 thischldren: 9
 child 0: [object MovieClip]
 child 0name: faixa
 12988

 when running  preloader.swf it traces:

 this: [object Info_1]
 thischldren: 1
 child 0: [object Shape]
 child 0name: instance6
 18669

 as you can see, the object faixa as well as many others are unacessible
 when I execute preloader.swf.
 any clue why that happens ??
 thanks !!
 isaac


 --

 Message: 4
 Date: Thu, 23 Jul 2009 15:17:45 -0300
 From: Isaac Alves isaacal...@gmail.com
 Subject: [Flashcoders] accessing movieclips, problem using preloader
 To: flashcoders@chattyfig.figleaf.com
 Message-ID:
9719fa510907231117p5865f79ay15f24b66b0a53...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 it worked with MovieClip(parent).

 im looking now for something like lockRoot   for as3
 any clue how could I handle this?

 thanks!
 isaac


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


[Flashcoders] accessing movieclips, problem using preloader

2009-07-23 Thread Isaac Alves
Hi fellows, I´m having a weird problem here:

This code is inside the movieclip Info_1, which is a child of the stage in
top.swf.

function intro():void{
trace (this:  + this);
trace (thischldren:  + this.numChildren);
trace (child 0:  + this.getChildAt(0));
trace (child 0name:  + this.getChildAt(0).name);
(...)

and i-m using is a preloader.swf that loads top.swf.
when running  top.swf it traces:

this: [object Info_1]
thischldren: 9
child 0: [object MovieClip]
child 0name: faixa
12988

when running  preloader.swf it traces:

this: [object Info_1]
thischldren: 1
child 0: [object Shape]
child 0name: instance6
18669

as you can see, the object faixa as well as many others are unacessible
when I execute preloader.swf.
any clue why that happens ??
thanks !!
isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] accessing movieclips, problem using preloader

2009-07-23 Thread Isaac Alves
it worked with MovieClip(parent).

im looking now for something like lockRoot   for as3
any clue how could I handle this?

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


[Flashcoders] understanding a simpe statement 2

2009-07-13 Thread Isaac Alves
I would like to understand that one too:

maxH = maxH == 0 ? maxW : maxH;

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


[Flashcoders] understanding a simpe statement

2009-07-13 Thread Isaac Alves
Hello fellows.

I know it probably sounds dumb , but I'm having a hard time understanding
this statement

mc.scaleX  mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;

Would that mean something like:

if (mc.scaleX  mc.scale){
 mc.scaleY = mc.scaleX
} else if if (mc.scaleX  mc.scale){
 mc.scaleX = mc.scaleY;
}

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


[Flashcoders] problems accessing a MovieClip / display list issue

2009-07-03 Thread Isaac Alves
Problems trying to access a MovieClip that contains a dynamically loaded
image, inside dynamically created menu items.

I hope the code is self explanatory !

function mouseOverItem(e:Event):void {
var item:MenuItem = e.target as MenuItem;
 trace (item.getChildAt(3).name);
trace (item.getChildAt(3));
trace (item.bt_title);
 trace (item.getChildAt(4).name);
trace (item.getChildAt(4));
trace (item.icone);

new GTween(item.bt_title, 0.3, {y:25}, easing1);
new GTween(item.bt_subtitle, 0.3, {y:25}, easing1);
new GTween(item.icone, 0.3, {y:100}, easing1);/*/ doesn´t work!!
*


*The tracing output this:*

bt_title
[object MovieClip]
[object MovieClip]
icone
[object MovieClip]
undefined

*QUESTION: Why do i get undefined? shouldn´t I get  [object MovieClip]
instead ?*

Thanks!!

In case this code is not clear:

function iniciarMenu ():void{

for (var i:Number = 0; i  my_total; i++){

var menuItem:MenuItem = new MenuItem();
menuItem.x = (menuItem.width + 2)*i;
menuItem.bt_title._txt.text = my_items[...@title;
menuItem.bt_title._txt.antiAliasType = AntiAliasType.ADVANCED;
menuItem.bt_subtitle._txt.text = my_items[...@subtitle;
menuItem.bt_subtitle._txt.antiAliasType = AntiAliasType.ADVANCED;

menuItem.linkTo = my_items[...@link;
menuItem.mouseChildren = false;

menuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
menuItem.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);

menu_mc.addChild(menuItem);
menuArray[i] = menuItem;

var iconURL = my_items[...@icon;
var iconLoader = new Loader();
iconLoader.load(new URLRequest(iconURL));
iconLoader.name = i;
iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, iconLoaded);

}
}

function iconLoaded(e:Event):void{
var my_icon:Loader = Loader(e.target.loader);
var iconMC:MovieClip = new MovieClip();
iconMC.addChild(my_icon);
menuArray[my_icon.name].addChild(iconMC);

iconMC.x = 100;
iconMC.y = 35;
iconMC.alpha = 0;
iconMC.name = icone;
new GTween(iconMC, 0.9, {alpha:0.8}, easing1);
 my_icon.contentLoaderInfo.removeEventListener(Event.COMPLETE, iconLoaded);
my_icon = null;
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Output Panel Language

2009-06-30 Thread Isaac Alves
Hello,
I've got my Flash installed in engilsh but the output panel's shows up
messages in portuguese! I How do I set it up to English?

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


[Flashcoders] Error #1009 shows randomly

2009-06-30 Thread Isaac Alves
Hello fellows,
I've bought at Flash Den a code of an Infinite Level Menu (from MBMedia) and
I'm pulling my hair out.

It throws that well known error as the text of the button doesn't show when
it should:

“TypeError: Error #1009: cannot access a  property or method of a null
object reference. at local.display:rimaryButton/frame7()”
That without touching the code or elements on the stage. Actually, if inside
the main.fla file, I go inside the Expanding Menu and then inside the
Primary Button MovieClip and select the text field and at that point I test
the movie, it works correctly. As long as I leave the Primary Button
movieclip and test the movie, it throws that error again!

Obs: It is not actually  randomly that it  throws that error. I've tried a
thousand times to test the movie within a certain state  , that means,foe
example, when I'm iinside a certain movieclip  with the textfield selected.
and in that specific situation it always throws (or not) the error.

You know, I select a movieclip , test Movie and it works. I deselect it,
test movie  and it doesn't . Its seems like a bug... that's very bizarre.

Please help !!!
Thanks a lot,
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] array.indexOf problem

2009-06-16 Thread Isaac Alves
Hi fellows,
Cannot solve this problem:

function buttonClicked(e:Event):void {
 trace (buttonsArray.indexOf(e.target.name));

It always  traces -1. This code should trace the index of the Array
element right? for ex: 0, 1, 2 or 3.

If i do this, it will trace the correct name of the element.

function buttonClicked(e:Event):void {
 trace (e.target.name);

If I do this, it will trace the name of the second element:

function buttonClicked(e:Event):void {
 trace (buttonsArray[1].name);

Why indexOf doesn´t work properly?

Thanks a lot!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: Loading images at the same time, bugs in Flash AS3 (Anthony Pace)

2009-06-06 Thread Isaac Alves
I couldn't send the .rar file with the code to the list...so I'm sending
just the text this time!Thanks in advance,
Isaac

2009/6/4 Isaac Alves isaacal...@gmail.com

 Thanks Anthony and Jordan for your responses, I´ll send you the files so
 you can look around if you have the time.
 I´ve reorganized the loading objects so they load now in queue. The small
 thumbs, the big ones , then the full images.
 But eventually the user will click in a thumbnail in order to load an image
 that it´s not yet loaded, so at this moment I believe that it will be forced
 to load 2 images at the same time ( and even a lot, if an user decides to
 click in many thumbs in a row,  especially with a slow internet connection
 !)

 I´d like to know also how could I do the housekeeping , after loading the
 images... I´ve tried to set some variables to  null but it doesn´t work...
 and I´ve tried not to forget to remove the unnecessary listeners.

 So, again , thanks a lot !
 Isaac

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


[Flashcoders] Loading images at the same time, bugs in Flash AS3

2009-06-03 Thread Isaac Alves
Hello fellowcoders,
I've been experiencing some problems with an application I've made with AS3.
It consists of an image gallery which loads images dynamically from an XML
file.

Maybe you'd want to skip my explanations and go directly to the problem in
the bottom of this message.

Since it's my first experience with AS3 - apart from doing some basic AS3
tutorials and other not so simple but still very simple stuff with AS2 a
couple of years ago - it is absolutely not written in the simplest and more
effective manner.

For example, I've changed the code lots of times. For example, redefining
the way the images were loaded. At the beginning they were loaded by
clicking on the thumbnails. So if I clicked on the thumb of an image that
were already loaded, it would load it again. Now it works like that:

There are 3 arrays of images (for the thumbnails, big thumbnails and full
images).
So these three sequences of images start loading at the same time, and
placing the images as elements in the arrays in order to be more easily
handled (to my point of view).
Naturally the thumbnails finish loading first. If I click on a thumbnail
whose corresponding image is not yet loaded, It starts loading it. And then
when the function that keeps running to load all the full images gets to it,
it skips it.

There are lots of other things I could have done better for example, placing
many of the elements inside of a movieclip, for example a bar which would
contain all the elements of the thumbnail mechanismus ( containers, masks,
buttons). I've tried that but it was maybe too late, for it was difficult
cause I had many references to those elements with in the code.

There's no document class, and 80% of the code is written in one frame.
Actually I don't know how I could write this whole thing using different
class files, for example, cause it would have many cross-references, etc.
But I would like to know how to do it!

So the main problems are the following:


   1. Sometimes (randomly) the array ot thumbnails stop loading. It gets
   stuck in a certain thumbnail, showing the preloader movieclip forever.
   2. Another problem is that the browser's window simply closes itself by
   clicking on an item in the menu, that happend in Safari and Firefox.
   3. Another problems occur with the menu (the icon moves up and not the
   square behind it, or the whole thing gets stuck.

Any help will be appreciated !

You can check it out on this link: http://iialves.com/hive/

I've probably put this version one week ago, so I've been unpdating it since
then. But it remais something very close to that.

Now I should go cause I'm late to work.
Thanks a lot!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] problem with simple preloading, nothing appears on screen

2009-05-25 Thread Isaac Alves
Thanks Juan Pablo and Steven for the solution, it was very helpful!
I'm struggling now with a weird problem:

I've put an animation on frame 1 that keeps running in loop until the whole
SWF file is loaded and the player moves to frame 2. Here is the code:

trace ( hello );
addEventListener(Event.ENTER_FRAME, loading);

function loading(event:Event) {
var bytestotal=stage.loaderInfo.bytesTotal;
var bytesloaded=stage.loaderInfo.bytesLoaded;
trace(Math.round(bytesloaded*100/bytestotal)+%);
if (bytesloaded=bytestotal) {
removeChild(loaderAnimation);
gotoAndStop(2);
removeEventListener(Event.ENTER_FRAME, loading);
}
}

stop();


When I simulate download and play the program, the screen remains blank for
some seconds, even though the file is already loading:
The loading animation only appears on the screen (as well as the word
hello is traced) when the file it's about 70% loaded, and then I see the
percentage moving up in the Output panel.
Why does it happens? The size of the file is 80kb. I've already tried
putting this code into a different scene in the same swf file but the same
thing happens. Someone has a clue?

thanks a lot!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] calling an event function with a parameter that is a number

2009-05-23 Thread Isaac Alves
Hello!
In my code there's a function that shows an image on the screen (or load the
image and show a progress bar) that is called by clicking on a thumbnail,
and uses a parameter [e.target.name] refering to the property name of the
thumbnail clicked, which is an integer. The thumbnails are placed inside the
cointaner_mc MovieClip.

container_mc.addEventListener(MouseEvent.CLICK, clickThumb);

function clickThumb(e:MouseEvent):void{
if (my_full_images[e.target.name] == undefined){
var full_url = my_images[e.target.nam...@full;

etc...

but I want to call this function by clicking on a button, which would need
to pass another type of parameter, in this case, a variable which refers to
the number of the image displayed on the screen plus one.

I tried this:

clickThumb(image_num + 1)

But it doesn't work, I get the following error:

1067: Implicit coercion of a value of type Number to an unrelated type
flash.events:MouseEvent.

How could I call the function clickThumb and make it use image_num + 1
instead of e.target.name ?

Could I dispatch the event (MouseEvent.CLICK, clickThumb), passing this
value  image_num + 1 ?

Thanks in advance !!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders