[Flashcoders] [AS2/JS] problem with cross domain JS,

2008-01-10 Thread sebastian chedal
Hello everyone, searched archives and went through the flash help IDE but I
am still a bit stuck with a cross domain issue.

2 flash files and 1 html page, the HTML page is on a different server/domain
than the SWFs.

both flash files need to have access to JS on the page [calls and return].

It works fine when I have all 3 files on the same server [for testing, but
this is not the final location in production...]

I have tried [in param and embed of object:]
allowScriptAccess = "always"

And I also tried making a crossdomain.xml file:



  
  


I placed the crossdomain.xml file in both servers where the files are hosted
(/test/) and then I pointed the flash files [first frame of code] to the
cross domain file:

System.security.loadPolicyFile("
development.servernameA.com/test/crossdomain.xml");

Maybe I am missing something very simple...? But at the moment I am stuck
and not all too sure what else I need to change to allow these two swf files
to send/receive javascript to the hosting HTML page...

any advice is much appreciated! Thanks!

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


Re: [Flashcoders] IE6: javascript issues w. events calling:getURL/SWFAddress/Object

2007-06-01 Thread sebastian chedal

Wow! I actually solved the issue now! And it was because of an issue in the
parameters...
:p

Doh!

[there was a space in the title name:
__data.parameters.myTitle
which only made an issue for IE6]

PHEW!!! I'm really happy its functioning!
=D

again, thanks for ALL your help!

wk,

seb.

On 6/1/07, sebastian chedal <[EMAIL PROTECTED]> wrote:


Hello everyone, thanks for your fast responces,

When I use:

//AS:
ExternalInterface.call ("check");
//JS:
function check () {
alert("check");
}

This works fine on ALL browsers.

But if I use:
AS:
ExternalInterface.call ("spawnWindow",
fullString,__data.parameters.myTitle,"'toolbar="+__data.parameters.toolbar+",location="+__data.parameters.location+",status="+__data.parameters.status+",menubar="+__data.parameters.menubar+",scrollbars="+__data.parameters.scrollbars+",resizable="+__data.parameters.resizeable+",width="+__data.parameters.width+",height="+__data.parameters.height+"'");

//JS:
function spawnWindow(URL,Name,features) {
alert("spawnWindow");
window.open(URL,Name,features);

}

This works fine in FFox, Safari, IE7 etc. but in IE6 ONLY the alert is
triggered.

So I tried to use inline JS:

//AS:
getURL 
("javascript:NewWindow=window.open('"+String(fullString)+"','"+__data.parameters.myTitle+"','toolbar="+String(__data.parameters.toolbar)+",location="+String(__data.parameters.location)+",status="+String(__data.parameters.status)+",menubar="+String(__data.parameters.menubar)+",scrollbars="+String(__data.parameters.scrollbars)+",resizable="+String(__data.parameters.resizeable)+",width="+String(__data.parameters.width)+",height="+String(__data.parameters.height)+"');
NewWindow.focus(); void(0);");

This again works fine in all browsers except IE6...
=(

So it would seem that I can access alert; but not window.open; using
either javascript inline, or via a function...

As prviously mentioned, I also need to use Javascript to call the stats
engine [currently Google Analytics; but we will switch to Omniture soon and
this also uses javascript] - but this is also not working in IE6.

I'm again out of options!!! So far it seems like a bad deal to have
deeplinking/bookmarking but no IE6 support!
=-(

So if anyone has any further insight, your insight is greatly appreciated!

For the record, I'm using SWFAddress 1.1 / SWFObject

With kindness,

Sebastian.


___
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] IE6: javascript issues w. events calling:getURL/SWFAddress/Object

2007-06-01 Thread sebastian chedal

Hello everyone, thanks for your fast responces,

When I use:

//AS:
ExternalInterface.call ("check");
//JS:
function check () {
   alert("check");
   }

This works fine on ALL browsers.

But if I use:
AS:
ExternalInterface.call ("spawnWindow",
fullString,__data.parameters.myTitle,"'toolbar="+__data.parameters.toolbar+",location="+__data.parameters.location+",status="+__data.parameters.status+",menubar="+__data.parameters.menubar+",scrollbars="+__data.parameters.scrollbars+",resizable="+__data.parameters.resizeable+",width="+__data.parameters.width+",height="+__data.parameters.height+"'");
//JS:
function spawnWindow(URL,Name,features) {
   alert("spawnWindow");
   window.open(URL,Name,features);

   }

This works fine in FFox, Safari, IE7 etc. but in IE6 ONLY the alert is
triggered.

So I tried to use inline JS:

//AS:
getURL 
("javascript:NewWindow=window.open('"+String(fullString)+"','"+__data.parameters.myTitle+"','toolbar="+String(__data.parameters.toolbar)+",location="+String(__data.parameters.location)+",status="+String(__data.parameters.status)+",menubar="+String(__data.parameters.menubar)+",scrollbars="+String(__data.parameters.scrollbars)+",resizable="+String(__data.parameters.resizeable)+",width="+String(__data.parameters.width)+",height="+String(__data.parameters.height)+"');
NewWindow.focus(); void(0);");

This again works fine in all browsers except IE6...
=(

So it would seem that I can access alert; but not window.open; using either
javascript inline, or via a function...

As prviously mentioned, I also need to use Javascript to call the stats
engine [currently Google Analytics; but we will switch to Omniture soon and
this also uses javascript] - but this is also not working in IE6.

I'm again out of options!!! So far it seems like a bad deal to have
deeplinking/bookmarking but no IE6 support!
=-(

So if anyone has any further insight, your insight is greatly appreciated!
For the record, I'm using SWFAddress 1.1 / SWFObject

With kindness,

Sebastian.
___
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] IE6: javascript issues w. events calling: getURL/SWFAddress/Object

2007-05-31 Thread sebastian chedal

Hello,

I'm having problems with IE6 and getURL calling javascript code:

getURL
("javascript:void(urchinTracker('"+__newURL.parameters.myURL+"'));");//google
analytics

makes IE6 open a new window and puts the words:

javascript:void(urchinTracker('path/file'));

in the url bar!

a pop up throws errors too [run time errors] when i use:

window.open (...);

I've tried adding void to the js command. My getURL's are always called from
event handlers, not buttons [as I need to catch user activity].

I'm using SWFObject/Address and there I added:

var so = new SWFObject('/core_holder.swf', 'website', '100%',
'100%', '8', '#00');
(...)
so.addParam('allowScriptAccess', 'true');

To the code; but the error persists!

Has anyone seen this problem before???

I'm building in flash 8, it works fine on safari, firefox and ie7+

problem is urgent!
thanks!!!

sebastian.
___
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] AS2: local events [fuse] to boradcast between classes?

2007-05-08 Thread sebastian chedal

Hey yawl,

I have a question, I'm using FUSE to do tweens and I need an event to be
sent when it is done.

I'm using the following syntax:

import mx.utils.Delegate;
import com.mosesSupposes.fuse.*;

class com.blabla.PostView extends MovieClip  {
private var myID:Number;
private var mainPanel:String;

//ommited code more properties...

 public function PostView () {
   ZigoEngine.register(FuseItem, PennerEasing);
 }

//ommited code: this function is inside an 'init' panel funciton called at
runtime =>
 this.signPost.expandBT.onRelease = function() {
   var f:Fuse = new Fuse();
   f.label = "swoopyIntro";
   f.target = this._parent.zoomBox;
   f.push({x:"0", y:"0", start_scale:140, start_tint: 0xff,
start_alpha:100, scale:100,ease:"easeInOutCubic", seconds:0.01, tint:
0x2E2E2E, alpha:0});
   f.addEventListener('onComplete', this._parent._parent);
   f.start(true);
 }

 private function handleEvent(o:Object):Void {
   if (o.type=='onComplete') {
   trace ("panel action done");
   //myBroadcaster is another AS2 file dealing with dispatching
events to subscribers:
   myBroadcaster.dispatchEvent
("panelState",{myID:myID,mainPannel:mainPannel});
   }
 }
//ommited code, more stuff...

}

My {quick} questions are:

1. Am I doing this right? Do I have to send a local event [
f.addEventListener('onComplete', this._parent._parent);] before I can
broadcast an event between [all] classes? Ideally I'd like other AS2 classes
to hear the "f.addEventListener('onComplete', this._parent._parent);"
directly... [without hardcoding pointers to a specific class file]

2. Is there anyway to pass the 'handleEvent' function a parameter so that I
can broadcast it? Namely I want to broadcast not only that it was done, but
which function was the originator [in this case: "expandBT.onRelease" or a
string like "ExpandAnimationDone"] - can I get around that?

Thanks for your time,

Sebastian.
___
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] Re: AS2: Design Pattern: event based or pointer? from model or controller?

2007-05-04 Thread sebastian chedal

Alo,

So I've done some more independant research,

I think I'm going to use an EventDispatcher system from the PageController:

http://www.adobe.com/devnet/flash/articles/creating_events.html

Instead of pointers. As I think this makes more sense.
Ofcourse, any insight from the 'pros' still welcome!

With kind,

Seb.

On 5/3/07, sebastian <[EMAIL PROTECTED]> wrote:


Hello folks,

My next question is conceptual...

I've made good progress on many of the classes in my application, but
I'm now caught in a dilemma regarding approach.

As mentioned in a previous mail, I'm building a system that can be
divided into two: 1 part does general world 3D animation until the pages
are opened; this was relatively easy to make... the second part of the
system deals with generating pages [its a templating MVC system]; this
is the tough part!

At the center of the application is my class: PageController

Linked to it are 3 other Classes: PageModel [to load new pages],
StatsCollector [to record new pages called] and MouseController [told to
turn off 3D motion when pages are opened].

I was planning on using an object-instance pointer in the PageController
formed during its construction, to tell the associated Classes that a
new event has ocured, but someone pointed out to me that I should be
using an event based system instead [so that's its easier to add new
Classes that listen to the Controller in the future]

Here is what I have:

class com.blabla.PageController {
//Object pointers
private var pageModel:Object;
private var statsCollector:Object;
private var mouseController:Object;
private var urlMapper:Object;
//Page open/close status
private var activeWindow:Boolean;

function PageController (
__pageModel:Object,
__mouseController:Object,
__statsCollector:Object,
__urlMapper:Object)
{
//Pointers:
this.pageModel = __pageModel;
this.statsCollector = __statsCollector;
this.mouseController = __mouseController;
this.urlMapper = __urlMapper;
//Set initial state:
this.activeWindow = false;
}

//this method is called by SWFAddress on url changes:
public function urlChange(__name:String):Void {

// MOUSE CONTROLLER
//set the page active true to turn off
//3D mouse system:

this.activeWindow = true;

//tell 3D mouse system to check status:
this.mouseController.checkWindowStatus();

// PAGE MODEL
//call URL mapper returns an XML file based
//on the url __name
//this XML file is then passed to the pageModel
//which will then notify the PageView of changes

this.pageModel.buildPage (this.urlMapper.convertLink
(__name));

// STATS COLLECTOR
//run the method in 'statscol' with url:

this.statsCollector.callURL(__name);

}

}

So, my question is... is this the right way to be sending events? By
making pointers and calling methods in connected classes? Also, should I
store my "activeWindow" parameter in the Controller? I have a feeling
its in the wrong Class; but from a Code-clarity perspective it does make
sense to have it here as the controller is a state-dispatcher...?

Or should I be using an event based system instead of pointers? If so,
could someone lightly outline what the difference would be like in such
a set up? I'm not very familiar with using events to drive app like
this. I'd be very thankful.

Here is the latest diagram of the system:
http://www.chedal.org/temp/uml_design_03.png
[this that are blue/green are things I've built until now]

Note I chose to connect the MouseController and StatsCollector to the
PageController instead of the PageModel because if I did so the
PageModel would get very long in terms of code; I want the PageModel to
focus JUST on storing the Templates' data that the View will build [by
refering to the PageModel's loaded data]. Also, if I linked everything
to the PageModel instead, the functionality of the PageController as a
dispatcher would be made redundant... am I right in this thinking?

If you wish I can copy-paste the code of other Classes [assuming I've
written the code!], but I don't think this is necessary to answer my
question.

With kindness,

Sebastian.


___
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] stumped video behaviour in AS2/Classes

2007-05-04 Thread sebastian chedal

doh, I'm really sorry. Silly me, thanks!
[btw the constructor had all kinds of other [irrelevant] things in it, hence
why i left it out, sorry! will include next time]

On 5/3/07, Lists <[EMAIL PROTECTED]> wrote:


Sebastian,

You didn't include the timeline code, but I made some assumptions. I think
the most relevant issue is that your NetConnection and NetStream variables
are local and expire after the function is called. This works:

//in class PostView.as, in com/blabla/
class com.blabla.PostView extends MovieClip {

private var _netConn:NetConnection;
private var _netStream:NetStream;

  public function playVideo () {
_netConn = new NetConnection();
_netConn.connect(null);
_netStream = new NetStream(_netConn);
_netStream.onStatus = function (infoObject:Object) {
 trace (infoObject.code);
}

_root.vid.attachVideo(_netStream);
_netStream.play("video/video.flv");
  }

}

//in timeline
import com.blabla.PostView;

var myVar:PostView = new PostView();
myVar.playVideo();

//


I'm not a fan of classes without constructors, though. If you only
included
a snippet, disregard. If not, you can unify the class and function name
above and omit the last line in the timeline. Or, even throw in a generic
constructor for clarity/possible info.

Rich Shupe


___
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] stumped video behaviour in AS2/Classes

2007-05-03 Thread sebastian chedal

Hi folks, sorry to bother you with this, but I'm stumped.

I have a class file that needs to generate video on the fly.
I can get video to play fine when I pop the code onto the main timeline, but
when I put it into a seperate class file, nothing happens.
onStatus simply says "NetStream.Play.Start" but never "NetStream.Buffer.Full"
or stop... it just says playing and then nothing is visible...

this is how the class file looks:

[CODE]
class com.blabla.PostView extends MovieClip  {

 public function playVideo () {
   var netConn:NetConnection = new NetConnection();
   netConn.connect(null);
   var netStream:NetStream = new NetStream(netConn);
   netStream.onStatus = function (infoObject) {
trace (infoObject.code);
   }

   //test video:
   _root.vid.attachVideo(netStream);
   //test play:
   netStream.play("video/video.flv");
 }

}
[/CODE]

on the main timeline I have a video object set to 'video: AS controlled' in
the properties and named 'vid' on the _root.

If I dont use the class, and instead just write it in the main time line
like this:

[CODE]
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function (infoObject) {
trace (infoObject.code);
}

// debug commented: this.signPost.vid.attachVideo(netStream);
_root.vid.attachVideo(netStream);

netStream.play("video/video.flv");
[/CODE]

it works just fine!

What am I missing? Do I need to import something? Should I be extending a
different object [if so, I need this class to be a MovieClip... so does that
mean I'll have to create anotehr class just fro loading video?]?

Maybe I am just missing somethign really simple that will make me feel
stupid again...
:P

Thanks for your help!

Sebastian.
[p.s. I've tried to put all the related code here, i hope this is more
clear]
___
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] dynamic image loading in mc

2007-05-03 Thread sebastian chedal

Hi Gustavo,

You will need to either create a button at run time, or attach one from the
library.
Since each image will need to be with an assosiated button, you might as
well load them both into a container MovieClip and then assign that
container a variable with the link address to it so that the button can
reference it.


 model1.jpg
 wrote:


Hi I found this quite interesting do you mind to explain this in more
detail. Actually I'm looking to create a pictures menu and viewer
base on the xml file,
a loop to assign this
the xml.


 model1.jpg
 model2.jpg
 model3.jpg
 model1.jpg


and in the as2, well I'm not sure about how to do it. but I'll need a
loop to read each child in a mc and then add to them an onRelease
behaviour in order to have them as buttons,
would you help me Seb?




Regards


Gustavo Duenas


On May 1, 2007, at 2:43 AM, sebastian wrote:

> hi Michael,
>
> quick reply here, but you may want to consider assigning the XML
> data to an Array instead of to variables. This way, you can call
> positions in the array easily.
>
> So instead of:
>
> bild = mein_xml.firstChild.childNodes[paktBild].attributes.pic;
>
> you would have:
>
> pictureArray = new array
> for i loop with max = XML.children.length
> pictureArray[i] = mein_xml.firstChild.childNodes[i].attributes.pic;
> position = 0;//position tracker
>
> next/previous just calls 'position' of 'pictureArray[i]' array and
> loads up. also saves reloading XML EVERY time you call an image
> [less load on server/flash]
>
> cheers,
>
> seb.
>
> mastro wrote:
>> hello,
>> I'm looking for a solution witch can handle the following problem:
>> i need a mc witch will load several images and text dynamically
>> from a folder into the flash-file. (the number of images change
>> sometimes)
>> also 2 buttons should give the possibility to go from image 1 to
>> image however and back...
>> my xml file looks like this:
>> 
>> 
>> > Bild>
>> 
>> 
>> > Bild>
>> > Bild>
>> 
>> 
>> 
>> in flash on my mc the AS looks like:
>> --snip!
>> mein_xml = new XML();
>> mein_xml.ignoreWhite = true;
>> mein_xml.load("test.xml");
>> mein_xml.onLoad = function(status) {
>> if (status && this.loaded) {
>> anzahl = mein_xml.firstChild.childNodes.length;
>> geladen = true;
>> aktbild = 0;
>> ladeBild(aktBild);
>> }
>> };
>> function ladeBild(paktBild) {
>> status_mc._visible = 1;
>> bild = mein_xml.firstChild.childNodes[paktBild].attributes.pic;
>> bildname = mein_xml.firstChild.childNodes[paktBild].attributes.name;
>> loadMovie(bild, "bild_mc");
>> titel_txt.text = bildname;
>> }
>> weiter_btn.onRelease = function() {
>> if (geladen && aktbild> aktbild++;
>> ladeBild(aktBild);
>> }
>> };
>> zuruck_btn.onRelease = function() {
>> if (geladen && aktbild>0) {
>> aktbild--;
>> ladeBild(aktBild);
>> }
>> };
>> ---snip!
>> here is a link to a test file:
>> http://nano.machfeld.net/test/test.zip
>> someone an idea?
>> cheers,
>> michael
>> ___
>> 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
>

Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.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] AS2: generating new instances dynamically?

2007-05-02 Thread sebastian chedal

If it is a movie clip you want to instantiate then you have to use:
_root.attachMovie(libraryID, instanceName, depth);



The class associated with it will construct and the onLoad event will
trigger if it is being listened to.


this indeed works, but then i can't pass any values to the constructor.
Is there any way to attachMovie and at the same time pass values to it?

I supose I can always refer to it afterwards on the time line and call a
custom function... but it would be nice to use the constructor's
functionality.

I had hoped I could generate new instances just by calling a constructor
instead of attaching it to something; but i guess logically i it needs to be
attached to be "on the timeline". Correct me if I am wrong.

Thanks!

Seb.

On 5/1/07, O. Fouad <[EMAIL PROTECTED]> wrote:


are u executing the class post view?

On 5/1/07, Andy Herrman <[EMAIL PROTECTED]> wrote:
>
> Or have the function return it, which is what it seems like would be
> the right thing for that method.
>
>   -Andy
>
> On 5/1/07, Ron Wheeler <[EMAIL PROTECTED]> wrote:
> > I am not sure if you are showing all the code but in your code
fragment,
> > newPost is a local variable that will be destroyed as soon as
createPost
> > ends. A short and brutal life.
> >
> > It needs to be a class property and you will want to have a getter to
> > access it.
> >
> > Ron
> >
> > sebastian chedal wrote:
> > > Hello Flashcoders,
> > >
> > > Sorry to bother you with another simple AS2 questions, I'm making
good
> > > progress but I am stumped with one simple thing.
> > >
> > > I have one class/object that I want to use to generate copies
> > > [instances] of
> > > another class.
> > >
> > > The second class is an object in the library with an ID and an
> assosiated
> > > *.as file [in the linkage panel].
> > >
> > > The code is:
> > > =
> > >
> > > //PostModel.as
> > >
> > > import com.blabla.PostView;
> > >
> > > class com.blabla.PostModel {
> > >
> > >   public function createPost (__id) {
> > >var newPost = new PostView (__id);
> > >   }
> > > }
> > >
> > > =
> > >
> > > When I run this code, the class doesn't construct an instance...
> > >
> > > What am I missing? If I need to call the Library Identifyer instead,
> how
> > > would I do that?
> > >
> > > I don't want to attach the PostView to the PostModel class, I just
> > > want to
> > > create instances of them and attach them to _root [or some other MC
in
> > > the
> > > timeline].
> > >
> > > Thanks!!
> > >
> > > Seb.
> > > ___
> > > 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
>



--
O.Fouad - Digital Emotions
___
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] AS2: generating new instances dynamically?

