[Flashcoders] control flv playback speed

2007-09-12 Thread Helen Triolo
Is there any way to let the user control the playback speed of a flv in 
Flash?   And even better, is there any way to change the playback speed 
without changing the audio pitch (as can be done with Quicktime)?


thx,
Helen



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] LoadVars.sendAndLoad failing don't know why

2007-08-15 Thread Helen Triolo

Are you testing from the IDE or live?  You can't do a POST from the IDE.

Helen


Steven Sacks wrote:

If I use getURL() with a POST query string with arguments in the 
?param=fooparam2=bar, the server script responds with a success (true).


If I use sendAndLoad to the same exact URL and same exact arguments in 
the sender.param = foo; sender.param2=bar, the server script 
responds with a fail (false).


The server script response means the params were good, false means 
they were not. I cannot provide the URL for outside testing, 
unfortunately.


Here is my code.

var sender = new LoadVars();
var receiver = new LoadVars();
sender.dkw = INP_DeviceID.text;
sender.p = INP_Phone.text;
receiver.onLoad = function(success)
{
   if (success)
   {
   for (var a in this)
   {
   if (a != onLoad)
   {
   debug(response:  + a);
   }
   }
   }
   else
   {
   debug(failed to connect);
   }
};

// THIS GETS BACK A RESPONSE OF FALSE
sender.sendAndLoad(postURL, receiver, POST);

// THIS GETS BACK A RESPONSE OF TRUE (in the browser window)
getURL(postURL + ?dkw= + INP_DeviceID.text + p= + INP_Phone.text, 
_blank, POST);


Same exact thing.  Also, Firebug doesn't trace any arguments on the 
HTTP request from the sendAndLoad().


I've been using sendAndLoad for years. This is a big WTF for me.  Any 
ideas?



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] variable rate video playback?

2007-08-03 Thread Helen Triolo
Is there any way in Flash 8 or 9 to play back a flv and change the rate 
of speed, keeping the audio pitch constant?  (like you can do with the 
Quicktime player with the A/V Controls)


thanks,
Helen


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Text Input Component

2007-07-17 Thread Helen Triolo
The component needs time to initialize.  If you're coding on the main 
timeline, you can replace the line that assigns the text with this:


   this.con_mc.data_mc[kid_mc + i].onEnterFrame = function() {
   if (this.ifBD1.text != undefined) {
   this.ifBD1.text = Test;
   this.onEnterFrame = null;
   }
   }

If you're coding with classes, you can use something like

   reference to kid_mc.onLoad = Delegate.create(this, setText);

instead and do the text assignment inside the setText method.

Helen


payal wrote:


I am using the following code



for (var i = 0; i  20; i++)
{
this.con_mc.data_mc.attachMovie (kid_mc, kid_mc+i, i);

this.con_mc.data_mc[kid_mc + i]._x = 0;
if (i == 0)
{
this.con_mc.data_mc[kid_mc + i]._y = 0;
}
else
{
var prev = i-1;
this.con_mc.data_mc[kid_mc + i]._y =
this.con_mc.data_mc[kid_mc + prev]._y + this.con_mc.data_mc[kid_mc +
prev]._height + 4

}


this.con_mc.data_mc[kid_mc + i].ifBD1.text = Test
trace(this.con_mc.data_mc[kid_mc + i].ifBD1.text)
//trace(this.con_mc.data_mc[kid_mc + i].ifBD1.text)
//trace(this.con_mc.data_mc[kid_mc + i])
}

Regards
Payal


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Andrews
Sent: Tuesday, July 17, 2007 04:47 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Text Input Component

- Original Message - 
From: payal [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Tuesday, July 17, 2007 12:00 PM
Subject: [Flashcoders] Text Input Component


 


Hi All

I am trying to attach a movieclip containg  textInput component to the
stage. Its attaching successfully But I am not able to set its Text.
   



If you don't show what you are doing to set the text, we can't tell what's 
wrong..


Are you trying to assign to the textinput object itself  rather than the 
text property?


 


Regards
Payal

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

   



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Accessing MovieClips on a timeline from an AS3 class

2007-07-12 Thread Helen Triolo
Colin Moock's book says it's because of adherence to ECMAScript 4, and 
points to this page for explanation: 
http://kuwamoto.org/2006/04/05/as3-on-the-lack-of-private-and-protected-constructors


Helen


Francis Cheng wrote:


I'm guessing that the odd reason has something to do with the behavior
of the private attribute in AS2 versus AS3. As most of you are aware,
the private attribute in AS2 only restricts access at compile time. In
AS3, however, private restricts access at both compile time and
runtime. Just a guess, though, I could be barking up the wrong tree.

Francis

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Muzak
Sent: Thursday, July 12, 2007 5:21 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Accessing MovieClips on a timeline from an
AS3 class

 


This means that you either have to declare the variables yourself (and
   


they have to be public, by the way)
 


or declare the class as dynamic so that the variables can be added at
   


runtime (specifically, at the time the
 


assignment statements are executed).
   



I think the has to be public thing is one of the most annoying things
that has changed between AS2 and AS3.
In AS2 you can place assets on stage and declare them as private in your
class.
In AS3 this is not allowed/possible for some odd reason.

regards,
Muzak



 


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] FLVPlayback Component on Limelight

2007-05-22 Thread Helen Triolo

Lori,

I don't use Limelight and I'm not sure what issues you're having, but if 
they're running FCS, then these notes that I got from Muzak back when I 
was trying to get the flvplayback component working with FCS might be 
helpful:


Another important thing to get the FLVPlayback component to work is to put a copy of main.asc in the app folder you're trying to 
connect to.

You can find the main.asc file here (default Flash 8 install):
C:\Program Files\Macromedia\Flash 8\Samples and 
Tutorials\Samples\Components\FLVPlayback

One last important thing is to set isLive to false on the FLVPlayback instance (it is by default). This one really threw me off, but 
thinking about it now it makes sense, as isLive probable means live streaming from a webcam rather than using streaming server 
such as FCS. This isn't clear in the docs though, at least it wasn't to me.



Helen

http://flash-creations.com
http://i-technica.com




Lori Hutchek wrote:


Hey Everyone,

I've been trying to use the FLVPlayback component and our video server 
provider is Limelight. Has anyone else had issues? Can you point me in 
the right direction for fix this?


THANKS!
Lori-

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Flash and Yahoo map geocode service question

2007-03-08 Thread Helen Triolo

1 (works): From a browser, this returns valid XML with geocode information:

http://api.local.yahoo.com/MapsService/V1/geocode?state=MDcity=Derwoodstreet=16101%20Frederick%20Roadappid=anyid

