[Flashcoders] Get html source code of mx.controls.HTML control (AIR)

2009-01-10 Thread Jeroen Beckers
Hi,

Situation: I've loaded a webpage into the mx:HTML / control and it
displays just fine. What I want now, is the sourcecode of the loaded
document, without loading the document again. Is this possible ?

I found this tutorial:
http://labs.adobe.com/wiki/index.php/Apollo:Articles:Using_HTML_in_Flex-based_Apollo_Applications

And it's talking about a JavaScriptObject class located in flash.html. I am
however unable to find this class... The examples in this tutorial would be
perfect, if only I would have suck a JavaScriptObject class...

Any suggestions ?

Greetings,
Jeroen Beckers
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: Get html source code of mx.controls.HTML control (AIR)

2009-01-10 Thread Jeroen Beckers
Sorry, wrote to the wrong list. I'm resending this to FlexCoders

On Sat, Jan 10, 2009 at 4:39 PM, Jeroen Beckers thedauntl...@gmail.comwrote:

 Hi,

 Situation: I've loaded a webpage into the mx:HTML / control and it
 displays just fine. What I want now, is the sourcecode of the loaded
 document, without loading the document again. Is this possible ?

 I found this tutorial:

 http://labs.adobe.com/wiki/index.php/Apollo:Articles:Using_HTML_in_Flex-based_Apollo_Applications

 And it's talking about a JavaScriptObject class located in flash.html. I am
 however unable to find this class... The examples in this tutorial would be
 perfect, if only I would have suck a JavaScriptObject class...

 Any suggestions ?

 Greetings,
 Jeroen Beckers

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


Re: [Flashcoders] Design pattern for conditional Interfaces ?

2008-03-23 Thread Jeroen Beckers
Hi Thomaz,

Wouldn't that be the exact same thing as testing against the interface
references that's stored which each analyzer (as I suggested in my post) ?

Since there is no compile-time way to check this, i'm going to check all the
items with all the analyzers in the analyze() method and give a runtime
error if something's wrong.

Thanks for thinking with me though! :)

On Sun, Mar 23, 2008 at 2:29 AM, Andrei Thomaz [EMAIL PROTECTED]
wrote:

 and if each IAnalyzer implements a function called getAnalyzedProperty(),
 returning a string, and if each item (using an IItem interface, for
 example)
 implements a function called hasProperty(), receiving a string as
 parameter?
 So, you could check if the item has the getProperty() function the
 analyzer requires, at runtime, without having runtine errors... You could
 also have some getProperty( strProperty:String ):Object function, defined
 at
 IItem interface.

 interface IAnalyzer
 {
  getAnalyzedProperty():String;
 }

 interface IItem
 {
  hasProperty( strProperty:String ):Boolean;
  getProperty( strProperty:String ):Object;
 }


 just a guess,
 andrei



 On Sat, Mar 22, 2008 at 11:39 AM, Jeroen Beckers [EMAIL PROTECTED]
 wrote:

  Hi list!
 
  Situation: I have a class that analyzes stuff. There are different
  analyzing
  classes, such as HeightAnalyzer, WeightAnalyzer, LevelAnalyzer,
 etc.
  You can add an analyzer to the class by using
  'myClass.addAnalyzer(newAnalyzer:IAnalyzer)'.
  As you can see, there is an IAnalyzer interface which all Analyzer's
  implement. Every time you add an analyzer, it is added to the list using
  the
  Decorator pattern. (Every analyzer must analyze a list and pass it to
 the
  next analyzing test)
 
  Now, the analyzer's analyze certain items. Every analyzer requires the
  analyzed item to have a certain set of methods. The HeightAnalyzer
  requires
  a getHeight(), the LevelAnaylzer requires a getLevel(), etc. I want to
  have
  a different interface for each analyzer, so that I can easily add
  analyzers
  (+interfaces).
 
  If I want to analyze a list of items, those items must implement the
  correct
  interface, according to which analyzers you have added to the class. Fe:
 
  var myClass:AnalyzerBundle = new AnalyzerBundle();
  myClass.addAnalyzer(new HeightAnalyzer());
  myClass.addAnalyzer(new LevelAnalyzer());
  myClass.analyze(new Array(item1, item2, item3));
 
  What I am looking for now, is a way to make sure that item1, item2 and
  item3
  all implement the IHeightItem and ILevelItem interfaces.
 
  I've found a couple of ways to do this, but none of them seemed really
  good
  to me. One of them was to have every Analyzer keep track of the
 interface
  associated with it, and check if they implement the correct interface,
  once
  the analyzer is called. But this would give ugly runtime errors...
  I'm pretty sure that it can't be done at compile time, but if anyone
  happens
  to know some way (hack), or a better way for the runtime errors, please
  tell
  me :-). All ideas are welcome
 
  Ps: I've just made up all these names, my question is about the
 technique
  to
  be used, not about the project :)
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


[Flashcoders] Design pattern for conditional Interfaces ?

2008-03-22 Thread Jeroen Beckers
Hi list!