2007-05-01 Thread sebastian chedal

Hello Flashcoders,

Sorry to bother you with another simple AS2 questions, I'm making good
progress but I am stumped with one simple thing.

I have one class/object that I want to use to generate copies [instances] of
another class.

The second class is an object in the library with an ID and an assosiated
*.as file [in the linkage panel].

The code is:
=

//PostModel.as

import com.blabla.PostView;

class com.blabla.PostModel {

  public function createPost (__id) {
   var newPost = new PostView (__id);
  }
}

=

When I run this code, the class doesn't construct an instance...

What am I missing? If I need to call the Library Identifyer instead, how
would I do that?

I don't want to attach the PostView to the PostModel class, I just want to
create instances of them and attach them to _root [or some other MC in the
timeline].

Thanks!!

Seb.
___
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] OOP: design patterns: multiple MVCs?

2007-04-28 Thread sebastian chedal

Hello folks,

I have a design question, the application I am building could be designed
with several Model->View->Controller rings in it. But I am not sure what
would be the best practice to connect them together... or if MVC is even the
best way to go?

In a nut shell here is what my application does:

"An 3D interface moves with the mouse around the screen. When you click on
an item, it expands to show you some info [sometimes an flv]. If you click
on "more info" button, you zoom into the 3D navigation item and the flash
view pane gets filled exclusively with information about this navigation
item.