(doesn't seem to care what appid is used)

2 (works): Testing within the Flash 8 IDE, I can use loadVars to call 
that script (with those parameters set) and an XML onload routine to 
retrieve them -- works fine.


3 (doesn't work): When I publish and run it from a swf in an html page 
in the browser, I get an XML read error (the parameter passed to my xml 
onload routine is false).


What could be causing the XML read/parse error in 3?  (doesn't work with 
a valid appid either)


Helen

--
http://flash-creations.com
http://i-technica.com





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Flash and Yahoo map geocode service question

2007-03-08 Thread Helen Triolo
Thanks jord -- that was indeed the issue.  If anyone else does 
Flash+Yahoo maps, the url to use instead (the one that has a 
cross-domain file in place) is


http://local.yahooapis.com/MapsService/V1/geocode

Helen
new tute: http://flash-creations.com/notes/sample_yahoomap.php


Jordan L. Chilcott - Interactivity Unlimited wrote:


Is it possible that it could be a cross-domain policy situation here?
What would happen if you called it from a back-end (I'd best guess
that it would probably work)?

jord

On 3/8/07, Helen Triolo [EMAIL PROTECTED] wrote:

1 (works): From a browser, this returns valid XML with geocode 
information:


http://api.local.yahoo.com/MapsService/V1/geocode?state=MDcity=Derwoodstreet=16101%20Frederick%20Roadappid=anyid 



(doesn't seem to care what appid is used)

2 (works): Testing within the Flash 8 IDE, I can use loadVars to call
that script (with those parameters set) and an XML onload routine to
retrieve them -- works fine.

3 (doesn't work): When I publish and run it from a swf in an html page
in the browser, I get an XML read error (the parameter passed to my xml
onload routine is false).

What could be causing the XML read/parse error in 3?  (doesn't work with
a valid appid either)




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Events for custom classes?

2007-02-16 Thread Helen Triolo

Use EventDispatcher:

How: 
http://chattyfig.figleaf.com/pipermail/flashcoders/2006-February/160302.html


Why: 
http://chattyfig.figleaf.com/pipermail/flashcoders/2004-June/114320.html


found with Muzak's archive search tool: http://muzakdeezign.com/flashcoders/

Helen

Merrill, Jason wrote:


Core question:  How do I make an event in a custom class, and how do I
make a listener in another class listen for the event?  

 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Events for custom classes?

2007-02-16 Thread Helen Triolo
If you use dispatchEvent from any class, any other class that's 
listening for it can respond.  No scope issues that I can see.  I have a 
simple example of two classes talking to each other using 
EventDispatcher at http://flash-creations.com/notes/sample_emailer.php 
if you want it -- click the free download on the right.


Helen

Merrill, Jason wrote:


Helen,

Great, thank you.  However, I'm a little confused on how I apply that to
my code I posted.  All the MM docs on Event Dispatcher show using it
with Adove classes or components.  And how about the scope with my
Webservice event?  That scope is outside of my custom class, so how do I
fire the event in my custom class?  I can add a property to the listener
object which is the AdminData class instance, but that seems kludgy.

Jason Merrill
Bank of America 
Learning  Organizational Effectiveness


 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Erasing areas with the drawing API?

2007-02-16 Thread Helen Triolo
Yes -- draw the second (inner) shape before you do the endFill and it 
will be punched out.  If you need the final shape to be a mask, draw the 
inner shape in the reverse direction from how you drew the outer shape 
(ie, counter-clockwise if the original shape was drawn clockwise). 

http://flash-creations.com/notes/dynamic_drawingapi.php at the bottom of 
the page


Helen

--
http://flash-creations.com
http://i-technica.com


David Ham wrote:

Does anyone know how to erase part of an area that was created with  
the drawing API? I need to be able to draw a polygon, and then draw  
another polygon inside it and punch it out. For example, I need to  
draw a square and then punch a square hole in it. Anyone ever done  
this before?


OK
DAH







___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] AS2 to AS3 migration issues?

2007-02-15 Thread Helen Triolo

No, that's the whole point!  Now it will be much better.

Helen

Martin Scott Goldberg wrote:


Just wondering if anyone else had this problem.  I decided to migrate by
asteroids code to AS3, and found most of the commands I used were either
completely removed or redefined.  It looks like I'm going to have to
rewrite the entire program rather thans simply change a few things.
Really, really dissheartening.


Marty
 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Scrolling text with dragger??

2007-02-06 Thread Helen Triolo

http://flash-creations.com/notes/actionscript_scrolltext.php

Helen


Tolis Christomanos wrote:


I did a google search too but the majority of the tutorials are using the
uiscrollbar component. I want to learn how to make my own scrollbar for
text.



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] RE: FLVPLAYBACK COMPONENT

2007-01-20 Thread Helen Triolo
One more for the archive:  main.asc also has to be in the application 
directory (in my case, LT) for the flvplayback to work (as mentioned by 
Muzak and martin). A  copy of main.asc can be found in Program 
Files\Macromedia\Flash 8\Samples and 
Tutorials\Samples\Components\FLVPlayback.  Then either the app has to be 
restarted with the App Inspector or if it's not used for 20 minutes, it 
will be restarted automatically.  (Thanks again, Muzak)


On a totally unrelated note, this is pretty cool, JG (and I thought you 
were just Mr Xray :)


http://www.rockonflash.com/demos/MidiDemo/DreamTheater_FITC.html


Helen Triolo wrote:

Well, I'm an idjit, but for the archives, the contentPath for 
FLVPlayer is the same as the setMedia specification for MediaPlayback, 
but you have to upload the skin swf that the FLVPlayer is using 
(specified in parameters or code) for the controls and the video to 
actually show up.  And for those who may not now about these pages, 
there are updates for FLVPlayer and for FCS and other related things at:


http://www.adobe.com/support/flashmediaserver/downloads_updaters.html

and

http://www.adobe.com/support/flash/downloads.html

Thank you to martin coulthurst and Muzak for those links and your 
suggestions and help offlist.


Helen


Helen Triolo wrote:

Thanks.  This is using FCS, I should've mentioned, not FMS2.  It 
looks to me from the help that the flv extension is required.   So to 
shorten my question, it's


for a file accessible with setMedia(rtmp:/LT/myfile.flv) using 
MediaPlayback


what is the correct contentPath for FLVPlayback?

(FCS, streaming video, webserver on same machine as FCS)

Helen

Dan Styles wrote:


I had a problem like this recently
Try without the .flv part... you may not need the extension when 
using Flash

Media Server

also check this:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15catid=578threadid=1228512enterthread=y 


and this:
http://livedocs.macromedia.com/flash/8/main/3495.html

QUOTE:
I recently went through this difficulty with Flash Media Server 2 
(not the
earlier FCS), in order to get the FLV Playback component to stream 
videos
using FMS2 from another folder not under the default applications 
folder,
you'll need to map a virtual directory by altering vHost.xml kept 
in this
location: Flash Media Server 
2/conf/_defaultRoot_/_defaultVHost_/vHost.xml


In vHost.xml there is a tag VirtualDirectory and under that 
Streams.


When you add a virtual directory to FMS2 you should add to the 
streams tag

something like this:

VirtualDirectory
Streamsbar;C:\streams/Streams
VirtualDirectory

Then you'll need to add a folder under the default applications 
directory of
FMS (or whatever custom applications directory you're using) with 
whatever

name you choose (say for example foo), then make sure you place the
main.asc for the FLVPlayback component which ships with Flash 8 in 
this new
folder, you can find this main.asc file in the location given in the 
doc
above. No streams should go in this foo folder, and no extra 
subfolders
are needed here, but your streams (in this example) should be 
located at

c:\streams

Then when playing back a .flv (called, for example yourVid.flv) 
using the

FLVPlayback component, the contentPath should be something like this:

rtmp://localhost/foo/bar/yourVid.flv

FMS connects first to localhost (or whatever IP the streaming server is
located), then checks the app name foo,finding it, it then looks 
for a
virtual mapping, if any, in this case bar, then finding the path 
mapped
out in the vHost.xml to C:\streams it gets the flv file 
yourVid.flv from

the folder c:\streams.

END QUOTE


YOU WROTE:
I can't get the FLVPlayback component to display the streamed videos
that are working fine with the MediaPlayback component.  For the 
latter,

I use

setMedia(rtmp:/LT/myfile.flv)

but there is no setMedia command for FLVPlayback, only contentPath, and
setting it to the above doesn't work, nor did setting contentPath =
rtmp://server address/LT/myfile.flv  or rtmp://server
address/LT/stream/_definst_/myfile.flv  -- the video never shows up.
Any suggestions?



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] how to know that thae video is finished? using FLVPlayback

2007-01-18 Thread Helen Triolo
The MediaPlayback components do still exist -- they're just listed in 
the Flash 6-7 folder in the components window.  I wanted to use 
FLVPlayback for a recent video project but I can't get it to display the 
streamed videos that are working fine with the MediaPlayback component.  
For the latter, I use


setMedia(rtmp:/LT/myfile.flv)

but there is no setMedia command for FLVPlayback, only contentPath, and 
setting it to the above doesn't work, nor did setting contentPath = 
rtmp://server address/LT/myfile.flv  or rtmp://server 
address/LT/stream/_definst_/myfile.flv  -- any suggestions?


Helen

Muzak wrote:


Flash 8 has a new (and improved) Video component
mx.controls.MediaDisplay no longer exists in Flash 8 and is replaced with 
mx.video.FLVPlayback
http://livedocs.macromedia.com/flash/8/main/3477.html

FLVPlayback component has a complete event:
http://livedocs.macromedia.com/flash/8/main/3537.html

regards,
Muzak

- Original Message - 
From: Karina Steffens [EMAIL PROTECTED]

To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
Sent: Thursday, January 18, 2007 1:23 PM
Subject: RE: [Flashcoders] how to know that thae video is finished?


 


Isn't it amazing that Adobe/MM never bothered setting up a simple
onStopMovie event?...

   




 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] how to know that thae video is finished?

2007-01-18 Thread Helen Triolo
If you're using a NetStream object, then I believe you want ns.time, not 
playheadTime.


Helen

natalia Vikhtinskaya wrote:


Sorry,  maybe I do something wrong but I can not get playheadTime



var movie_flv:mx.controls.MediaDisplay;



var nc:NetConnection=new NetConnection();

nc.connect(null);

var ns:NetStream=new NetStream(nc);

ns.setBufferTime(3);

ns.onStatus=function(info){

   if (info.code==NetStream.Buffer.Full){

   bufferClip._visible=false;

   }

   if (info.code==NetStream.BufferEmpty){

   bufferClip._visible=true;

   }

   if (info.code==NetStream.Play.Stop){  //this 
place

not always works/ So when video finished

   ns.seek(0);

   }



}

theVideo.attachVideo(ns);

ns.play(video/shoeshdmaster_vp6520.flv);





var videoInterval=setInterval(videoStatus,10);



ns[onMetaData]=function(obj){

   duration=obj.duration;

}

function videoStatus(){

   trace(movie_flv.playheadTime)   ///trace undefined

   }




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] how to know that thae video is finished?

2007-01-18 Thread Helen Triolo
Does ns.time trace something close to duration, just not exactly equal 
at the end?  If so, just check for = duration - somesmallamount (maybe 
to do with the buffer size) instead of ==.  Is this a progressive or 
streamed flv, btw?


I dug up this old flashcomm post from Brandon Krakowsky in case it's any 
use:


I noticed that as well.  I've never had good luck with 
NetStream.Play.Stop.  I think part of the problem is that 
some FLVs never get to the very end of the file - maybe .5 
seconds before the end. 
The other part of the problem might be the encoder you're 
using.  Flash 8 Encoder vs. Riva vs. Flix.


I avoid the whole thing by monitoring the playhead inside of 
a setInterval or onEnterFrame, and comparing it to the 
totalTime.  This way, I never have to worry about those 
objects not firing.  Once again, I DO run into the problem 
where the playhead doesn't get all the way to the end, so 
tend to look for the playhead to be .5 seconds from the end, 
or more.  Seems to do the trick everytime.  Of course, if you 
can, make sure the videos have a little extra something at 
the end so they don't get cut off.



Helen

natalia Vikhtinskaya wrote:

So as I understand no way to determine that video is finished with 
NetStream

object?

2007/1/18, Karina Steffens [EMAIL PROTECTED]:



Sorry, it's bee a while since I wrote that script, so I forgot to 
mention
that movie_flv in my code is an AS2 Video Playback component that has 
the

movie attached to it instead of a simple movie clip. It's located in the
components panel.  You might want to try theVideo.playheadTime instead,
but
if that doesn't work, you could try using this component instead. Or
better
yet, if you're using Flash 8, try the new video component that Muzak
mentioned (Flv Playback) which has a complete event.

PS: I just saw Helen's post - that's definitely worth a try.

Karina




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Specifying contentPath for FLVPlayer

2007-01-18 Thread Helen Triolo

Realized this should have its own thread instead of hijacking natalia's:

I can't get the FLVPlayback component to display the streamed videos 
that are working fine with the MediaPlayback component.  For the latter, 
I use


setMedia(rtmp:/LT/myfile.flv)

but there is no setMedia command for FLVPlayback, only contentPath, and 
setting it to the above doesn't work, nor did setting contentPath = 
rtmp://server address/LT/myfile.flv  or rtmp://server 
address/LT/stream/_definst_/myfile.flv  -- the video never shows up.  
Any suggestions?


Helen





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Specifying contentPath for FLVPlayer

2007-01-18 Thread Helen Triolo

Hi Karina,

Thanks for the suggestions.  I saw those different options and can't 
even get the video to show up (let alone play or pause).  I just don't 
know what the right contentPath could be.  This is my simplest test 
case, with input textfield filepath, movieclip go, FLVPlayback component 
flvplayer, and dynamic textfield msg:


go.onRelease = function() {
   flvplayer.play(filepath.text);
   msg.text = 'Trying to play ' + filepath.text + ' in ' + flvplayer;
}

No matter what I type into filepath, I can't get a video showing up in 
flvplayer.  But I could get it to play in MediaPlayback with 
setMedia(rtmp:/LT/myfile.flv) (because the webserver and FCS are on 
the same machine, so no absolute path to fcs necessary).  I think it 
must be some very simple thing, but I can't find the right contentPath 
to make it work.


Helen

Karina Steffens wrote:


Helen, have you set the FlvPlayback to autoPlay, or told it to play
manually? 
I'm looking at the docs and there seem to be a few ways to load the videos:


my_FLVPlybk.contentPath = rtmp://my_servername/my_application/stream.flv;

my_FLVplybk.load(contentPath:String[, totalTime:Number, isLive:Boolean])

my_FLVplybk.play ([contentPath:String, totalTime:Number, isLive:Boolean]) 


Mind you, I haven't tried any yet...

Karina




 