Situation: I have a class that analyzes stuff. There are different analyzing
classes, such as HeightAnalyzer, WeightAnalyzer, LevelAnalyzer, etc.
You can add an analyzer to the class by using
'myClass.addAnalyzer(newAnalyzer:IAnalyzer)'.
As you can see, there is an IAnalyzer interface which all Analyzer's
implement. Every time you add an analyzer, it is added to the list using the
Decorator pattern. (Every analyzer must analyze a list and pass it to the
next analyzing test)

Now, the analyzer's analyze certain items. Every analyzer requires the
analyzed item to have a certain set of methods. The HeightAnalyzer requires
a getHeight(), the LevelAnaylzer requires a getLevel(), etc. I want to have
a different interface for each analyzer, so that I can easily add analyzers
(+interfaces).

If I want to analyze a list of items, those items must implement the correct
interface, according to which analyzers you have added to the class. Fe:

var myClass:AnalyzerBundle = new AnalyzerBundle();
myClass.addAnalyzer(new HeightAnalyzer());
myClass.addAnalyzer(new LevelAnalyzer());
myClass.analyze(new Array(item1, item2, item3));

What I am looking for now, is a way to make sure that item1, item2 and item3
all implement the IHeightItem and ILevelItem interfaces.

I've found a couple of ways to do this, but none of them seemed really good
to me. One of them was to have every Analyzer keep track of the interface
associated with it, and check if they implement the correct interface, once
the analyzer is called. But this would give ugly runtime errors...
I'm pretty sure that it can't be done at compile time, but if anyone happens
to know some way (hack), or a better way for the runtime errors, please tell
me :-). All ideas are welcome

Ps: I've just made up all these names, my question is about the technique to
be used, not about the project :)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Tweening Engines for AS3

2008-03-22 Thread Jeroen Beckers
I heard a lot of people used http://blog.greensock.com/tweenliteas3/ . Not
sure if it's dependent on Flex / Flash, but I don't really think so.

On Sat, Mar 22, 2008 at 9:57 PM, Jesse Warden [EMAIL PROTECTED]
wrote:

 What are people using nowadays besides Flash CS3's built-in ones and Flex
 3's built in ones?  Looking for something lightweight and that has no
 Flash
 or Flex dependencies.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


[Flashcoders] Coding strategic enemy behavior in a shooter game

2006-12-20 Thread Jeroen Beckers

Hi!

I'm creating a little shooter game and I want the enemies to have some 
sort of followable pattern. I can create the patterns and such (that's 
not the problem) but I'm having difficulties as to how to implement 
it... I have been looking at the Strategy / State pattern but I can't 
really find how that works for this case... A friend told me about the 
'Behavior pattern' but I didn't have much luck finding a good 
explanation about this pattern. (I've also searched in 'Head First 
Design patterns' or 'Advanced Design Patterns for AS 3.0' but no luck 
there neither...)...


Any help about how I could structure this is really welcome!

Thx for reading (and/or replying :) )!
___
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] UML Diagram generator

2006-12-20 Thread Jeroen Beckers

Take a look at Enterprise Architect :).

Ned Perry wrote:

Hi

Does anyone know of any software that can autogenerate UML style diagrams 
describing AS2 classes/relationships?

Cheers

ned





This e-mail (and any attachments) is confidential and may contain 
personal views which are not the views of Cimex Media Ltd and 
any affiliated companies, unless specifically stated. It is intended 
for the use of the individual or group to whom it is addressed. If 
you have received it in error, please delete it from your system, 
do not use, copy or disclose the information in any way nor act in 
reliance on it and please notify [EMAIL PROTECTED]

This email was scanned by Postini, the leading provider in Managed Email 
Security. http://www.postini.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] this.onEnterFrame fails to alter this

2006-12-20 Thread Jeroen Beckers

Hi Michael,

First: You may NEVER ever ever use _root in a class. A class has to be 
able to function anywhere, and the way you have coded it now, it needs a 
fixed timeline to work. Pass '_root' as an argument to the constructor 
and store it as an instance variable.


And inside the onEnterFrame, you can use 'this' to refer to the tooltip 
movieclip.

Are you certain it is removed (trace(this)) or is it just out of sight ?

Greets,
Jeroen Beckers

Mendelsohn, Michael wrote:

Hi list...

I can't figure out why the onEnterFrame attached to _root.tooltip in my
displayTip function removes that MC after one frame.  If I set the
onEnterFrame to alter any other MC on the stage, no problem, but when I
set it to alter itself, it errors.  Any ideas?

Thanks,
- Michael M.

class toolbarFunctions extends MovieClip {
private var tipID:Number;
function toolbarFunctions() {
}
function onRollOver():Void {
tipID = setInterval(this, displayTip, 1000);
}
function onRollOut():Void {
_root.tooltip.removeMovieClip();
clearInterval(tipID);
}
function displayTip():Void {
clearInterval(tipID);
_root.createEmptyMovieClip(tooltip, 554);
_root.tooltip.createTextField(tip, 1, 0, 0, 100, 100);
_root.tooltip.tip.text = hi;
// FAILS HERE:
_root.tooltip.onEnterFrame = function():Void  {
_root.tooltip._x = _root._xmouse;
_root.tooltip._y = _root._ymouse;
};
}
}

___
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] Preloader or not