Each navigation item has different modules of information compared to other
navigation items, and inside each module is content. There are possibly sub
pages underneath each navigation page. Naturally you can close the page and
go back to the main 3D navigation at any time."

Now where I am unsure about my UML OO design is in the approach of the
module-templates, and whether I should use multiple M->V->C circles. I will
be implementing SWFAddress [for deeplinks] and Stats, so an overall event
manager [Observer] is essential.

Logically I would imagine just 3 [nested] classes for the templates:

Page->Module(s)->Content(s)
[there can be multiple modules per page loaded dynamically and multiple
content item types loaded per module: button, text, flv players etc.]

but if I break 'Page' into an MCV chain I would get:

SWFAdress->PageController->PageModel->PageView
[Page Controller also sends data to StatsCollectorClass for updates]

And then another chain for the modules:

?>ModuleController->ModuleModel->ModuleView

And then I presume the content would then be loaded/attached by the
'ModuleView'

My questions are:

1. Should I bother with an MCV layout? [the application needs to built for
long term use/expansion] Or just group the pages and modules together into
one class each?
2. If I do split them into separate classes, where is the point of
connection between two MCV chains? Is it from the parent model to the
child's controller? Or from the parent's controller to the child's
controller?

Thanks for your insight!

Sebastian.
___
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 write a class that loads XML?