-Original Message-
From: Helen Triolo [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2007 15:46

To: Flashcoders Mailing List
Subject: [Flashcoders] Specifying contentPath for FLVPlayer

Realized this should have its own thread instead of hijacking 
natalia's:


I can't get the FLVPlayback component to display the streamed 
videos that are working fine with the MediaPlayback 
component.  For the latter, I use


setMedia(rtmp:/LT/myfile.flv)

but there is no setMedia command for FLVPlayback, only 
contentPath, and setting it to the above doesn't work, nor 
did setting contentPath = rtmp://server 
address/LT/myfile.flv  or rtmp://server 
address/LT/stream/_definst_/myfile.flv  -- the video never 
shows up.  
Any suggestions?


Helen

   




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Space Clips in Circle

2006-10-25 Thread Helen Triolo
3 days with no success sounds way too familiar...  but I can do clips on 
a circle, I think.  With a clip in the library, this will attach it n 
times (starting at depth d) around a circle of radius r centered at x, y:


function placeOnCircle(n:Number, r:Number, x:Number, y:Number, 
clipid:String, attachTo:MovieClip, d:Number) {

   // get # of radians for each segment
   var segment:Number = 2 * Math.PI / n;
   for (var i=0; in; i++) {
   attachTo.attachMovie(clipid, clipid+i, d+i, {_x:x + r * 
Math.cos(segment*i), _y:y + r * Math.sin(segment*i)});

   }
}
placeOnCircle(12, 100, 200, 200, pt, this, 1);

Helen

--
http://flash-creations.com
http://i-technica.com



Kevin Aebig wrote:


Hey all,



My goal is to space 12 clips in a circle evenly based on a radius. I'm
officially stumped after messing around with it for 3 days with no success.



Any help or insight appreciated.



Cheers,



!k

 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] masking a clip which uses the drawing api

2006-09-22 Thread Helen Triolo
sounds like 
http://flash-creations.com/notes/dynamic_drawingapi.php#cutoutmask


Helen

Josh Santangelo wrote:

I have a clip that I'm drawing into. That clip is masked by a shape  
or another clip, set in the IDE or at runtime. The clip which is  
drawn into does not appear masked.


Making a mask from a clip which you draw into does seem to work, but  
I couldn't make it work if the mask I drew had a hole in it.


-josh

On Sep 18, 2006, at 12:53a, Janis Radins wrote:

Masking with elements made up by drawing API works 100%, ive done  it 
many

times.
What is it that doesnt work for you?

2006/9/15, Merrill, Jason [EMAIL PROTECTED]:



Is it not possible to mask a clip into which you draw things using
the drawing API?

I'm not totally sure about masking, but in general, I think there are
some bugs or conflicts with a movie clip drawn upon with the draw API
and other elements of the movie.  I'm not sure this is as related  
as you

would like, but for example, I had an issue with one of those  drawn-on
movie clips which had another movie clip as a child, which had a
textfield on it.  It worked fine until the textfield was updated with
new data - then the old text still showed, and the new text was also
drawn over the top - so it looked like there were two overlapping
textfields.  If I separated the textfield from the clip being  drawn 
on,
it worked fine.  I never could figure out the behavior, but I  
assumed it
had to do with the clips and children of clips drawn on by the  draw 
API

and the way the player renders them/redraws them.  In another case,
portions of v2 components always displayed below clips which were  
drawn

upon - the drawn on clips were always on top.

Post again if you figure it out.

Jason Merrill
Bank of America
Learning  Organization Effectiveness - Technology Solutions





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] printable certificates for flash 7

2006-09-19 Thread Helen Triolo
Here's an example of retrieving (and displaying, but you would want to 
use PrintJob to print instead I imagine) data from a database: 
http://flash-creations.com/notes/servercomm_database.php by passing 
strings of text formatted as somevariable=somevalue, and here's an 
example of doing it with remoting (passing binary data, as objects): 
http://flash-creations.com/notes/servercomm_remoting_amfphp.php


Helen

James Booth wrote:


Look into Flash Remoting.  This is how I've done it in the past.

- James


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jim Gay
Sent: Tuesday, September 19, 2006 4:42 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] printable certificates for flash 7

I've been out of flash development for a little while and I recognize  
that this may be under the radar of many on the list.

Should I switch to the newbie list to find an answer regarding this?
Thanks,
-Jim

On Sep 19, 2006, at 11:16, Jim Gay wrote:

 

I'm getting ready to do a project where I need to create a  
printable certificate with dynamic info (such as a name pulled from  
a database) for users with Flash player 7.


Does anyone have any recommendations on the best way to handle it.  
Can I do so relatively easily without the need for something like  
Flash Comm. Server?


Tips or tutorials would be greatly appreciated.
   



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Passing values to a backend

2006-08-23 Thread Helen Triolo
sendAndLoad code example at bottom of this page if you need: 
http://flash-creations.com/notes/servercomm_loadvars.php


Helen

Lucy Thomson wrote:


Yes you can use the LoadVars and try looking up sendAndLoad and onLoad.

I usually bundle up my data into the LoadVars to send it off, then
define what should happen when the response (either success or not) is
returned form the server in the onLoad. That's where you can tell your
app to either show a failed message, or go to the success message within
flash.



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stephen
Ford
Sent: 23 August 2006 09:57
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Passing values to a backend

I have a created a little form in flash. I need to get the values into a
backend. What I have is a variable called sQuery, like so:

sQuery =
questionnaire.asp?firstname=James%20J.lastname=Delaneyjobtitle=Web%20D
ev[EMAIL PROTECTED]company=The%20Factoryphone=34563456customer=tru
eq1=7q2=39

Now originally, I was simply using the following getURL:

getURL(sQuery)

Which would send them to the .asp page (which did it's backend thing)
and they would be shown a thankyou page. BUT now, I need to send the
values to the backend, but show the user a thankyou page in the flash
app. Therefore I don't think I can use getURL. Can anyone advise on what
I should be using now, do I need to use a LoadVars object or such ??? I
need to 'fork' off the values to the database but stay on the page with
the flash movie.

Thanks in advance



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Control volume of netstream video

2006-08-22 Thread Helen Triolo
I controlled the sound with a movieclip (soundholder) by using 
attachAudio like this:


   soundholder.attachAudio(ns);
   audio = new Sound(soundholder);
   audio.setVolume(0);

(ns = netstream object)

Helen

Patrick Matte wrote:


Hi there, the only way I could control the volume of a netstream video was
by adding _root as the target for my Sound object.

But I'd prefer to add a MovieClip as a target to the Sound object. Is it
possible to do that ?

 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Not seeing video on stage

2006-08-22 Thread Helen Triolo
Does it work if you put an Embedded Video instance called vid on stage 
instead?  I don't think you can instantiate one like you're doing (but I 
could be wrong).


Helen

--
http://flash-creations.com
http://i-technica.com

Mendelsohn, Michael wrote:


Hi list...

I'm not sure why I can't see my loaded flv on the stage.  I can hear
them, I just can't see them.  I have a class that runs the show as
follows.

Thanks,
- Michael M.

import flash.external.*;
class welcomeWebpage {
public var nc:NetConnection;
public var ns:NetStream;
public var vid:Video;
public var ui:MovieClip;
public static var currentCategory:String;
public static var inst:welcomeWebpage = undefined;
private function welcomeWebpage() {
// singleton
}
public static function getInstance():welcomeWebpage {
if (inst == undefined) {
inst = new welcomeWebpage();
}
return inst;
}
public function init():Void {
// create netConnection to import external flv files
(sitting next to swf)
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
vid = new Video();
}
public function playVid(theVid) {
//start to load, then play, the appropriate video..
vid.attachVideo(ns);
ns.play(theVid);
// tried to set _x, etc. here but nothing works
}
}

 






___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] delegating inside a tween class

2006-08-13 Thread Helen Triolo

ilteris,

You can't assign a function to the onMotionFinished property (in the 
constructor) before the Tween instance has been created (in 
openCanvas).  Those should be more like:


 public function Canvas(timeline:MovieClip, level:Number, y_:Number) {
   mc = timeline.attachMovie(canvas, canvasS, level, {_x:158,  
_y:y_, _width:0});

   }
   public function openCanvas() {
   tween1 = new Tween(mc, _width,  
mx.transitions.easing.Strong.easeOut, 0, 673, 3, true);
   tween1.onMotionFinished = mx.utils.Delegate.create(this,  
mcMotionFinished);

   }

Helen

ilteris kaplan wrote:


Dear List,
I am trying to use tween's onMotionFinished method in order to make  
use of this, only when I try to call it normally (see closeCanvas  
method below) and trace(mc) it traces undefined. So when I tried to  
delegate onMotionFinished, I stumbled accross another problem. This  
time since tween1 is instantiated insideof the openCanvas method,  
delegating it in the constructor doesn't help at all.


So what  should I do to workaround this? Basically I am trying to  
trigger an event when the motionFinished.
IS using tween inside classes is a bad habit, should I take the code  
to the timeline? I really appreciate advices and helps!!



best,
ilteris.


import mx.transitions.Tween;
class Canvas {
private var tween1:Tween;
private var tween2:Tween;
public var mc:MovieClip;
// Constructor
public function Canvas(timeline:MovieClip, level:Number, y_:Number) {
mc = timeline.attachMovie(canvas, canvasS, level, 
{_x:158,  _y:y_, _width:0});
this.tween1.onMotionFinished = mx.utils.Delegate.create(this,  
this.mcMotionFinished);

}
public function openCanvas() {
tween1 = new Tween(mc, _width,  
mx.transitions.easing.Strong.easeOut, 0, 673, 3, true);
mcMotionFinished(); // this doesn't scope to the class   
}


public function mcMotionFinished() {
trace(this); // I am assuming this should scope to
// the class only I am not able to call this 
method.

}

public function closeCanvas() {
tween2 = new Tween(mc, _width,  
mx.transitions.easing.Strong.easeOut, 673, 0, 2, true);

tween2.onMotionFinished = function() {
trace(mc) // nope, this scope to the tween itself.
// check which one is pressed for next!
}
}
}



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] yahoo map api example site

2006-08-13 Thread Helen Triolo
Some time during the past couple months, someone posted a link here to a 
nice-looking site that used the Yahoo map api with Ocean City 
properties.  Anyone have that link?  (I can't find it in the archives)


thanks,
Helen

--
Helen Triolo
http://flash-creations.com
http://i-technica.com





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] yahoo map api example site

2006-08-13 Thread Helen Triolo

many thanks, Richard!

richard carr wrote:


Here ya go
Richard


Kevin Aebig [EMAIL PROTECTED] to Flashcoders
More options  Jul 31With a pretty good fight, you can really customize 
the

yahoo maps component.

http://www.oceancityguide.com/hotels/more.cfm?guideID=321



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] media components with mp3

2006-06-07 Thread Helen Triolo
I'm trying to use v2 media components to make a player for an mp3 that 
has no background and is of a specified size and will respond to 
external events.  I tried two things: a media playback component, and a 
media display plus associated media controller, but both have problems.


There is a sample of these here: http://flash-creations.com/dev/mp3play.html

The left side uses the media playback component.  It works fine -- when 
you click the play button it starts playing and when you click the Pause 
button below (not part of the component), it pauses and displays the 
appropriate controls.  But I *can't turn off the background and I can't 
fit it into the dotted line area*.


The right side uses media display and media controller.  It looks fine, 
but it doesn't work right.  Clicking play makes it start playing and 
clicking the Pause button below makes it pause but it *doesn't change 
the controller's controls to match*, even though the display and 
controller have been associated with the associateController method.


If anyone has an idea of how I can make the sample on the left fit into 
the area within the dotted line and have no background, or make the 
sample on the right behave correctly when an external Pause button is 
pressed (or any external event occurs), I'm all ears.  Link to zip file 
(780k) is included on page above.