2006-09-17 Thread Jeroen Beckers
Normally, it already checks for 'getBytesLoaded() == getBytsTotal()' (or 
a variation). Could you post your ActionScript?


Benjamin van Gogh wrote:

Hi there,
I used a tutorial on Adobe.com to create a preloader from some 
tutorial files. Works great, but the preloader displays the animation 
ALWAYS. Even if there's nothing to preload, cause it has been loaden 
already. Is there any way to determin if the content already has been 
loaded and then go to content, skipping the animation?


Kind regards,
Ben

___
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] BitmapData.getPixel() - negative value ?

2006-09-15 Thread Jeroen Beckers

var n:Number = -16777216
trace(n.toString(16));

Gives me:

-100 ?



Claus Wahlers wrote:



pixel = -16777216


-16777216 is 0xff00 (solid black)

Try to trace pixel.toString(16)

Cheers,
Claus.
___
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] BitmapData.getPixel() - negative value ?

2006-09-15 Thread Jeroen Beckers

Thank you for the link, I will surely read it!

Since I don't need the alpha, I changed getPixel32 to getPixel (oh, 
sorry for wrong topic-title) and it works fine now. Thanks for all the 
input :-).


(Oh, and I also noticed that I was dividing by 0x0, which is off 
course '0' and dividing by 0 gives 'Infinity').


Cheers!

Claus Wahlers wrote:

Number.toString() is a little borked.

Meister Skinner explains it here:
http://www.gskinner.com/blog/archives/2005/12/source_code_tra.html

Cheers,
Claus.


Jeroen Beckers wrote:


var n:Number = -16777216
trace(n.toString(16));

Gives me:

-100 ?



Claus Wahlers wrote:



pixel = -16777216


-16777216 is 0xff00 (solid black)

Try to trace pixel.toString(16)

Cheers,
Claus.

___
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] BitmapData.getPixel() - negative value ?

2006-09-14 Thread Jeroen Beckers

Hi list!

I was trying to create a little class that generates a 2d grid from a 
perlinNoise-bitmap image. Now, when I perform the getPixel32(), it 
returns a negative value. I did some research and it appears you can get 
'-1' when the indexes are out of bounds, but that's as negative as it 
goes... And I am getting results as:


pixel = -16777216

pixel = -16119286

pixel = -15724528

pixel = -15658735

Here is my (relevant) code:

   private function createBitmap():Void
   {
   bmd = new BitmapData(this.width, this.height);
   bmd.perlinNoise(this.width, this.height, 6, 1, false, false, 1, 
true);

   _root.holder.attachBitmap(bmd, 1);
  
   createGrid();

   }
  
   private function createGrid():Void

   {
   grid = new Array();
   for(var y:Number = 0; ythis.height; y++)
   {
   grid[y] = new Array();
   for(var x:Number = 0; xthis.width; x++)
   {
   //create a new point
   var myPoint:Point3D = grid[y][x] = new Point3D();
  
   //x and z depend on position (orientate around center 
(0,0,0))

   var xp:Number = x;
   var zp:Number = y;
  
   //y depends on the the greyscale value in percentage, 
going from 'min' to 'max'

   var pixel:Number = bmd.getPixel32(x, y);
   trace(pixel = +pixel);
   trace();
   var percentage:Number = pixel / 0x00;
   var yp:Number = percentage * (max - min) + min;
  
   myPoint.setPosition(xp, yp, zp);
  
   }

   }
   }


The trace(pixel=...); traces a negative value, which I find very 
strange... Any suggestions ?



Greets,

Jeroen Beckers
[EMAIL PROTECTED]
http://www.dauntless.be
___
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] [MTASC] Crashes on Point.add method ?

2006-09-12 Thread Jeroen Beckers

Hi List!

I use FlashDevelop to write my classes, and I use MTASC as bug-checker 
in FlashDevelop. I am working on a little 3d experiment and 
(apparently), I use the flash.geom.Point class. (I guess the BitmapData 
class uses the Point class, 'cause I'm not using it in my class...). 
Now, the problem is, I get an error:


C:\Program Files\Macromedia\Flash 8\en\First 
Run\Classes\FP8/flash/geom/Point.as:

Line 21: characters 17-20 : parse error:  Unexpected add

The 'add' refers to the Point.add method and I guess MTASC is having 
some trouble with the (old, not-supported) add-logical operator that's 
not supported anymore in FP8 or something... (I hope this sentence makes 
sense to you guys).


The question is: Why am I getting this error?

Greets,
Jeroen Beckers
http://www.dauntless.be
___
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] [MTASC] Crashes on Point.add method ?

2006-09-12 Thread Jeroen Beckers

Thanks, Scott! That did it :-).

slangeberg wrote:
It is really weird how developers either find or fix problems/ issues 
at the
same time as others... This should be a topic for research. -- I was 
just

dealing with this today, and after some poking around discovered that the
compiler is set to build to FP7 by default (even if you're not using 
MTASC).


Project - Properties - Movie tab - Target version - Flash player 8

Should do it!

Scott


On 9/12/06, Jeroen Beckers [EMAIL PROTECTED] wrote:


Hi List!

