Indigo Rose Software

Go Back   Indigo Rose Software Forums > Indigo Rose Software > Developer's Den

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
Huh? Loading (and Functioning) External SWFs in Flash MX 2004

I am building another project in Flash MX 2004, this time having to load many external SWFs.

Using LoadMovie ("moviename.swf", target) works fine, EXCEPT when trying to load swfs that have _droptarget actions in them (created in SwishMax). Loaded into Flash, the swf acts like the "drag and drop" is not being dropped in the correct position. On its own, the swf works fine. Loading it into a target clip, it does not.

Loading the swf into a level using loadMovie ("moviename.swf", level) does work, but then my navigation buttons in the Flash slide presentation are covered up....

I have also tried loading nav buttons on top of the subject swf that is loaded into a level, but Flash won't let me assign actions to those buttons. I tried "pre-adding" the script to the external nav swf before loading it into a level... still not working.

Have checked out Flashkit, Kirupa, and Actionscript.org forums but didn't find anything....

AGRO, Corey, or any other Flashers have any suggestions...?
Reply With Quote
  #2  
Old 01-12-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Hi AXXESS. Hmmm, let's see. Sounds frustrating.

If I had to take one guess I would say it sounds like Swishmax may be referring to it's timeline as root whereas in Flash it won't work out that way unless you import the Swishmax frames directly into the Flash timeline, which is FWIW, I believe the manner in which Swish movies are imported.

So in other words the Swishmax code is probably trying to look for the drop target one level up from it's timeline in Flash. In this case that means it probably sees itself (the entire loaded movie) as the drop target no matter what. I might be wrong though.

How to fix this? Not too sure, I don't own Swishmax... I wish I could be of more help. I'm almost certain that the Swishmax support team/forum would know exactly what's going on as soon as you mention it to them. Surely you aren't the first person to experience this. Or perhaps AGRO knows something about this.

Anyhow sorry, wish I had a more tangible answer.
Reply With Quote
  #3  
Old 01-12-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
Hi Corey,

Swishmax.. hmmm. The only thing I use it for is the quick swfs like the one I built and am trying to use.... its surprising that certain types of swfs can't run inside Flash... an swf should be an swf and not matter what timeline etc it is used in IMHO anyway...

Otherwise I do use Flash for everything else.... I don't really care for Swishmax anyway... I don't do any of the cheesy effects in Swishmax... I was just trying to use the original swf because I don't necessarily want to rebuild the original in Flash....

Yes, there are references to _root in the original file, I tried using MovieClip._lockroot to keep it from looking at the main timeline.... not working...

I will keep looking. Odds are I will find something eventually and post it here... just thought I would run it past my IR forum friends....
Reply With Quote
  #4  
Old 01-12-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
All you have to do probably is change those references to point into the loaded movie, so lets say you loaded in the Swishmax movie as a movie clip and named it "swish". So you now have your main Flash timeline and then your buttons, etc. plus now a loaded movie clip (under the buttons) named "swish".

Just change the references to "_root" into "_root.swish" and it should work.

If the Swishmax movie is just a single timeline you could also just change all the instances of "_root" to "_this" and that might work, but maybe not if it has internal movieclips.
Reply With Quote
  #5  
Old 01-12-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
Actually I believe its the _root reference in the Swish generated file that is throwing things off. The clip loads fine, it is just not functional. I will do more digging and report back...

Last edited by AXXESS; 01-13-2005 at 12:02 AM.
Reply With Quote
  #6  
Old 01-13-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Well yeah, sure it's going to load fine, it's only going to affect actions with paths not symbols, etc. All "_root" does is point to the top of the timeline hierarchy. In the Swishmax movie this is intended to be it's main timeline but when you load that movie into a Flash movie, it now becomes the timeline of the Flash movie. Know what I mean?

On other words the movie still loads and plays fine because none of that is dependent on actions. But now when you try to refer to _root you end up one level too high so the movie fails to work properly as it does when you run it standalone.