2007-04-27 Thread sebastian chedal

ok i was able to solve the issue, has to do with working from a network
drive... how annoying!!!

http://www.epresenterplus.com/blog/archives/30.html

:-P

XML is loading now just fine too, thanks everyone!!
:D

seb.

On 4/27/07, sebastian chedal <[EMAIL PROTECTED]> wrote:


Hi Thanks for that tip, delegate seems to work when I pass a variable, but
its still not passing the XML object.

However, I'm also having a problem which is stopping me from figuring out
the issue... intermitently I get the error message:

**Error** {...}/Flash/work/core/XMLoader.as: Line 3: The name of this
class, 'XMLoader', conflicts with the name of another class that was loaded,
'XMLoader'.
 class XMLoader {

I get this for different classes once in a while, and if I just recompile
a few times, eventually the error goes away... huh? Its a very weird issue.
I don't have any objects in the library with the same name... has anyone
ever had this issue?

Thanks!

On 4/27/07, Danny Kodicek <[EMAIL PROTECTED]> wrote:
>
> > Hello Flash coders.
> > :)
> >
> > Could anyone help me to fix my class code? I can't find any
> > reference anywhere that will help me... I'm trying to load
> > XML via a generalized class object, but the data in postXML
> > never makes it to the parseXML constructor, any help is
> > greatly appreciated!
> >
> > Thanks!
> >
> > Sebastian.
> >
> > [CODE]
> >
> > class XMLoader {
> >
> > private var postXML:XML;
> >
> > private function parseXML () {
> >//do something with postXML
> > }
> >
> > public function XMLoader (__file) {
> > postXML.ignoreWhite = true;
> > postXML.load(__file);
> > postXML.onLoad = parseXML();
> > }
> > }
>
> You can use the Delegate class to send the onLoad function back to your
> object:
>
> postXML.onLoad = mx.utils.Delegate.create(this, parseXML );
>
> Best
> 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
>