I use FlashDevelop to write my classes, and I use MTASC as bug-checker
in FlashDevelop. I am working on a little 3d experiment and
(apparently), I use the flash.geom.Point class. (I guess the BitmapData
class uses the Point class, 'cause I'm not using it in my class...).
Now, the problem is, I get an error:

C:\Program Files\Macromedia\Flash 8\en\First
Run\Classes\FP8/flash/geom/Point.as:
Line 21: characters 17-20 : parse error:  Unexpected add

The 'add' refers to the Point.add method and I guess MTASC is having
some trouble with the (old, not-supported) add-logical operator that's
not supported anymore in FP8 or something... (I hope this sentence makes
sense to you guys).

The question is: Why am I getting this error?

Greets,
Jeroen Beckers
http://www.dauntless.be
___
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] Help needed on Loader Component

2006-09-04 Thread Jeroen Beckers
You should use the MovieClipLoader class. You could set an interval to 
about 50ms, which should be enough time for the MCL class to throw the 
onLoadError event. In the onLoadError event, you delete the interval 
which will stop the loading.




Muhammad Sheraz Iqbal wrote:

Hi all,

I am trying to make a photo gallary. I want to load images dynamically and
would like it to stop loading when there are no more files to load. For this
I am using a while loop so that it loads the files till the End of Files.
But the problem is that I don't know what the while loop breaking condition
should be. As I have searched a lot but I cannot find a way to catch the
error if there is no file to load. Can somebody please help me how to break
the while loop if it cannot find the next file. 


I have tried the try...catch...finally block and have tried the
addEventlistener() property too but still cannot find a way to catch the
error. 


Following is the code I am using:

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

//Global variables
var i = 1;
_global.xvalue = 20;
_global.loadingCheck = 1;

var loaderListener:Object = new Object();
loaderListener.complete = function (evt_obj:Object) {
_global.loadingCheck = 0;
trace(Error handled);
};

//Implementation Starts from here
while (Don't know the condition to put here) {
this.createEmptyMovieClip(thumbnail_movie+i, i);
with (this[thumbnail_movie+i]) {
_xscale = 100;
_yscale = 100;
}
this[thumbnail_movie+i].createClassObject(mx.controls.Loader,
thumbnail+i, i);
with (this[thumbnail_movie+i][thumbnail+i]) {
autoLoad = false;
contentPath = i+.jpg;
addEventListener(complete, loaderListener);
load();
}
i++;
trace(_global.loadingCheck);
}


Muhammad Sheraz Iqbal
Associate, IT Programs

 ...OLE_Obj...  Hagler Bailly Pakistan
1E, Ali Plaza, Jinnah Avenue, Blue Area 
Islamabad 44000 Pakistan	


Universal Access: (+92 51) 111 HBP TEL, (+92 51) 111 HBP FAX, Cell: (+92
333) 552 1242
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  


Important Notice: This message, and any attachments to it, is intended
solely for the addressee(s) indicated, and is confidential.  If you have
received this message in error, please delete it and notify the sender
immediately. Any use not in accordance with its purpose, any dissemination
or disclosure, either whole or partial, is prohibited except with receipt of
formal approval.  The Internet cannot guarantee the integrity of this
message, hence Hagler Bailly Pakistan will not be liable for the
consequences of any person acting, or refraining from acting, on information
contained in any associated attachments prior to the receipt of subsequent
written confirmation.

___
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] Creating a scrollable list: adding components to the scrollpane contents

2006-09-02 Thread Jeroen Beckers
Couldn't you put the list component in a movieclip and add attach the 
movieclip to the scrollPane (which is a lot easier).

Also, what is  your 'createUniqueInstanceName()' function ?

Matt Bennett wrote:

Hello Flashcoders,

I'm building a scrollable list, and I keep track of the list items
with a Collection. I'm having trouble adding items to it - I think I'm
overwriting some instance variables somewhere.

In the code below, listContainer is a reference to the contents of a
ScrollPane component:

var listContainer = scrollPane.content;

Here's my function to add a list item:

  function addListItem(symbolName, props)
  {
  // Create the content (instance name: _itemX)
  var instanceName = this.createUniqueInstanceName();
  var item = listContainer.createClassObject(symbolName,
instanceName,
this.getNextHighestDepth(), props);

  //add to list items
  listItems.addItem(item);

  trace();
  trace(debugging addItem);
  var iterator = listItems.getIterator();
  while(iterator.hasNext()) {
  var thisitem = iterator.next();
  trace(this item: +thisitem+; type:
+thisitem.className);
  }
  trace();

  return item;
  }


After adding 3 items, the debug trace looks like this:


debugging addItem
this item: ; type: undefined
this item: ; type: undefined
this item: _level0.QUESTION
PAD.contentWidget.questionList.scrollPane.spContentHolder._item2;
type: View


I assumed that I was overwriting an instance name somewhere, but I
also traced the contents of listContainer with a for-in loop. This is
the output after the first item is added:


this item: 2441; type: undefined; text: undefined
...other irrelevant stuff
this item: true; type: undefined; text: undefined
this item: _level0.QUESTION
PAD.contentWidget.questionList.scrollPane.spContentHolder._item0;
type: View; text: question 1


And this the output after the second item is added:


this item: 2441; type: undefined; text: undefined
...other irrelevant stuff
this item: true; type: undefined; text: undefined
this item: _level0.QUESTION
PAD.contentWidget.questionList.scrollPane.spContentHolder._item1;
type: View; text: question 2


So it looks to me like I'm actually overwriting each _itemX instance
on listContainer - and hence the references in the Collection become
null pointers.

Does anyone have any experience with this?

Many 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

___
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] OOP methodology and flash. I'm loosing my faith...

2006-08-30 Thread Jeroen Beckers

You can't 'choose' the definition of polymorphism :p.

In simple terms, *polymorphism* lets you treat derived class members 
just like their parent class's members.
Source: 
http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming 
(+ all my java  AS books)


class Foo extends Bar
{

}

var myFoo:Bar = new Foo(); //this is polymorphism !

Giles Taylor wrote:
http://en.wikipedia.org/wiki/Polymorphism_(computer_science) 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Meinte
van't Kruis
Sent: 25 August 2006 14:14
To: Flashcoders mailing list
Subject: Re: [Flashcoders] OOP methodology and flash. I'm loosing my
faith...

well, I get Interfaces, but thanks for explaining :).

I just don't think actionscript, or java, has any polymorphism, since
the definition of that is, in my opinion, a class having more than one
parent class (ie, can extend 2 or more classes), which isn't the case.
So I don't understand why people who are explaining oop in actionscript
talk about polymorphism, because it just isn't there :), but perhaps I'm
wrong.

cheers,
-Meinte
___
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] File upload : getting Flash to know the new name

2006-08-25 Thread Jeroen Beckers
Hi Serge,

Maybe store the new name into the $_SESSION and request it when the
onComplete event is dispatched?
Or am I mis-understanding the situation?

Greets,
Jeroen

Serge Jespers wrote:
 Hey guys,

 I'm doing a fileUpload in this project and in my PHP script, I rename
 the file (make an MD5 from it).
 I was just wondering how I can get Flash to understand this new
 filename... Is this possible at all?

 Thanks for your fast responses ;-)

 Serge
 ___
 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] [AMFPHP] return; - feature / bug ?

2006-08-16 Thread Jeroen Beckers
Hi,

This is the situation:

Flash uses AMFPHP to call a php function 'test1()' .

In my php file, the function is defined as followed:

function test1()
{
test2();
return Hello;
}

function test2()
{
return World;
}

Now, AMFPHP returns World (when I call test1() ), but I would expect
him to return Hello (like flash would do).

Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?)

Greets,
Jeroen

___
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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
Hi,

This is the situation:

Flash uses AMFPHP to call a php function 'test1()' .

In my php file, the function is defined as followed:

function test1()
{
test2();
return Hello;
}

function test2()
{
return World;
}

Now, AMFPHP returns World (when I call test1() ), but I would expect
him to return Hello (like flash would do).

Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?)

Greets,
Jeroen

___
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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
Hi Fokert :D

That gives back World too... I really don't understand it :S

Greets,
Jeroen

Ps: I'm Dauntless

Folkert Hielema wrote:
 how about:

 function test1()
 {
 return Hello .test2();
 }
 in you setting the returned world makes no sence since it's not
 printed or put in a variable or anything (amasing that is does not
 give an error that way.

 hth,

 Folkert
 Jeroen Beckers wrote:
 Hi,

 This is the situation:

 Flash uses AMFPHP to call a php function 'test1()' .

 In my php file, the function is defined as followed:

 function test1()
 {
 test2();
 return Hello;
 }

 function test2()
 {
 return World;
 }

 Now, AMFPHP returns World (when I call test1() ), but I would expect
 him to return Hello (like flash would do).

 Is this a feature or a bug? (Or maybe just a hole in my PHP knowledge ?)

 Greets,
 Jeroen

 ___
 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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
Sorry, forgot that while copying...

But it doesn't work either...

Mike Britton wrote:
 $this-test2();

 hth,

 Mike
 ___
 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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
Yes, that works... So why won't my class work?

//class
?php

class Quadri
{

/*
* Constructor
*/
function Quadri()
{
include(Quadri.methodTable.php);
}
   
/**
* This function adds the score  name to the database
* @access remote
*/
   
   
function insertIntoDatabase($p_score, $p_name)
{
return test5;
}
   
   
/*
* This function checks and decrypts the given code from flash
* @access remote
*/
function addScore($p_score, $p_name)
{   
$test = $this-insertIntoDatabase(test, test);
   
return HelloWorld!;

   
   
}
   
   
}

?

//method table
?php
$this-methodTable = array(
insertIntoDatabase = array(
description = This function adds the score  name to the
database,
arguments = array(p_score, p_name),
access = remote
),
addScore = array(
description = /\n This function checks and decrypts the
given code from flash,
arguments = array(p_score, p_name),
access = remote
)
);
?





Mike Britton wrote:
 ?php

 class testClass
 {
 function testClass() {
 $this-methodTable = array(
 test1 = array(
 description=I return 'hello world',
 access=remote,
 arguments=array(),
 returntype=string),

 test2 = array(
 description=I return 'hello',
 access=remote,
 arguments=array(),
 returntype=string)
 );
 }

 function test1() {
 return $this-test2(). world;
 }

 function test2() {
 return hello;
 }
 }

 ?

 html
 headtitle/title/head
 body
 ?php

 include('testClass.php');

 $myTest = new testClass();
 $message  = $myTest-test1();
 echo $message;



 ?
 /body
 /html




 Mike
 ___
 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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
I did that :).