You can be sure of this by importing you Swishmax .swf directly into the frames on the main time line of a Flash movie, and then running it. now it works fine right? That's because the main Swishmax timeline and the main Flash timelines are at the same level. But if you import the Swishmax frames into a movie clip, or load it as a movie clip, the action references now point to the main Flash timeline which is one level up from the target movies, causing the _droptarget to be the entire movielip itself rather than one of the symbols within it.

Anyhow it's simple, I'm probably not explaining it well, but suffice to say that changing the references to "_root" in the Swishmax movie to "_root.mc_swishmax_name" will probably fix it.
Reply With Quote
  #7  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
It does sound like the improper path is being referenced.

I ran into this soon after I started tinkering with Flash.

Maybe something like this:

_root.parentMovie_mc.childMovie_mc

Corey?
__________________
Intrigued
www.amsuser.com

Last edited by Intrigued; 01-13-2005 at 12:42 AM.
Reply With Quote
  #8  
Old 01-13-2005
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
Axxess,
It definitely is a bad path naming.
In SwishMax, you need to call the drop target as a relative path, not an absolute one. Do not use _root, just use _parent.
Here is a dummy example for what you want.
The zip file includes:
- The swish file
- Its swf movie
- A main Flash file (.fla)
- The main swf movie.

It works fine here.
Good luck

Yossi
Attached Files
File Type: zip swish_flash.zip (3.5 KB, 18 views)
Reply With Quote
  #9  
Old 01-13-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
In this case using either "_parent" or "_root" from the Swishmax timeline will refer to the main Flash timeline into which the Swishmax movie was loaded. No difference.

But Yossi has a good point for certain scenarios, i.e. if you create a movie clip with a _droptarget action in it and you wish to be able to freely drag and drop that clip into any level timeline and have it work from there, then _parent and _this are excellent... Cool example Yossi, thanks!
Reply With Quote
  #10  
Old 01-13-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
No Loading into Levels....

Hi,

Thanks for the input Yossi, however I am not attempting to load into a level (i.e..... loadMovieNum("movie.swf",1); - that already worked. I need to load the Swishmax clip into a target clip in the main Flash movie.... (i.e., loadMovie "movie.swf", targetname);

Loading into the target clip is where the the Swish generated file does not function, and yes, due to its references to _root. I have tried the following without success:

_parent
_this
_root.targetclip_name
_this.targetclip_name

When I change the reference to _this.targetclip_name, the loaded Swish movie just freezes when the dragged object is dropped.

Now where is that "bang your head against the wall" Smilie????
Reply With Quote
  #11  
Old 01-13-2005
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
What about using a swapmovie action on the target movie, so as to put it in a defined level and THEN use the loadmovienum to load the swf from swish into that level?

I haven't got the time to play with this, but it may work.
Yossi
Reply With Quote
  #12  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
How about a sample upload of the problematic file(s)?
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #13  
Old 01-13-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
Quote:
How about a sample upload of the problematic file(s)?
OK, here ya go. The .swi is attached. Anyone that wants to look but doesn't have Swishmax, you can download a free trial here:

Swishmax free download

The exercise is supposed to work as follows:

1) Click to start
2) User clicks Ohms symbol ("Omega", or horseshoe shape)
3) User drags and drops red lead to red port on meter
4) User drags and drops black lead to "COM" port on meter

Remember to that it needs to be loaded into a target movie clip in Flash and still function as described.
Reply With Quote
  #14  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Here is something that may shed some light on this situation:

http://www.swishzone.com/forums/lofi...php/t4911.html ?
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #15  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Also, AXXESS I like the look of that swish file!

One thing I did notice that may confuse the user of such is that to get the correct answer you have to drag the cables by the center of the round end of such and not the cable below.

A small gotcha' to check out.

But, this is really neat the way you set it up! I feel like I have the unit in my hand!

__________________
Intrigued
www.amsuser.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software