___
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 write a class that loads XML?

2007-04-27 Thread sebastian chedal

Hi Thanks for that tip, delegate seems to work when I pass a variable, but
its still not passing the XML object.

However, I'm also having a problem which is stopping me from figuring out
the issue... intermitently I get the error message:

**Error** {...}/Flash/work/core/XMLoader.as: Line 3: The name of this class,
'XMLoader', conflicts with the name of another class that was loaded,
'XMLoader'.
class XMLoader {

I get this for different classes once in a while, and if I just recompile a
few times, eventually the error goes away... huh? Its a very weird issue. I
don't have any objects in the library with the same name... has anyone ever
had this issue?

Thanks!

On 4/27/07, Danny Kodicek <[EMAIL PROTECTED]> wrote:


> Hello Flash coders.
> :)
>
> Could anyone help me to fix my class code? I can't find any
> reference anywhere that will help me... I'm trying to load
> XML via a generalized class object, but the data in postXML
> never makes it to the parseXML constructor, any help is
> greatly appreciated!
>
> Thanks!
>
> Sebastian.
>
> [CODE]
>
> class XMLoader {
>
> private var postXML:XML;
>
> private function parseXML () {
>//do something with postXML
> }
>
> public function XMLoader (__file) {
> postXML.ignoreWhite = true;
> postXML.load(__file);
> postXML.onLoad = parseXML();
> }
> }