Mike Britton wrote:
 You need to create a methodTable array in the constructor of every
 class you're using with AMFPHP.
 ___
 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] [AMFPHP] return; - Feature / bug ?

2006-08-16 Thread Jeroen Beckers
It's really handy if you include it. In the service browser, you can
select [mt] and 'save to XXX.methodtable.php' . Every time you edit your
class, you just press the save to method table button and it's
automaticly updated.

And uhm... The problem is solved... I kept calling the wrong function
:#. I'm really embarrassed of this... I was a little confused as to how
the service browser works... (I'm new to AMFPHP). Thanks for everyones
time! :)

Mike Britton wrote:
 I always put my methodTable in the constructor, not include it.  This
 could be the source of the problem.
 ___
 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] delegate and proxy

2006-08-14 Thread Jeroen Beckers
That should be correct Julien, but there's no point in importing, if you
are going to use the fully qualified classname anyway...

julien castelain wrote:
 hi ilteris,

 maybe this could do it :

 import ascb.util.Proxy;

 function finishAnimation(_mc:MovieClip) {
  var scope = this;
 var tween4 = new Tween(image, _alpha, Regular.easeOut,
100, 0, 3, true);
  tween4.onMotionFinished = ascb.util.Proxy.create(scope,
 endOfMotion, _mc);
 }

 function endOfMotion(_mc:MovieClip) {
 trace(_mc);
 }

 not sure though ...
 cheers

 On 8/14/06, ilteris kaplan [EMAIL PROTECTED] wrote:
 Hello List,
 I am trying to pass a parameter to my function with the help of
 delegate or proxy but I couldn't succeed in both :(

 I have read http://www.person13.com/articles/proxy/Proxy.htm but
 still couldn't quite figure out how I should do it. Honestly I begin
 to feel like dumb four in the morning.

 please let me know what I am missing here!!

 best,
 ilteris.


 import ascb.util.Proxy;

 function finishAnimation(_mc:MovieClip) { // mc is my movieclip I am
 passing inside of this function
// I am trying to pass _mc as a parameter to endOfMotion() method
var tween4 = new Tween(image, _alpha,
 mx.transitions.easing.Regular.easeOut, 100, 0, 3, true);
tween4.onMotionFinished = ascb.util.Proxy.create(this,
 endOfMotion,
 _mc);
 }

 function endOfMotion(_mc:MovieClip) {
// this.obj.canv.closeCanvas();
trace(_mc); // when I trace it, it still gives me [Tween]

 }


 ___
 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] |:::| can you write dynamic meathods in a class?

2006-08-13 Thread Jeroen Beckers
Give us the code of the dispatching of the event ...

dnk wrote:
 Ramon Miguel M. Tayag wrote:
 http://board.flashkit.com/board/showthread.php?t=662329highlight=delegate


 How do you call this class?

 I tried


 import com.includingatree.utils.Delegate;
 //use the delegate
 this.menuBtn.addEventListener(click, Delegate.create(this, onHit1, 1));
 //create the btn event to handle the click
 function onHit1(n:Number)
 {
trace(it was hit with the number:  + n);
 }


 But I get returned:

 it was hit with the number: [object Object]


 What would I be doing wrong?


 ___
 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] Problems with setInterval

2006-08-12 Thread Jeroen Beckers
I also created one which has a little more features:
http://dauntless.be/blog/?p=11

Jim Kremens wrote:
 http://www.kennybunch.com/index.php?p=16

 Jim Kremens


 On 8/12/06, Paul Steven [EMAIL PROTECTED] wrote:

 I am trying to scope my setInterval timeout handler however it is not
 calling the associated handler when I add the scoping in to it.

 Here is the code I have so far:

 _global.gIdle_Timeout = 1 // 10 seconds



 _global.Idle_Function = function(passed_Destination) {

trace (Idle function called);

Clear_Timeout_Interval();

gotoAndPlay(Idle_Timeout_Destination);

 }



 _global.Clear_Timeout_Interval = function() {

trace (Clear timeout interval);

clearInterval(_global.gIdle_Interval);

 }



 _global.Start_Idle_Timeout = function(passed_Destination) {

trace (start idle);

Idle_Timeout_Destination = passed_Destination;

// _global.gIdle_Interval = setInterval(this,
 _global.Idle_Function, _global.gIdle_Timeout);

_global.gIdle_Interval = setInterval(_global.Idle_Function,
 _global.gIdle_Timeout);

 }

 I have commented out the line of code with the scoping in it.

 i.e


 _global.gIdle_Interval = setInterval(this, _global.Idle_Function,
 _global.gIdle_Timeout);

 Without the scoping, it does not always appear to clear the interval.

 Here is a screenshot of my timeline with the actions window illustrating
 my
 call to this function

 http://www.mediakitchen.co.uk/interval.jpg

 Any assistance much appreciated.

 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




___
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] Problems with setInterval