thanks,
Helen


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Hole-in-a-mask (a reverse mask question)?

2006-06-04 Thread Helen Triolo
If you're using the drawing API to make the mask shape, you can make an 
inversion of it (to show everything but the mask shape) by giving the 
commands to draw the overall shape (ie, that covers the whole stage if 
that's what you want) and then the commands to draw the shape of the 
mask, in the reverse direction of the original drawing -- ie, draw the 
mask clockwise if the original shape was drawn counterclockwise--, and 
do both sets of commands between the beginFill and endFill.  Example 
here http://flash-creations.com/notes/dynamic_drawingapi.php#cutout 
under Using a shape with a cutout as a mask if you need.


Helen

Ville Walveranta wrote:


Hello everybody,

I've been racking my brain tonight trying to figure out a way to create a
reverse mask in Actionscript. I'm working on an application which is
entirely object-based; nothing on the stage other than object initialization
on the first frame. So everything needs to be programmatic.

Normally a mask displays what's on the underlying layer. I'm trying to
create a mask that would display an intermediate layer for the areas outside
of the mask shape, and basically be invisible for the areas of the mask
shape showing all underlying layers, whtever is displayed at that spot from
below.

An illustration (as viewed from the side :) may help...


[--]   - mask layer containing a shape, say a box in the middle

[------]   - an intermediate layer whose contents would be shown in 
 the areas *outside* of the above box-shaped mask


[  ]   - various content layers 
[- -- -]   - whose visible content would 
[---  -  --]   - show through the mask 
[--]   - on the top


I found a short comment by someone (Xeef) on Actionscript.org regarding
reverse mask as follows:

 you will need to use more masks 
 BackGround --Box on it -- An other Background Masked by an EMPTY mask 
 (will by invisible) now draw on the Mask the part of the 2. Backgound 
 will by revaled and over lap the Box


I haven't figured out yet what that means.

Any suggestions, ideas, thoughts? 


Thanks!

Ville
 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] ComboBox won't scroll

2006-06-02 Thread Helen Triolo
I can't reproduce your problem here (Flash 8, Win2k).  With a combobox 
cb and two clips, add3 and add4, on stage, the combobox displays and 
works fine when add4 is clicked (no matter the order or number of times 
either button is clicked):


var a:Array = [a, b, c];
cb.dataProvider = a;

add3.onRelease = function() {
   cb.addItem(d);
   cb.addItem(e);
}

add4.onRelease = function() {
   cb.addItem(f);
   cb.addItem(g);
   cb.addItem(h);
   cb.addItem(i);
   cb.rowCount = 3;
}

Helen

--
http://flash-creations.com
http://i-technica.com



nobski wrote:


Very simple little problem probably and hopefully:

When adding items to a ComboBox using addItem() and setting its rowCount to 
anything less than the number of added items, the ComboBox renders empty 
completely and shows no scrollbar or items at all.
I cannot find any method of property that could cause this to happen or change 
this.

Any ideas on what I might be doing wrong?
Flash Pro 8 on win2K..

Cheers,
nobski
 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Safari bug? Click doesn't register until mousemove

2006-05-08 Thread Helen Triolo
Sounds a bit like the problem you can get when mixing regular movieclips 
with v2 components --  focusManager won't give movieclips focus if 
they're clicked twice in succession, so their onRelease won't trigger 
the second time unless the mouse is moved between clicks -- workaround 
is to add  Selection.setFocus(this); to the movieclip's onRelease 
handler.  But I think that problem would show up in all browsers, not 
just Safari, so not sure if it's really related.


Helen

--
http://flash-creations.com
http://i-technica.com



Danny Kodicek wrote:

I've done a quick google and haven't seen this, but it's hard to know 
where exactly to look as all the words involved are so common. Anyone 
seen a bug where a mousedown isn't registered until the mouse is 
moved? This is only happening in Safari - tested in Firefox, IE/Mac 
and IE/Win with no problems. The movie is running through Director, 
although my instinct is that an issue like this is probably at a lower 
level than Director / Flash.


I have a nagging feeling I've seen a discussion of this, but I can't 
remember where or if it was resolved.


Danny





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Moving animation positions

2006-05-04 Thread Helen Triolo
Do you mean moving all the content the same over a range of keyframes?  
If so, see 
http://flash-creations.com/notes/actionscript_componentsintro.php#editmultiple 
And you should probably post questions like this at flashnewbie instead 
since they don't have anything to do with coding.  (Flashnewbie should 
actually be called flashusers -- it isn't just for newbies)


Helen

--
http://flash-creations.com
http://i-technica.com



Mike Boutin wrote:

I am trying to move all my animations so that they arecentered in the 
movieclip they were created in (was created off-centered) except I 
dont want to go through every keyframe and adjust the positioning 
frame by frame.  Is there an easier way of doing this?  I am using 
flash 8 pro... Any suggestions would be of great help!


Thanks!!


Boots




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Quick n diarty date request

2006-05-02 Thread Helen Triolo
Maybe there's something simpler, but here are two date functions (public 
static functions I have in a date utility class) that I use all the time 
(and would work for your case):


   function dateFromString(s:String):Date {
   var yr:Number = Number(s.substr(0, 4));
   var m:Number = Number(s.substr(5, 2))-1;
   var d:Number = Number(s.substr(8, 2));
   return new Date(yr, m, d);
   }

   function datesSame(d1:Date, d2:Date):Boolean {
   return (d1.getYear() == d2.getYear() 
d1.getMonth() == d2.getMonth() 
d1.getDate() == d2.getDate());
   }

   //Usage for your date check:

   trace(datesSame(new Date(), dateFromString('2006-05-02')));

Helen

--
http://flash-creations.com
http://i-technica.com



Manuel Saint-Victor wrote:

you ca try comparing elements of it such as getDate() and getMonth() 
instead

of the whole thing

var today=new Date();
trace(today.getMonth());


On 5/2/06, Pete Hotchkiss [EMAIL PROTECTED] wrote:



Is there a simple way to check if an instance of a date function is
today.

Ie

var foo = new Date();
trace(foo);

var bar = new Date(2006, 04, 02);

trace(bar)

trace(foo == bar);

Obviously that returns false as the time is incorrect.

There must be a simple way ?

Pete




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Lookup tables

2006-04-08 Thread Helen Triolo
If array lookup (mysin[some-calculated-angle]) is faster than whatever 
Flash uses to find Math.sin(some-calculated-angle) --you could write a 
loop to test that, since I don't know if it's true-- then the simplest 
thing would be to write (in a dummy fla) a loop to dump the contents you 
need (in the format/precision you need it) to the output panel and then 
paste that into the as file to create the array.


(bullet storms at 3am on a Sunday?)

Helen

--
http://flash-creations.com
http://i-technica.com



Andreas Rønning wrote:

Anyone know of good online tutorials or treatments on generating and 
using lookup tables to speed up sin/cos and similar math in AS2?
I'm looking for ways to reuse the results of a single calculation 
across a number of variations of the calculated problem.


Yes this is game related :) Shoot-em-up related to be specific. Flash 
doesn't lend itself well to bullet storms it would seem.


- Andreas




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Any way to set properties of a Window component's contentPath?

2006-04-02 Thread Helen Triolo
I do exactly that with scrollpane -- set the contentPath to a movieclip 
menuBuilder (in the library, linked to class MenuBuilder) and then call 
its setup method and that works fine:


  menupanel.menupane.contentPath = menuBuilder;
  menupanel.menupane.content.setup(this, ctopic, cpage);