You can use the Delegate class to send the onLoad function back to your
object:

postXML.onLoad = mx.utils.Delegate.create(this, parseXML );

Best
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


___
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] how to write a class that loads XML?

2007-04-27 Thread sebastian chedal

Hello Flash coders.
:)

Could anyone help me to fix my class code? I can't find any reference
anywhere that will help me... I'm trying to load XML via a generalized class
object, but the data in postXML never makes it to the parseXML constructor,
any help is greatly appreciated!

Thanks!

Sebastian.

[CODE]

class XMLoader {

   private var postXML:XML;

   private function parseXML () {
  //do something with postXML
   }

   public function XMLoader (__file) {
   postXML.ignoreWhite = true;
   postXML.load(__file);
   postXML.onLoad = parseXML();
   }
}

[/CODE]
___
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] dynamically attaching a movie clip to a class/object

2007-04-26 Thread sebastian chedal

hello flash coders!

ive just joined and there are some nice discussions here, i hope to
contribute positivly to the level of knowledge in the group.
:)

i'm currently learning how to work in an OOP manner in flash, and thus
meeting some basic hurdles.
it would be very kind of you if you could assist me in my [probably very
simple] problems.
:-)

I'm using external *.as files, and at the moment i am trying to figure out
how to attach a movie to it [should be simple, right?]

my as file:

class Post extends CoreClass  {
   private var myPost:MovieClip;

   public function setCord(px,py,pz):Void {

   //set coordinates
   public var px:Number = px;
   public var py:Number = py;
   public var pz:Number = pz;
   //original point locations
   private var ox:Number = px;
   private var oy:Number = py;
   private var oz:Number = pz;
   }

   public function attachMe ():Void {
   attachMovie("signPost", "myPost", this.getNextHighestDepth());
   myPost._x = 0;
   myPost._y = 0;
   trace ("myPost = " + myPost._x);
   }
}

In frame 1 of the movie i write:

Post0 = new Post ();
//Post0.setCord(100,100,0.9);
Post0.attachMe();

The trace comes up 'undefined'
if i use the 'attachmovie' from the root in the main time line, it works
just fine.

any clues?

thanks!

sebastian / amsterdam
___
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