2006-08-12 Thread Jeroen Beckers
I also created one which has a little more features:
http://dauntless.be/blog/?p=11

Jim Kremens wrote:
 http://www.kennybunch.com/index.php?p=16

 Jim Kremens


 On 8/12/06, Paul Steven [EMAIL PROTECTED] wrote:

 I am trying to scope my setInterval timeout handler however it is not
 calling the associated handler when I add the scoping in to it.

 Here is the code I have so far:

 _global.gIdle_Timeout = 1 // 10 seconds



 _global.Idle_Function = function(passed_Destination) {

trace (Idle function called);

Clear_Timeout_Interval();

gotoAndPlay(Idle_Timeout_Destination);

 }



 _global.Clear_Timeout_Interval = function() {

trace (Clear timeout interval);

clearInterval(_global.gIdle_Interval);

 }



 _global.Start_Idle_Timeout = function(passed_Destination) {

trace (start idle);

Idle_Timeout_Destination = passed_Destination;

// _global.gIdle_Interval = setInterval(this,
 _global.Idle_Function, _global.gIdle_Timeout);

_global.gIdle_Interval = setInterval(_global.Idle_Function,
 _global.gIdle_Timeout);

 }

 I have commented out the line of code with the scoping in it.

 i.e


 _global.gIdle_Interval = setInterval(this, _global.Idle_Function,
 _global.gIdle_Timeout);

 Without the scoping, it does not always appear to clear the interval.

 Here is a screenshot of my timeline with the actions window illustrating
 my
 call to this function

 http://www.mediakitchen.co.uk/interval.jpg

 Any assistance much appreciated.

 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




___
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 Extension Package

2006-08-11 Thread Jeroen Beckers
It still can't find your zip file

Ravi Marella wrote:
 Sorry guys the last URL..i donno wat the problem is..yahoo has closed my
 site...please check this link...
 In that on the top frame, therez a link called RotatingMenu...its the
 zip file...
 http://www.geocities.com/flywithoutwings_4350/

 As u can see in the bottom frame I've used the same component which is
 working perfectly...please gimme some advice over this..


 best regards
 RaviKiran Marella



  

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jeroen
 Beckers
 Sent: Friday, August 11, 2006 3:44 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Flash Extension Package

 The .zip isn't working...

 Ravi Marella wrote:
   
 Hi list,
 I've got a problem while packaging a component I've developed..it's a
 rotating menu component which will display any number of menu item
 around a circle, the fla is working properly but when I package it to
 .mxp the menu is not rotating and also the component parameters are
 
 not
   
 getting displayed properly...can someone out there plz helpme with
 this...please check the link for zip folder containing all the
 
 files
   
  
  
 http://www.geocities.com/ravi_marella/rotatingmenu.zip
  
 best regards,
 Ravi
  

   
  
 ___
 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] |:::| can you write dynamic meathods in a class?

2006-08-11 Thread Jeroen Beckers
Just to be complete: Yes, it is possible!

Example:

var myFoo = new Foo();
myFoo[test+5] = function()
{
trace(hello world!);   
}
myFoo.test5();


//Foo.as
dynamic class Foo
{
   
   
}

And to your second question:

Delegate returns a function. Setting the onRelease to
'Delegate.create()' is nothing more than setting the onRelease to an
ordinary function like this:
btn.onRelease = function()
{
trace(Hello World);
}

the only thing Delegate do, is modifie the scope of the function.
So, yes, you CAN overwrite 'delegate instances'.

Ps: Delegate instances isn't even the right term since you don't
create an instance of the Delegate class. The 'create' method is a
static method that just takes some arguments and returns a function.

Got it ? :)



Bbt Lists wrote:
 Hi there

 Can you write dynamic methods in a class?


 for example

 for (var i:Number = 0; i  11; i++)
 {
function onBtnPress + i()
{
   trace(Button number:  + i + was pressed);
}
 }

 So then that would essentially create 10 methods (onBtnPress0 to
 onBtnPress9) to be used by various onPress events.

 Is this possible? Then at the same time you could write the delegate
 and create the buttons and so one as well.

 Then continuing on my thought - could you then over-write the
 onBtnPress functions with new values (say for example the trace would be:

 trace(Button number:  + i + was pressed with the currValue of  +
 externalVariable);

 instead of the original:

 trace(Button number:  + i + was pressed);


 I am a hobby AS coder, and I am probably way off here. All I am trying
 to do is build a thumbnail nav for a gallery.

 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] Reporting load success from a delegate

2006-08-10 Thread Jeroen Beckers
You can use the EventDispatcher.

import mx.utils.Delegate;
//import the EventDispatcher class
import mx.events.EventDispatcher;
class myClass
{

private var myxml:XML;
   
//declare the functions
private var dispatchEvent:Function;
public var addEventListener:Function;
public var removeEventListener:Function;

public function myClass()
{
//initialize EventDispatcher
EventDispatcher.initialize(this);
this.myxml = new XML();
this.myxml.ignoreWhite = true;
this.myxml.onLoad = Delegate.create(this,DoSomething);
this.myxml.load(test.xml);
}

private function doSomething(success:Boolean)
{
trace(success= +success);
   
//create the object to be dispatched
var myObject:Object = new Object();
//add the type
myObject.type = onXMLLoad;
   
/*
* This property isn't mandatory, but it is recommended
* to add it to the object. It tells the user what class
* dispatched the event.
*/
myObject.success = success;
myObject.target = this;
dispatchEvent(myObject);
}
}