So it seems what you are doing should work also.  Is the contentPath a 
movieclip?  (you show it with a capital as though you're setting it to a 
a class, and I can't see anything else that looks different)


Helen

--
http://flash-creations.com
http://i-technica.com



David Farrell wrote:


Also,

I can't see how to access my object once it is the content of the Window.

ie.. I create a window with DialogueButtons as the contentPath

This creates the window as hoped - now I want to call a few methods on 
my class to create the buttons - but how do I access the content (my 
DialogueButtons class)?


'tracing' from within my class shows that my DialogueBox is at 
level0.depthChild0.content - if I trace my 'win' it is 
level0.depthChild0 - so one would natrually assume that I'd be able 
to do win.depthChild0.content.myMethod()


but that doesn't work - Flash seems to not be able to let me see any 
of my DialogueButton class' properties.


hmm




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Question on attachMovie

2006-04-02 Thread Helen Triolo
Why not take the function out of the clip altogether, put it in a class 
file, and have it be available immediately after the attachMovie without 
all that wait-a-frame-for-function-to-be-available stuff?  Or even call 
a function on the main timeline instead?  Unless it's for Flash 5, I 
can't think of a reason why any clip that's going to be attached needs 
to have any code inside itself (except maybe initclip code if it's for 
Flash 6).


Helen

--
http://flash-creations.com
http://i-technica.com



Dave Mennenoh wrote:


Have you tried attachedMC.onLoad?




Oh, I see what you mean. Place the onLoad within the clip.. No, I 
didn't try that. It might work, but I'd rather do it like I have it - 
calling the method from the code that attaches the clip.





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Cannot stop loaded movie

2006-03-17 Thread Helen Triolo
What Marc said, plus use onLoadInit instead of onLoadComplete.  From the 
help docs:


It's important to understand the difference between 
MovieClipLoader.onLoadComplete and MovieClipLoader.onLoadInit. The 
onLoadComplete event is called after the SWF, JPEG, GIF, or PNG file 
loads, but before the application is initialized. At this point, it is 
impossible to access the loaded movie clip's methods and properties, and 
therefore you cannot call a function, move to a specific frame, and so 
on. In most situations, it's better to use the onLoadInit event instead, 
which is called after the content is loaded and fully initialized.


Helen

--
http://flash-creations.com
http://i-technica.com



Marco Tabini wrote:

Sorry, that was just a bad copy-and-paste job. Moving the listener to 
before the clip is loaded doesn't change anything. Good catch, though :)



Marco

Marc Hoffman wrote:


Try adding the listener to ld before loading the clip.

At 07:07 PM 3/17/2006, you wrote:

To add to the weirdness: this problem only presents itself if I 
create the project in Flash 8, so I wonder whether I'm hitting my 
head against the new security model. Again, any help would be much 
appreciated.



Marco

Marco Tabini wrote:


Hello--
I am trying to control a movie I load from a remote location. I've 
narrowed down my code to the smallest possible number of lines:

ld = new MovieClipLoader();
ld.loadClip(url, mcClip);
obj = new Object();
obj.onLoadComplete = function()
{
mcClip.gotoAndStop (10);
}
ld.addListener(obj)
This code, placed in the actions panel of the root, works with the 
exception of the onLoadComplete function. The mcClip is simply an 
instance of a movie clip symbol (with no code) placed on the stage. 
The loaded movie is just a collection of frames, with no actions 
associated to it.
The really bizarre thing is that this works just fine if I run the 
code from inside Flash: the movie loads and then it jumps to frame 
10, where it stops.
If I run the SWF inside the standalone player (or inside a browser 
plugin on Windows, but not on a Mac), the external movie loads but 
keeps looping and there seems to be no way to stop it.
I cannot make sense of this. I've tried searching through the list, 
but either this is so obviously wrong that nobody ever had the 
problem, or I just don't know what to search for :)

I'd appreciate any pointers!
Thanks,

Marco





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Get the average of 2 colors

2006-03-10 Thread Helen Triolo
Probably the best thing would be to get the average for each channel 
individually and then combine them.  I have an example of separate color 
channel manipulation (the old Color class way) at the bottom of this 
page http://flash-creations.com/notes/asclass_color.php if that helps.


Helen

--
http://flash-creations.com
http://i-technica.com



Joakim Carlgren wrote:


Whats the easiest way to calculate the average of two colors?





varcolor1:Number = 0xFF

varcolor2:Number = 0xFF



varmyColor:Color = new Color(my_mc)

   myColor.setRGB((color1 + color2) / 2)

I know its not this simple and probably I need to play with bitwise
operators..

Any easy way to solve this? 




Joakim Carlgren





 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Q:Problems with Tween class

2006-03-08 Thread Helen Triolo
Yes, there are apparently multiple Tween classes in Flash 8 (and maybe 
MX 2004 -- I didn't check that).  The one I've most often seen used is  
mx.transitions.Tween, not the one in mx.effects that you imported.  Here 
is an example of your code (except I used 21 fps instead of 61 so I 
wouldn't have to paste 60 lines of output) used with that class.  
onMotionFinished does report when it's done, and there's also a 
onMotionChanged that apparently reports once per frame.  Here is the 
frame-based code and output:


import mx.transitions.Tween;
import mx.transitions.easing.*;

function myTweenFunc(){
   var tw:Tween = new Tween(myMC,_x, Regular.easeInOut, -310, 20, 10, 
false);

   tw.FPS = 21;
   tw.onMotionFinished=function(){
   trace('finished moving lance');
   }
  
  // the time property appears to actually be frame count for 
frame-based tweens

   tw.onMotionChanged = function() {
   trace('changed, time='+this.time+' prevPos='+this.prevPos);
   }
}
myTweenFunc();

changed, time=1 prevPos=-310
changed, time=2 prevPos=-303.4
changed, time=3 prevPos=-283.6
changed, time=4 prevPos=-250.6
changed, time=5 prevPos=-204.4
changed, time=6 prevPos=-145
changed, time=7 prevPos=-85.6
changed, time=8 prevPos=-39.4
changed, time=9 prevPos=-6.38
changed, time=10 prevPos=13.4
finished moving lance

and this is the change to the tween line and output for a time-based 
tween (tween dur=1 second, 20 fps movie)


   var tw:Tween = new Tween(myMC,_x, Regular.easeInOut, -310, 20, 1, 
true);


changed, time=0.055 prevPos=-310
changed, time=0.109 prevPos=-306.9145
changed, time=0.158 prevPos=-297.88138
changed, time=0.206 prevPos=-284.53672
changed, time=0.259 prevPos=-266.71528
changed, time=0.311 prevPos=-241.57738
changed, time=0.362 prevPos=-211.34458
changed, time=0.414 prevPos=-176.33512
changed, time=0.465 prevPos=-135.17608
changed, time=0.517 prevPos=-89.4505
changed, time=0.567 prevPos=-37.95478
changed, time=0.619 prevPos=8.761218
changed, time=0.671 prevPos=51.93578
changed, time=0.722 prevPos=89.59418
changed, time=0.773 prevPos=121.17032
changed, time=0.824 prevPos=147.44042
changed, time=0.876 prevPos=168.40448
changed, time=0.928 prevPos=184.31648
changed, time=0.989 prevPos=194.71232
changed, time=1 prevPos=199.87658
finished moving lance

Helen

--
http://flash-creations.com
http://i-technica.com


[EMAIL PROTECTED] wrote:


Hi
having some difficulty getting the handlers working with the built-in Tween 
class

also, does the Tween class actually exist in more than one place?


//CODE START

import mx.effects.*;
import mx.transitions.easing.*;

function myTweenFunc(){

myMC.onTweenUpdate = function(value) {
this._x = value;
}


var tw = new Tween(myMC,-310, 20, 500,false);
tw.easingEquation = Regular.easeInOut;
tw.FPS=61;

//the following handler doesn't work
   tw.onMotionFinished=function(){
trace('finished moving lance');
}

}
myTweenFunc();

//CODE END


Any suggestions?
Thanks in advance
Jim bachalo

[e] jbach at bitstream.ca
[c] 416.668.0034
[w] www.bitstream.ca

...all improvisation is life in search of a style.
- Bruce Mau,'LifeStyle'
 





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Using setMask to Mask a loaded swf

2006-03-07 Thread Helen Triolo

Make sure the swf is loaded before assigning the mask, eg:

var loader:MovieClipLoader = new MovieClipLoader();
function onLoadInit(_mc) {
  _mc.setMask(mask_mc);
};
loader.addListener(this);
loader.loadClip(movie.swf, holder_mc);

Helen

--
http://flash-creations.com
http://i-technica.com



Matt Muller wrote:


Hi, Im attaching a swf to a movieClip and then using setMask to mask the swf
once the animation has loaded.

So whats happening is most of it is masked but there seem to be these little
lines and stuff running outside the mask.

Anyone had this, or have a solution/suggestion?

Cheers

MaTT
___
 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Strange behaviour from modulus operator

2006-03-06 Thread Helen Triolo
Because _x is not necessarily an integer, vValue1 is not guaranteed to 
be an integer either, which it must be for modulo to return the result 
you want.  Force it to be with


var vValue1 = Math.round(passed_MC._x - this.Maze_Horizontal_offset);

and it should work as you expect.

Helen

--
http://flash-creations.com
http://i-technica.com




Paul Steven wrote:


Experiencing a strange problem using the modulus operator.

Inside a function I have the following code:

var vValue1 = passed_MC._x - this.Maze_Horizontal_offset;
var vValue2 = 36;

var vTheResult =  vValue1 %  vValue2;

trace (vValue1 =  + vValue1);
trace (vTheResult =  + Number(vTheResult));

And here are the results I am getting from the trace statements:

vValue1 = 324
vTheResult = 5.6843418860808e-14



Surely it should give me a result of zero as 36 goes into 324 exactly 9
times.

The weird thing is if I just hard code the values as follows, it works

var vValue1 = 324;
var vValue2 = 36;

var vTheResult =  vValue1 %  vValue2;

trace (vTheResult =  + Number(vTheResult));

-

And here is the result of the trace statement:

vTheResult = 0

I am therefore totally confused!!!

Any help much appreciated. I am publishing for Flash 7 with Actionscript 1.0

Thanks

Paul
 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Move object along a curve

2006-03-03 Thread Helen Triolo

Eric,

Using the function for a parabola is the easiest way I can think of to 
let you drag a clip in an arc (but it's not quite the same as the yepp 
example -- you'd need to have the equation for that curve or figure out 
how to do it with a bezier for that kind of motion).  Here is some code 
which will make a square and a parabola and drag the square along that 
curve and change its scale and alpha according to where it is (paste 
into empty movie to see):


// parabola equation for curve facing left:   y**2 = -4ax
function parabola_x(a:Number, y:Number) {
   return( 0 - (y * y / (4 * a)) );
}

this.createEmptyMovieClip(s, 2);
s.beginFill(0,100);
s.moveTo(-20,-20);
s.lineTo(20,-20);
s.lineTo(20,20);
s.lineTo(-20,20);
s.endFill();

// vary a to change the shape of the parabola
var a:Number = 50;
this.createEmptyMovieClip(curve, 1);
curve.lineStyle(2, 0x66, 100);
curve.moveTo(200+parabola_x(a, -100), -100);
for (var y=(-90); y100; y+=10) {
   curve.lineTo(200+parabola_x(a, y), y);
}
curve._y += 200;
s._x = 200+parabola_x(a, 0);
s._y = 200;
s.onPress = function() {
   this.startDrag();
   this.onMouseMove = function() {
   this._x = 200 + parabola_x(a, 200-this._y);
   this._xscale = this._yscale = this._alpha = 140 - Math.abs(200 - 
this._y);

   }
}

s.onRelease = s.onReleaseOutside = function() {
   delete this.onMouseMove;
   this.stopDrag();
}

Helen

--
http://flash-creations.com
http://i-technica.com



eric dolecki wrote:


Thats very cool too - but I would like to dynamically affect the position of
a MC, not using a tween engine where i tell it go from here to there. I just
wanna be able to tell a mc to be:

a scale
an alpha
at this x, y

and when I move my mouse up/down, affect all three of those, while moving it
on an arc.

http://www.ericd.net/new_css/img/arc.jpg

Like that - ultimately with more than one object - using a bunch of them...



On 3/3/06, Moses Gunesch [EMAIL PROTECTED] wrote:
 


Eric,

Yeah Uhlmann's stuff is incredible, really sophisticated, although I
agree with you that it's not as approachable as it could be. Robert
Penner wrote a move-on-path thing that's been used in a lot of these
types of products. He da man.

Fuse 1.1 has simple (cubic) bezier functionality, and it's pretty
easy to use because you can pass relative positions for the control
points, much easier than absolute ones. Adding other tween props into
a bezier tween in no problem. (Check out fuse at my site
mosessupposes.com. It got a warm response at my Flash Forward pres,
which was really a great experience.)

Moses


On Mar 3, 2006, at 11:30 AM, eric dolecki wrote:

   


I foud something called AnimationPackage and its a huge collection
of stuff
- but I think its overkill :/ Nice stuff though!

 


I'd like to generate a curve (not a circle) - one that bows out to
the
right... and animate mcs along the curve. Up and down. Once I can
get that
working, I'll play with scale.
   


___
   




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Move object along a curve, another thought

2006-03-03 Thread Helen Triolo
You could probably approximate the yepp curve by just using the top half 
of the parabola, right?


Helen Triolo wrote:


Eric,

Using the function for a parabola is the easiest way I can think of to 
let you drag a clip in an arc (but it's not quite the same as the yepp 
example -- you'd need to have the equation for that curve or figure 
out how to do it with a bezier for that kind of motion).  Here is some 
code which will make a square and a parabola and drag the square along 
that curve and change its scale and alpha according to where it is 
(paste into empty movie to see):


// parabola equation for curve facing left:   y**2 = -4ax
function parabola_x(a:Number, y:Number) {
   return( 0 - (y * y / (4 * a)) );
}

this.createEmptyMovieClip(s, 2);
s.beginFill(0,100);
s.moveTo(-20,-20);
s.lineTo(20,-20);
s.lineTo(20,20);
s.lineTo(-20,20);
s.endFill();

// vary a to change the shape of the parabola
var a:Number = 50;
this.createEmptyMovieClip(curve, 1);
curve.lineStyle(2, 0x66, 100);
curve.moveTo(200+parabola_x(a, -100), -100);
for (var y=(-90); y100; y+=10) {
   curve.lineTo(200+parabola_x(a, y), y);
}
curve._y += 200;
s._x = 200+parabola_x(a, 0);
s._y = 200;
s.onPress = function() {
   this.startDrag();
   this.onMouseMove = function() {
   this._x = 200 + parabola_x(a, 200-this._y);
   this._xscale = this._yscale = this._alpha = 140 - Math.abs(200 
- this._y);

   }
}

s.onRelease = s.onReleaseOutside = function() {
   delete this.onMouseMove;
   this.stopDrag();
}



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Easing equations - explanation of parameters

2006-02-27 Thread Helen Triolo
From a post from Zeh in the archives 
(http://chattyfig.figleaf.com/pipermail/flashcoders/2004-July/117628.html),


In elastic's case, extra1 is 'amplitude' and extra2 is 'period'.

(any  parameters after the basic 4 apparently have different meanings 
depending on the type of tween).


Helen

--
http://flash-creations.com
http://i-technica.com



Keith Salisbury wrote:


Does anyone have a explanation of the parameters used in the class

mx.transitions.easing.Elastic

(t:Number, b:Number, c:Number, d:Number, a:Number, p:Number)


t = Current Timer
b = Initial Value
c = End Value - Initial Value
d = Duration

a = ?
p = ?



tia
keith
 




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] working with multiple sound objects.

2006-02-27 Thread Helen Triolo
You can.  But are your sound instances named room1Music or room1?  Does 
it make a difference if you correct that?


Helen

Matt Ganz wrote:


no. i thought you could just pass in a reference to the sound
constructor with the instance name of the movie clip that houses the
mp3 file.

On 2/27/06, eric dolecki [EMAIL PROTECTED] wrote:
 


I assume you forgot your attachSound code in your email?

On 2/27/06, Matt Ganz [EMAIL PROTECTED] wrote:
   


hi.

i have 3 sound objects that i'm working with in my app. i have them
all load when the site launches but i stop() them all at first because
i don't want them all to start playing. here's the code:

var room1Music:Sound = new Sound( _level0.room1_mc );
room1.setVolume( 80 );
room1.stop();
var room2Music:Sound = new Sound( _level0.room2_mc );
room2.setVolume( 80 );
room2.stop();
var room3Music:Sound = new Sound( _level0.room3_mc );
room3.setVolume( 80 );
room3.stop();

each of the sounds is set to 'start' and 'loop' in their respective mcs.

the problem is that when the site launches, room1 sound is stopped but
room2 and room3 play. why might that be happening? i can successfully
trigger the room1 sound a little further down in my site via:

room1.start(); // and it starts playing exactly where it should.

i guess i just don't understand why i can stop 1 of the sounds but not
all.

any insight is greatly appreciated.

thanks. -- matt.
 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] DataGrid Columns question

2006-02-22 Thread Helen Triolo
Just set the columnNames property of the datagrid.  Example in middle of 
page here: http://flash-creations.com/notes/servercomm_database.php


Helen

--
http://flash-creations.com
http://i-technica.com



Michael Stuhr wrote:


Oleg Filipchuk schrieb:


Hello list,
I'm populating DataGrid component from DB. And I need to specify what
columns have to be shown to user. 


Normally i'd say: why do you pull them in anyway ? but i guess you 
need them internally :_)


i'm in a somewhat similar situation right now, i guess you have to 
remove the Columns in your dataProvider and than set this data as your 
grid's dataProvider.


if that doesn't work, you'll have to be more clearer of what you 
already have. (provide some code)


micha




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: working with numbers loaded from XML was [Flashcoders] if notworking. (urgent help again?)

2006-02-05 Thread Helen Triolo
The decimal equivalent of octal 11, in the same way that 
trace(Number(0x33)) returns 51.  So Karthik's statement should just be 
revised to say that Number is suitable and correct if the aim is to 
convert/cast a string representation of a decimal number into that 
decimal number.


Helen


Ron Wheeler wrote:


What does Number(011)  return?

Ron

Karthik wrote:

At least when working with XML, I have found Number() to be fairly 
inconsistent in converting strings to numbers.  parseInt() seems to 
work everytime.
  



How exactly? An example would be good.

I find Number a lot more suitable and correct i.e. the aim is to
_convert_/_cast_ a string into a number. I don't want to _parse_ the
number out of a string.
e.g.
Number(1a) will return NaN.
parseInt(1a) will return 1.
Number(1 ) will return NaN.
parseInt(1 ) will return 1.

So.. Number():
a) doesn't mangle the data
b) depends on valid input - no whitespace etc.
c) is faster