And in your .fla:

var foo:myClass = new myClass();
foo.addEventListener(onXMLLoad, this);
function onXMLLoad(eObj:Object):Void
{
trace(Success? +eObj.success);
}

Ps: It's a good practice to start your classes with a capital letter
(MyClass in stead of myClass).

Darren Bowers wrote:
 Wat is the easiest way to report back success or failure at the time the
 class (myClass) is instantiated?
 Since doSomething() has taken control of the load handling, I cant pass a
 value back via the constructor function of load success. Any help would be
 appreciated.
  
 import mx.utils.Delegate;

 class myClass
 {

 private var myxml:XML;

 public function myClass()
 {
 this.myxml = new XML();
 this.myxml.ignoreWhite = true;
 this.myxml.onLoad = Delegate.create(this,DoSomething);
 this.myxml.load(test.xml);
 }

 private function doSomething(success:Boolean)
 {
 trace(success= +success);
 //do something
 }

 }
   
 

 
 CAUTION  DISCLAIMER: The information contained in this e-mail message
 and/or any accompanying data or documents contain information that is 
 confidential and subject to legal privilege. The information is intended
 only for the recipient named in this message. The sender is excluded from
 any liability arising from any further use, dissemination, distribution,
 transmission or copying of this information and /or accompanying data by
 the recipient. If you are not the intended recipient, you must immediately
 erase the information along with all copies of this message and accompanying
 data and notify the sender. Views expressed in this message are those of the
 original sender, and are not necessarily the views of WestOne Services.
 

   
 

 ___
 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] Reporting load success from a delegate

2006-08-10 Thread Jeroen Beckers
Oh, sorry, i switched 2 lines, the explanation is about the .target
property, not the .success property.



Jeroen Beckers wrote:
 You can use the EventDispatcher.

 import mx.utils.Delegate;
 //import the EventDispatcher class
 import mx.events.EventDispatcher;
 class myClass
 {

 private var myxml:XML;

 //declare the functions
 private var dispatchEvent:Function;
 public var addEventListener:Function;
 public var removeEventListener:Function;

 public function myClass()
 {
 //initialize EventDispatcher
 EventDispatcher.initialize(this);
 this.myxml = new XML();
 this.myxml.ignoreWhite = true;
 this.myxml.onLoad = Delegate.create(this,DoSomething);
 this.myxml.load(test.xml);
 }

 private function doSomething(success:Boolean)
 {
 trace(success= +success);

 //create the object to be dispatched
 var myObject:Object = new Object();
 //add the type
 myObject.type = onXMLLoad;

 /*
 * This property isn't mandatory, but it is recommended
 * to add it to the object. It tells the user what class
 * dispatched the event.
 */
 myObject.success = success;
 myObject.target = this;
 dispatchEvent(myObject);
 }
 }

 And in your .fla:

 var foo:myClass = new myClass();
 foo.addEventListener(onXMLLoad, this);
 function onXMLLoad(eObj:Object):Void
 {
 trace(Success? +eObj.success);
 }

 Ps: It's a good practice to start your classes with a capital letter
 (MyClass in stead of myClass).

 Darren Bowers wrote:
   
 Wat is the easiest way to report back success or failure at the time the
 class (myClass) is instantiated?
 Since doSomething() has taken control of the load handling, I cant pass a
 value back via the constructor function of load success. Any help would be
 appreciated.
  
 import mx.utils.Delegate;

 class myClass
 {

 private var myxml:XML;

 public function myClass()
 {
 this.myxml = new XML();
 this.myxml.ignoreWhite = true;
 this.myxml.onLoad = Delegate.create(this,DoSomething);
 this.myxml.load(test.xml);
 }

 private function doSomething(success:Boolean)
 {
 trace(success= +success);
 //do something
 }

 }
   
 

 
 CAUTION  DISCLAIMER: The information contained in this e-mail message
 and/or any accompanying data or documents contain information that is 
 confidential and subject to legal privilege. The information is intended
 only for the recipient named in this message. The sender is excluded from
 any liability arising from any further use, dissemination, distribution,
 transmission or copying of this information and /or accompanying data by
 the recipient. If you are not the intended recipient, you must immediately
 erase the information along with all copies of this message and accompanying
 data and notify the sender. Views expressed in this message are those of the
 original sender, and are not necessarily the views of WestOne Services.
 

   
 

 ___
 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] Flash Extension Package

2006-08-10 Thread Jeroen Beckers
The .zip isn't working...

Ravi Marella wrote:
 Hi list,
 I've got a problem while packaging a component I've developed..it's a
 rotating menu component which will display any number of menu item
 around a circle, the fla is working properly but when I package it to
 .mxp the menu is not rotating and also the component parameters are not
 getting displayed properly...can someone out there plz helpme with
 this...please check the link for zip folder containing all the files
  
  
 http://www.geocities.com/ravi_marella/rotatingmenu.zip
  
 best regards,
 Ravi
  

   
  
 ___
 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