-K




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


Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Helen Triolo
Looks like that info is in the swf header (Northcode pulls from that to 
do its getStageSize) but I don't know how you can access the header of a 
loaded swf from within Flash itself.


Helen

Éric Thibault wrote:

I already do that... but the width and height of the container clip 
takes into account any instances outside the boundary of the loaded 
SWF's stage...
So I'm getting the total with and height but want only the stage 
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage of 
the loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's 
dimentions only takes into account the instances present on frame 1... 
(mc_square 100*100 at (0,0) on a stage of 300*300 results in a 
container clip of 100*100!)


A+

j.c.wichman wrote:


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();
   
var myListener:Object = new Object();


myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
}; my_mcl.addListener(myListener);
my_mcl.loadClip(YOUR path to SWF here eg test.swf, path
to container here_root.dummy);

It should trace the width of your clip upon load. Is that what you mean?

Greetz
Hans





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


Re: [Flashcoders] Constrain width and height of a swf into a MC withloadMovieNum or loadClip or loadMovie ?

2006-02-02 Thread Helen Triolo
Or if you do want to resize it, use MovieClipLoader and a handler 
(instead of loadMovie) and do the resize in the onLoadInit function -- 
example code in the 2nd blue box under MovieClipLoader on this page: 
http://flash-creations.com/notes/dynamic_loadjpg.php


Helen

--
http://flash-creations.com
http://i-technica.com



j.c.wichman wrote:


Hi,
Do you mean as in masking?
If you don't want to resize the loaded swf, you could load it into a
scrollpane (with scrollbars dis or enabled), or you could apply a runtime
mask to your clip.
eg myLoadedClip.setMask (myViewportMask) 


Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of a f
Sent: Thursday, February 02, 2006 3:57 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Constrain width and height of a swf into a MC
withloadMovieNum or loadClip or loadMovie ?

  Hello,


I try to understand how to constrain a swf of width = 500 , height = 300 in
a movie-clip whose width=200 and height=247 without redimendionning the
*.swf.
(I know i will lose some visual information of the SWF, it is all right...)

Do you know how to do that ?

I just suceed to place the swf relative to a movie-clip with :
  movieclip_container.loadMovie(file.swf, level) but not to constrain
this SWF to the movie-clip dimension.

  



Thank you
Tony
 




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


Re: [Flashcoders] Constrain width and height of a swf into a MC with loadMovieNum or loadClip or loadMovie ?

2006-02-02 Thread Helen Triolo

a f wrote:

I have an error message 



a syntax error?


: is it mandatory to use the onLoadProgress 
 



no, only if you want to show something while the thing loads


handler  ?

Where I have to put this code in the timeline ? 



frame 1, main timeline, if all your other stuff's there

Helen


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


Re: [Flashcoders] Fav XML editor

2006-01-26 Thread Helen Triolo
Look in the archives for the subject 'xml editor' -- was discussed 
extensively 11/22 and 11/23/05.


Helen

--
http://flash-creations.com
http://i-technica.com




eric dolecki wrote:


I am starting to have to create more and more complex XML by hand on the
PC...

which is your favorite XML editor for authoring/editing XML files for Flash?

I have tried oXygen and am now about to try XMLSpy 2006 EE...

No one mention DW please ;)

- edolecki
 




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


Re: [Flashcoders] xml whitespace problem

2006-01-24 Thread Helen Triolo
Everything within a CDATA is read exactly as is, I believe -- that's the 
point of using it.  whitespace is the whitespace between tags, not 
within a CDATA text node, so ignoreWhite shouldn't affect it.  I think 
you'll have to butt your text content up against the [ and ] to make it 
read right.


Helen

--
http://flash-creations.com
http://i-technica.com



david kraftsow wrote:

yeah that does nothing. you would think it would solve the problem but 
no...


JesterXL wrote:


XML.ignoreWhite = true;
XML.load

- Original Message - From: david kraftsow 
[EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, January 24, 2006 4:34 PM
Subject: [Flashcoders] xml whitespace problem


Hi.

Whats the easiest way to strip out that annoying whitespace from your 
xml nodes?
I have a lovely human-readable xml file with tons of carriage returns 
and tabs. When I load it into a flash XML object the leaf/content 
nodes all have tabs and carriage returns in them. Setting the 
ignoreWhite property does nothing. [?] Example:


root_1 attr_1=blahblah
   node_1
   ![CDATA[
   Leaf content 1 blah blah blah.
]]
   /node_1
/root_1

When I parse out that leaf content I get a string like \n\n 
   Leaf content
Very annoying. I don't have to write a traversal method to strip it 
all out do I? Surely there is a better way!


DK




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


Re: [Flashcoders] Combobox none selected

2005-12-21 Thread Helen Triolo

Merrill, Jason wrote:


Currently, my code is:

//( locations_cb is my combobox)
function change(evt){
evt.target.selected = evt.target.selectedItem.label
}
locations_cb.addEventListener(change, this);

create_btn.onRelease = function(){
myFunction(locations_cb.selected, [...morevalues])
}

This works, but only as long as something is selected from the combobox.
If nothing is selected by the user, the value gets passed as [object
Object] - I understand why if nothing is selected, but how do I
overcome this - by automatically setting something to be selected?  If
so, how?

I tried this when the frame containing my form is loaded:

locations_cb.selectedIndex=0; 
 



That line does the job for me (in another project, in which I have that 
line right after the one in which I set the combobox dataProvider).  I'm 
not sure what you're referring to by locations_cb.selected in your 
function call though -- shouldn't that be locations_cb.selectedItem?  
(or selectedIndex)


Helen


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


[Flashcoders] amfphp database editing question

2005-12-21 Thread Helen Triolo
I'm trying to get amfphp to work for simple database editing.  It 
selects and displays records in a datagrid fine, and when I select one 
and click a Delete button, it gets deleted from the database, but my 
onDeleteScore function is not called (even though the NC debugger shows 
Result: (boolean) true).  I'm not sure how to set up the service and 
pending call variables when multiple operations are done -- do you 
create one service object and one pendingCall object and then assign 
different relayResponder objects to the pc.responder each time a new 
operation is done?  Or should a new pendingCall object be created for 
each operation?  (or a new service object altogether?)  I tried a 
variety of different ways and never can get my onDeleteScore function to 
be called.   Code for the delete part:


// this is never called
function onDeleteScore(re:ResultEvent) {
   trace('result='+re.result);
   scores_dg.removeItemAt(deleteIndex);
   msg_ta.text = Record was deleted;
}

function deleteRecord() {
   // remember which element of the array is to be deleted
   deleteIndex = scores_dg.selectedIndex;
   // get the id of the record to delete, to pass it to deleterecord.php
   var id:Number = scores_dg.selectedItem.record;
  
   // (tried new pc and same pc used for select operation -- neither 
worked)

   var pc:PendingCall  = _service.deleteScore(scores_dg.selectedItem.id);
   pc.responder = new RelayResponder(this, onDeleteScore, onDbError);
}

delete_btn.addEventListener(click, deleteRecord);

thanks for any suggestions/advice,
Helen



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


Re: [Flashcoders] amfphp database editing question

2005-12-21 Thread Helen Triolo
Thanks for the reply! As I was typing in more explanation, I realized 
what was wrong. This


delete_btn.addEventListener(click, deleteRecord);

should be

delete_btn.addEventListener(click, Delegate.create(this, 
deleteRecord)); to make the scope right to find onDeleteScore.


Made the change and it works. So in general, it's correct to create a 
single Service instance and then use a different PendingCall instance 
for each operation?


Helen

JesterXL wrote:


This is correct:

var pc:PendingCall  = _service.deleteScore(scores_dg.selectedItem.id);
pc.responder = new RelayResponder(this, onDeleteScore, onDbError);

However, not sure why your result/fault functions aren't getting called, 
even weirder is your seeing the NCD saying it did.  Your code that you've 
posted looks good.  Are those functions defined in the same place, you just 
didn't post 'em?


- Original Message - 
From: Helen Triolo [EMAIL PROTECTED]

To: Flashcoders Mailing List flashcoders@chattyfig.figleaf.com
Sent: Wednesday, December 21, 2005 2:01 PM
Subject: [Flashcoders] amfphp database editing question


I'm trying to get amfphp to work for simple database editing.  It
selects and displays records in a datagrid fine, and when I select one
and click a Delete button, it gets deleted from the database, but my
onDeleteScore function is not called (even though the NC debugger shows
Result: (boolean) true).  I'm not sure how to set up the service and
pending call variables when multiple operations are done -- do you
create one service object and one pendingCall object and then assign
different relayResponder objects to the pc.responder each time a new
operation is done?  Or should a new pendingCall object be created for
each operation?  (or a new service object altogether?)  I tried a
variety of different ways and never can get my onDeleteScore function to
be called.   Code for the delete part:

// this is never called
function onDeleteScore(re:ResultEvent) {
   trace('result='+re.result);
   scores_dg.removeItemAt(deleteIndex);
   msg_ta.text = Record was deleted;
}

function deleteRecord() {
   // remember which element of the array is to be deleted
   deleteIndex = scores_dg.selectedIndex;
   // get the id of the record to delete, to pass it to deleterecord.php
   var id:Number = scores_dg.selectedItem.record;

   // (tried new pc and same pc used for select operation -- neither
worked)
   var pc:PendingCall  = _service.deleteScore(scores_dg.selectedItem.id);
   pc.responder = new RelayResponder(this, onDeleteScore, onDbError);
}

delete_btn.addEventListener(click, deleteRecord);

thanks for any suggestions/advice,
Helen



___
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


 




--
Helen Triolo
Flash Programmer/Instructor, Web Developer
http://flash-creations.com • http://i-technica.com
ph: 301.424.6037 • email: [EMAIL PROTECTED]





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


Re: [Flashcoders] DataGrid - Content

2005-12-14 Thread Helen Triolo
Put your contents into one array with object elements and use the 
columnNames property to specify only the columns (ie, object properties) 
you want to show.  For example,


mydata = [{company:a, id:3}, {company:b, id:54}, etc];
mygrid.columnNames = [company];

There's a working example here: 
http://flash-creations.com/notes/servercomm_database.php


Helen


Helmut Granda wrote:

Is there anyway to add Data to the Data grid but to keep some of the 
data hidden for a later use?


EXE:
company = [a,b,c,d,e,f,g,h,i]
id = [3,54,97,23,65,87,54,23]

I am displaying the company array into my DataGrid, but I would like 
to keep the ID in relation to the company, I can create an array and 
display the company and its ID, but is there anyway to hide the ID 
but have it ready and linked to the company array?




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


Re: [Flashcoders] DataGrid - Content

2005-12-14 Thread Helen Triolo

Helmut Granda wrote:


Thanks all for your help on this.

What I can't get my head around and maybe that is why I cant get this 
to work is, how does the DG knows to get the info from certail columns 
only?


I dont see the declaration that the information belongs to the DG.

Using Helen's sample

mydata = [{company:a, id:3}, {company:b, id:54}];
mygrid.columnNames = [company];


one more line (should've included for clarity before):
mygrid.dataProvider = mydata;



How does mygrid knows to get the column company from mydata when my 
data has not yet beein delared to have a relationship with mygrid?




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


Re: [Flashcoders] universal toString() function

2005-12-07 Thread Helen Triolo
Here is a start for you, from Dave Yang: 
http://quantumwave.com/flash/listObject.html.  Somewhere he had a method 
to show arrays formatted in a way similar to what you show too, but I 
can't find that.  This one works nicely though -- I tried a quickly 
modified version to see:


var o:Object = {
   x:5,
   a:['abc', 'def', 'ghi'],
   c:'a string',
   d:{p1:17, p2:'something else', p3:{a:'here', b:'there'}, p4:[1, 2, 
3, 4]}

};

function tabs() {
  var t = ;
  for (var i = 0; ilistObj.tabs; i++) {
 t += \t;
  }
  return t;
}

function listObj(o) {
  listObj.tabs++;
  ASSetPropFlags(o, null, 6, true);
  var t = ;
  for (var p in o) {
  if (p != __proto__) {
 var v = o[p];
 switch (typeof v) {
case function:
   //if (_global[p] != null) t += (tabs()+p+()+\n) + 
listObj(_global[p]);

   //else t += (tabs()+p+()+\n);
   break;
case object:
   t += (tabs()+p+\n) + listObj(v);
   break;
default:
   t += (tabs()+p+: +v+\n);
 }
 if (listObj.tabs  1) t += \n;
  }
  }
  t += \n;
  listObj.tabs--;
  return t;
}

listObj.tabs = -1;

trace(listObj(o));

I'll look forward to your nice modified version :)

Helen

Andreas Weber wrote:


I'm quite sure that this must be around somewhere, but this time I didn't
have any luck searching the archives...

What I'm looking for is similar to a deep-copy/clone method (e.g.
Arul/Tatsuo
http://chattyfig.figleaf.com/mailman/htdig/flashcoders/2004-March/106149.htm
l) but instead of getting a clone of the object in return, I'd like to get a
String representation of the object.

Example of the desired functionality:

o = {a:1, b:2, c:{c1:['a','b','c'], c2:true}};
var s:String = universalToString(o);
trace(s);

Output:   {a:1, b:2, c:{c1:['a','b','c'], c2:true}}

In my case the object will not contain any methods, just (deeply nested)
'vanilla' Objects, Arrays, Strings, Numbers and Booleans.

Thanks for any pointers!

--
Andreas Weber
motiondraw.com
 



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


Re: [Flashcoders] Why didn't I listen in maths class...

2005-12-03 Thread Helen Triolo

x =  r * sinA / (1 - sinA)

(Math teachers told my daughter yesterday she'd need sin and cos someday 
so she came home and made me give her three examples of how/why I've 
used it with flash -- if anyone has any good ones besides eyes following 
mouse, moving object on a line relative to horizon, 3d, making a dial 
spin, I'd be happy to have more to pass on to her)


Helen

David Peek wrote:


Hi List,

I'm trying to figure out what radius to make n number of circles fit 
around a circle of radius r.  Several diagrams later I'd got it down to:


sinA = x / (x + r)

Where A is half the angle required by each circle ((360/n)/2), x is 
the radius we're looking for and r is the radius of the circle in the 
middle.  Sadly my maths just aren't up to solving for x...


Maths teachers are always teeling you you'll need algebra one day...  
Luckily there's a Flashcoders :P


Many thanks,
David



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


Re: [Flashcoders] Q: Random wave pattern on single line

2005-12-01 Thread Helen Triolo
It's an example with Ivan Demicki's Path class: 
http://dembicki.org/path/index-eng.html


Helen

[EMAIL PROTECTED] wrote:


I want to create a random wave pattern on a single line using the drawing API.
Can anyone suggest a starting point for creating and drawing the random motion?
I need to vary the amplitude.

I seem to recall seeing a downloadable flash demo/tutorial of motion on an 
animated wave path, I believe it was a boat on waves, but I forget
where.
ANyone recall seeing this?
 



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


Re: [Flashcoders] swf to svg

2005-11-13 Thread Helen Triolo

Yes:  http://flash-creations.com/notes/sample_svgtoflash.php

(What is thecanvasproject?)

Helen

Eric R. Shinn wrote:

Is there ActionScript 2.0 code out there to convert SVG to an object  
the DrawingAPI can understand?


Cheers,

Eric R. Shinn
[EMAIL PROTECTED]



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


Re: [Flashcoders] Double line returns when reading vars.txt file

2005-11-11 Thread Helen Triolo
The only way I know around that without using html formatting is a 
processing-intensive replacement of crlf's with just lf's:


str = str.split('\r\n').join('\n');

It's an ok solution if you don't have too much text.

Helen

Marc Hoffman wrote:

This gets displayed in a text field. Problem is, Flash is 
double-spacing every carriage return.




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


Re: [Flashcoders] timestamp conversion problems

2005-11-07 Thread Helen Triolo
If you tack 3 zeros on the end and do a new Date() on it, it returns the 
right date.  No idea if that works for all dates in the CMS though -- 
just my best guess based on playing around with the numbers you gave:


trace(new Date(111553560));
// Sun May 8 03:00:00 GMT-0400 2005

Helen

[EMAIL PROTECTED] wrote:


Hi everybody,

I'm working on a project that's running off a Content Management System. There
are some date fields and I can't work out how they're encoded - I'm guessing
that it's a unix/mysql timestamp but I haven't been able to find the right
method of changing it back to an AS Date object.

Example:

CMS shows 8th May 2005
XML outputs 1115535600

Any ideas on how to get the correct date from that number?

Thanks - Nils.
___
 



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


Re: [Flashcoders] setChangeHandler no longer works

2005-11-07 Thread Helen Triolo
I just tried it -- it works fine.  Did you enter items in the label 
field for the combobox, and did you name it cboIssueDates?


You can also do it without the listener object (essentially using the 
current timeline as the listener):


function showSelection(evt:Object) {
   trace ( You selected + evt.target.selectedItem.label);
}

cboIssueDates.addEventListener (change, showSelection);

More on the same idea for other components here: 
http://flash-creations.com/notes/components_intro.php


Helen

Miles Thompson wrote:



The movie has been migrated from Flash MX to MX 2004.

The setChangeHandler used to show up in blue in MX, but does not do so 
in MX 2004. This has presumably taken it's place:



cboIssueDatesLstnr = new Object();

cboIssueDatesLstnr.change = function(eventObj){
var eventSource = eventObj.target;

var theSelectedItem = eventSource.selectedItem;
var theSelectedItemLabel = theSelectedItem.label;

trace ( You selected +theSelectedItemLabel+.);
}

cboIssueDates.addEventListener (change, cboIssueDatesLstnr);

But this was lifted from MAcroMedia's Business Directory Sample, and 
it doesn't work either. Heck, the trace() never displays.


This is what I had, and which worked, and still works, in Flash MX:

cboIssueDates.setChangeHandler( loadStory);

function loadStory(component)
{
GetStories( component.getSelectedItem().data );
BkIssPrntBtn( cboIssueDates.getSelectedItem().data, 
_root.lOKtoPrint );

_root.dtDate = component.getSelectedItem().data ;
}


Three questions, two of which are rhetorical:
1. Why did MM break this?
2. Why do the examples on listeners, copiously published, not work? At 
least this one doesn't?


3. Humbly, what do I have to do to fix this?

Feeling pretty frustrated - Miles



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


Re: [Flashcoders] Preloading locally

2005-11-03 Thread Helen Triolo
Yes, apparently :)  Couldn't you test about the memory (I don't know the 
answer) by loading some big swfs sequentially into a movieclip and 
checking the memory usage to see if it goes up after each load or stays 
the same?  Maybe someone else can give you a definitive answer.  About 
preloading, I can't think that would make any sense to do since 
preloading = load from web server to hard drive (cache) only, not hard 
drive to memory.


Helen

[EMAIL PROTECTED] wrote:


Do I need to reply to myself?
cheers

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lieven
Cardoen
Sent: donderdag 3 november 2005 9:25
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Preloading locally

I make lots of cd's (sometimes with frustration as result :-() and I was
wondering if it makes sense to preload swf's. I have like 14 swf-modules
that are used throughout the cd. Each module is an exercise-type.



Online it certainly makes sense to preload, but when all of the content
is on the user's harddisk (full installation), does it make sense then?
Flash will probably load the swf in the memory when needed, but if after
that another swf is loaded into the same movieclip, does the previous
swf stay in the memory or is it cleaned up (and is this the
responsibility of Flash or OS?).





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


Re: [Flashcoders] Forcing Flash going to next frame while executingcode? + MultiThreading in Flash?

2005-11-02 Thread Helen Triolo
Sorry -- it looks like I mistakenly interpreted the problem of the 
original poster as being unable to even read the xml file in without a 
timeout error (and thought that the suggested solution was to do the 
read over several frames or timed intervals), but I guess the problem 
was actually just being able to parse it without a timeout.  For that, I 
can imagine several ways to solve the problem.  Thanks for the replies.


Helen

Glenn J. Miller wrote:


Helen,

I'm going to assume you've downloaded the XML source data for discussions
purposes. If that isn't the case, I stand corrected and let me know. Now, on
to the show...

Is it possible to load the interface up in 'logical' chunks? If so, one way
to do that, and we've done so successfully on some complex XML files, is to
run Xpath methods on the source data to return the various data sets
required...

Hope this helps...

--
Dok
Skyymap Inc.

 



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


Re: [Flashcoders] Circle, rotation to ?

2005-11-01 Thread Helen Triolo

Assuming your circle has a center registration point:

import mx.transitions.Tween;
import mx.transitions.easing.*;

function rotation(dx:Number, dy:Number):Number {
  return Math.atan2(dy, dx) * 180/Math.PI;
}
circle.onRelease = function() {
  new Tween(this, _rotation, Strong.easeOut, this._rotation, rotation(_xmouse - this._x, _ymouse-this._y), 1, true); 
};


I added it to the bottom of this page: 
http://flash-creations.com/notes/asclass_math.php

The only thing is you're at the mercy of the Tween class to determine which way 
the rotation will go, so you might need to modify it some.

Helen

eric dolecki wrote:


I have a math question. Lets say I have a circular movieclip on the stage.
It has a directional marker on it so you know which direction its rotated
to.

click on the circle, now with easing (even just linear), rotate to the
movieclip from its current rotation to the destination angle (where the
movieclip was clicked on). To work in full 360 degrees.

Anyone have any good suggestions on the best way to code this, or an example
to boot?

Thanks,
e.dolecki
 



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


Re: [Flashcoders] Recursive Tween only firing once

2005-10-30 Thread Helen Triolo

Nick,

The subject sounds right, but I don't see a recursive call in your 
code.  Here's an example of a recursive call to startTween to produce 
sequential alpha tweens on a series of objects: 
http://flash-creations.com/notes/sample_tweensequence.php#series


Helen

Nick Weekes wrote:


Hi all,

I would like to create a series of textfield objects (using
CreateEmptyMovieClip/CreateTextField), and have each textfield tween, and
then remove itself.

This all works fine, I have 50 or so textfields on the stage, but instead of
each tween executing individually, the tweens for all textifields occur at
the end of the process.

My code looks like this:


 CODE START

 // ArrayHolder is an array object which holds the text strings I want to
convert into TextField objects
  for (var i:Number = 0; iArrayHolder.length; i++) {
   var TempString:String = ArrayHolder[i];
   createText(i, TempString);
  }

static function createText(QuoteIndex:Number, QuoteText:String) 
{
 
 // my_obj[QuoteIndexStr] = dynamically created variable, acts as the

holding movieclip
 // Create Holder movieclip and recursive textfield objects
 QuoteIndexStr = String(QuoteIndex);
 my_obj[QuoteIndexStr] =
_root.createEmptyMovieClip(click_mc,_root.getNextHighestDepth());
 my_obj[QuoteIndexStr]._visible = true;
 var NewText:TextField = my_obj[QuoteIndex].createTextField(NewText,
_root.getNextHighestDepth(), 100, 100, 10, 10);

 // Create and configure TextFormat object
 var my_fmt:TextFormat = new TextFormat();
 my_fmt.color = 0xFE912C;
 my_fmt.font = HelveticaNeue MediumCond;
 my_fmt.size = 18;

 // Finish configuring TextField object ands apply TextFormat
 NewText.multiline = false;
 NewText.embedFonts = true;
 NewText.text = QuoteText;
 NewText.setTextFormat(my_fmt);
 NewText.autoSize = true;

// Position the TextField object randomly on the stage
 var MaxX:Number = Stage.width - (my_obj[QuoteIndexStr]._width+50); //make
sure max poss random x is less than stage width 
 var MaxY:Number = Stage.height - (my_obj[QuoteIndexStr]._height+50);

 var randomNumX:Number = Math.round(Math.floor(Math.random() * (MaxX - 0 +
1)) + 0);
 var randomNumY:Number = Math.round(Math.floor(Math.random() * (MaxY - 0 +
1)) + 0);
 my_obj[QuoteIndexStr]._x = randomNumX;
 my_obj[QuoteIndexStr]._y = randomNumY;

 // Tween the Holder MovieClip object
 var tween_handler:Object = new Tween(my_obj[QuoteIndexStr], _alpha,
Strong.easeIn, 100, 0, 3, true);
 tween_handler.onMotionFinished = function() 
 {

 trace(onMotionFinished triggered);
 }
}

 CODE END

I am clearly not understanding the mechanics of this, could someone explain
why the tweens do not occur before the function returns back to the calling
loop, but when the loop has completed?

Cheers,

Nick
 



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


Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Helen Triolo
Here's one I just made (and tested) from a draw circle prototype that 
then draws another circle in reverse (before the endfill is applied -- 
necessary to get a cutout):


// r1 = radius of outer circle
// r2 = radius of inner circle (cutout)
// x, y = center of donut
MovieClip.prototype.drawDonut = function (r1, r2, x, y) {
  var TO_RADIANS:Number = Math.PI/180;
  this.moveTo(0, 0);
  this.lineTo(r1, 0);

  // draw the 30-degree segments
  var a:Number = 0.268;  // tan(15)
  for (var i=0; i  12; i++) {
 var endx = r1*Math.cos((i+1)*30*TO_RADIANS);
 var endy = r1*Math.sin((i+1)*30*TO_RADIANS);
 var ax = endx+r1*a*Math.cos(((i+1)*30-90)*TO_RADIANS);
 var ay = endy+r1*a*Math.sin(((i+1)*30-90)*TO_RADIANS);
 this.curveTo(ax, ay, endx, endy);   
  }


  // cut out middle (go in reverse)
  this.moveTo(0, 0);
  this.lineTo(r2, 0);

  for (var i=12; i  0; i--) {
 var endx = r2*Math.cos((i-1)*30*TO_RADIANS);
 var endy = r2*Math.sin((i-1)*30*TO_RADIANS);
 var ax = endx+r2*(0-a)*Math.cos(((i-1)*30-90)*TO_RADIANS);
 var ay = endy+r2*(0-a)*Math.sin(((i-1)*30-90)*TO_RADIANS);
 this.curveTo(ax, ay, endx, endy);   
  }


  this._x = x;
  this._y = y;
}

// example usage:
createEmptyMovieClip(d, 1);
d.beginFill(0xaa, 60);
d.drawDonut(100, 50, 200, 200);
d.endFill();

Helen

Navneet Behal wrote:

After putting a couple of hours on the problem, I am still in a daze 
on how would one go about making a doughnut shape (circle with cut-out 
in the center) using the drawing API.


I'm not talking about drawing a circle using:

lineStyle(BIGNUMBERHERE, color, alpha);

I'd like to put in a gradient fill into a doughnut shape. And it has 
to be a doughnut, not a simulation of it (ie. not by drawing 2 circles 
over each other and keeping the center cirlce the same as the 
background color). Real dunkin' doughnut!


Any ideas?







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


Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Helen Triolo
That's a very long keyword.  But yes, that's crucial.  I decided to 
write it up so I wouldn't forget again that it's only the mask that 
requires a reverse cutout: 
http://flash-creations.com/notes/dynamic_drawingapi.php#cutout


Helen

Navneet Behal wrote:

Ah.. reading the code again along with your post I realize the AOL 
Keyword is BEFORE the end fill is applied which is necessary to make 
the cut-out.


Got it... thanks again.

Regards,
Navneet



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


Re: [Flashcoders] removeEventListener not working?

2005-10-27 Thread Helen Triolo
You have to store a reference to the delegate to be able to remove it.  
A modification of a post by Till S:


function clearListeners():Void {
  fntController.removeEventListener('onFinished', fdelegate);
}
var fdelegate = Delegate.create(this, fontsLoaded);
fntController.addEventListener('onFinished', fdelegate);

cleanListeners();

Helen


Martin Klasson wrote:


I pasted in wrong line at the bottom, should be like this:

// ADD
fntController.addEventListener('onFinished', Delegate.create(this,
fontsLoaded));

// REMOVE DOESN'T WORK
fntController.removeEventListener('onFinished', Delegate.create(this,
fontsLoaded));


The problem is that I have used the Delegate in the addEventListener.

If I skip the Delegate on both the add and remove, then it works.
-but then I will have the wrong scope as well in the functions that gets
called ;(

So how do I remove a eventlistener when it has been added with a
delegate?

/ martin
 



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


[Flashcoders] TransitionManager documentation?

2005-10-21 Thread Helen Triolo
Trying again:  is it anywhere documented what each of the parameters 
are, and what values they can be set to, for this statement (copied from 
http://www.macromedia.com/devnet/flash/articles/tweening_09.html)?  And 
how to use the addTransition method of TransitionManager?


TransitionManager.start(target_mc, {type:Fly, direction:0, duration:3, 
easing:Elastic.easeInOut, startPoint:6, param2:empty});


Helen


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