Linkage ID And External Swf Problem
Ok I am starting to finally get into AS3 and love it so far, except I ran into this problem and would greatly appreciate any help. Ok...
I have a file, "loader.swf". In its library I have a movieclip with a linkage id set to "Navigation". I am using a Document Class for loader.swf called "Base". Inside of Base.as I have setup a script to add the navigation from the library as such...
ActionScript Code: var nav:Navigation = new Navigation();addChild(nav);
This works fine. However, when I load in an external swf, the external swf does not recognize the library item "Navigation" and throws back an error.
ActionScript Code: 1046: Type was not found or was not a compile-time constant: Navigation.1180: Call to a possibly undefined method Navigation.
The only solution was to put the Navigation movieclip in the external swf and then it works fine, but that seems like a terrible work around.
Anyone who might have some advice?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 09-23-2008, 06:41 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Linkage In A External Swf
Hi I am using a 'export for actionscript' on one of my mc in a seperate swf.I am then try to refer to that mc in another movie ('controller').
eg. image_holder.attachMovie(alchemy, "current_prj", 2);
But for some reason it is not reconising/finding the source mc. if I put the movie clip that is being refered to inside the controller movie it works fine.
what am I doing wrong, can you still use linkage on external movies??
Thanks
Kaan.
Linkage With A External Swf ?
Hi I am using a 'export for actionscript' on one of my mc in a seperate swf.I am then try to refer to that mc in another movie ('controller').
eg. image_holder.attachMovie(alchemy, "current_prj", 2);
But for some reason it is not reconising/finding the source mc. if I put the movie clip that is being refered to inside the controller movie it works fine.
what am I doing wrong, can you still use linkage on external movies??
Thanks
Kaan.
Linkage For External SWF
Anyone know how to access an asset within an SWF loaded into a movieclip?
Say there's an asset with linkage 'obj' exported in assets.swf. If assets.swf is loaded into a movieclip within main.swf, can the 'obj' asset be accessed directly from main.swf?
eg code in main.swf:
Code:
createEmptyMovieClip( 'mAssets', 1 );
mAssets.loadMovie( 'assets.swf' );
// ... check assets loaded and then ....
attachMovie( 'obj', 'mObj', 2);
Thanks
External Library Linkage
how do you reference a movie clip in an external
library? i keep trying attachMovie("externalclip",...
and it doesn't work, even w/the linkage setup to an import that points the file. Do i need something else?
Preloading External SWF With Linkage
Hello! I am hoping someone on the boards will be able to help me with this problem. I am using a really pageflip cool program that someone was kind enough to write and share, that includes a preloader in a seperate swf file from the main swf. The problem is that the preloader does not seem to work. When I try to use the preloader it does not show, and just downloads the main swf. I am not completely sure, but I think the problem may be linkage since in the main SWF there are movies that use 'export in first frame'. If I uncheck this, then the movie will not run right. How do I get the preloader to load the movie before playing, and not just show a white screen during while the main swf downloads?
I have tried the various answers and tutorials on this site, but I can't get any of them to work right
Thank you for any help/direction you can give!
test url:
http://www.vividlilac.com/test3/
External Clips And Linkage
Here is the setup
MainMovie.swf (contains Lib item aClip)
|
Loaded.swf (loaded via MovieClipLoader)
What i'm trying to do is this
loaded.attachMovie("aClip", "attachedClip", 1);
This seems really simple to me but it doesnt work.
Does anyone have any insite to this?
Thx in advance
External Swf And Flv Linkage Issue
Anyone,
I have a presentation this afternoon. Everything is going to be presented through flash player 8, in office, from a laptop.
I'm using Pro 8, exporting my swfs to player 8, AS2, windows xp.
I have a swf (container.swf) that acts as a container for several other swfs holding the content.
The container.swf is located in a folder (presentation), while the externally loaded swfs are located in a folder (Base) located within the "presentation" folder. (basically, there are only two things in the presentation folder: container.swf and "Base" folder).
One of my external swfs (video.swf) contains an FLVPlayback component which points to an external flv (externalvideo.flv). The externalvideo.flv resides in the "Base" folder along with the video.swf. If I just open the video.swf, it will play the externalvideo.flv. However, if I open the container.swf and instruct it -through a button, whatever- to load the video.swf, it will not play the externalvideo.flv.
I can bypass this whole problem by just copying the externalvideo.flv, along with its skin, to the "presentation" folder so that the container.swf and the externalvideo.flv are in the same folder location.
However, I do NOT want the externalvideo.flv, or its skin, to be located here. I really need, for whatever reason, the "presentation" folder to only hold the container.swf and the "Base" folder.
Is there a way to get around the file structuring rules???
Using External .swf Linkage Audio
Because flash doesn't loop external mps file correctly, there is always a pause in the loop. The work around is to load the AIFF, or WAV, file into the .fla and let Flash compress the audio file, then the loop works without the pause. The problem with this is that when I have many music loops it takes a long time to publish and test, so in AS 2 I would publish .swfs that compressed the raw audio file and gave the audio file a linkage. Then I would load the .swf into the main .swf and access the loaded .swfs linkage file. The code looked like this:
_root.createEmptyMovieClip ("soundsMC",_root.soundsMC.getNextHighestDepth ());
instructionsContainer = _root.soundsMC.createEmptyMovieClip ("instructionsContainer", _root.soundsMC.getNextHighestDepth ());
instructions = new Sound (instructionsContainer);
instructions.attachSound ("instructions theme");
This worked perfectly. But this method does not work in AS3.
This is what I've tried in AS3:
Attach Code
public function initView ():void {
loader = new Loader ();
targetStage.addChild (loader);
loader.contentLoaderInfo.addEventListener (Event.INIT, loarderLoaded);
loader.load (new URLRequest("sound/fishhole_old.swf"));
}
//
private function loarderLoaded (event:Event):void {
trace ("loarderLoaded");
loader.contentLoaderInfo.removeEventListener (Event.INIT, loarderLoaded);
var ldrInfo:LoaderInfo = event.currentTarget as LoaderInfo;
var libMedia:MovieClip = event.currentTarget as MovieClip;
var FishHoleOldMusicMCClass:Class = libMedia.loaderInfo.applicationDomain.getDefinition("FishHoleOldMusicMC") as Class;
var music:FishHoleOldMusicMCClass = new FishHoleOldMusicMCClass();
//var music:Sound = new FishHoleOldMusicMCClass();
//var music:MovieClip = new FishHoleOldMusicMCClass();
music.play(0, 1000);
}
External Clips And Linkage
Here is my setup:
mc_MainMovie
|
mc_Loaded (Loaded via MovieClipLoader)
now i was trying to attach a lib item in mc_MainMovie (ClipA) to mc_Loaded
mc_Loaded.attachmovie("ClipA", "_clipA_", 1);
This doesnt seem to work.
Any ideas?
External SWF And Sound Linkage Problem
I'm making a game for a contest on Newgrounds, called the Rock Out Contest. Since there is a 10 MB limit on files, I decided to put all the levels on a different server. The levels are a SWF with the song embeded in it, along with some code which tells the main SWF what the level looks like. The problem I'm having is that I can't get the song to play. To make things more complicated, I have a external *.as file that I made which creates "Beats" whenever certain times pass in the song. Normally, I would set the song for the script by doing this:
Code:
_root.BSS.SetSong("Linkage ID");
This works fine if it's not coming from an external SWF. But I've tried these several codes, and none of them worked:
Code:
// External SWF, attempting to access SetSong function in script
_root.BSS.SetSong("Song");
trace(_root.BSS.BS_soundSong.duration); // undefined
Code:
// External SWF, attempting to overide SetSong function by modifying Sound variable
_root.BSS.BS_soundSong = new Sound(this.Song);
trace(_root.BSS.BS_soundSong.duration); // undefined
Code:
// External SWF, attempting to overide SetSong function by modifying Sound variable
var GameSong:Sound = new Sound(this);
_root.BSS.BS_soundSong = new Sound(this.Song);
trace(_root.BSS.BS_soundSong.duration) // undefined
The trace() functions actually don't work since I have to test the game on a remote server (due to sandbox errors, and Flash 8 Pro isn't allowing me to debug remotely), so I used input text fields to test it. The SetSong() function looks like this:
Code:
function SetSong (sGameSong:String)
{// Sets the song used for the game
BS_soundSong.attachSound(sGameSong);
}
I've been working on this problem for quite a while now, and I don't have much time left. I would greatly appreciate any ideas/sugguestions/help.
Thanks in advance
Variable Url In External Library Linkage?
I'm setting up a template that needs to import artwork for buttons. There are three different button sets to choose from. Each button set has 12 different movie clips in it, but not all of them are used in the same place at the same time. A shared library would be ideal, because i can choose only the items i need and attach them to the movie clips where they are needed. The template will be used by multiple clients, so the url won't be the same each time it is used. Is there any way to make the export and import url for the shared libraries a variable? Basically, i'm trying to load movie clips from a swf into the library, so if there is a better way to do this, any suggestions would help! Thanks very much.
External .swf Runtime Linkage .pngs AS3
Flash can compress .png files like Photoshop can compress .jpg files better than any other tool hands down.
I have 77 .png files that are 1.8 .megs on my c: drive after I imported them and setting the file compression under the "File > Publish Settings" to 75% for jpg and published the .swf with all the .png on the stage the file size is 350K that's about 20% of the original file size of the .pngs downloaded file by file with 77 separate request.
I can create linkage in the shared .swf and test the movie with code in the shared .swf to add the movieclip holders for each .png to the stage but when I load the shared .swf into the main .swf Flash acts like it can't create the classes based on the linkage I setup or that the MovieClip linkage doesn't exist.
I tried a test to have the shared .swf with all the .pngs and linked movieclips to add the assets to it's own stage and it works fine but that means a lot of my code and logic is included in the shared .swf that the designers need to add .pngs to. It's unfortunate AS3 sucks but I'm just about done with the project if I knew what a battle AS3 was going to be I would have stayed with AS2 my next projet will be AS2 no question non at all. Anyway I setup "class" linkage identifier for each .png with a movieclip holder for each image. The 20% of the size for the pngs and one request vs. 77 separate request makes it worth the extra effort of importing the images, creating a holder movieclip with linkage but the main .swf that loads the shared .swf with all the assets and linkage can't see or create the assets like the shared .swf can when I test it.
We need to have the main .swf get a handle of the linked .png assets and place them in the main .swf to load the assets to different parts of the main .swf. It's cute that the shared .swf can add the linked assets to it's own stage but not too useful. Also the way we deploy we cannot roll out a new release/build to update the .pngs but we can upload a new .swf to the asset server so the .pngs need to be in a separate .swf. I can get the shared MovieClip to add the linked assets to it's own stage when testing and when loading my problem is the main .swf that loads the shared .swf cannot create instances of the classes that are exported for runtime sharing using linkage.
If it is possible I would like to know how the heck you get a handle on a linked asset in an externally loaded .swf. Preferably without creating my own prototyped insane class consisting of mega libraries of external .as files. Just a way to reference MovieClips holding pngs that have linkage and are setup for runtime sharing. It really shouldn't be this hard it's a simple task in AS2. I'm not looking for a coding competition or some wild class to do the job I want a few lines of code to create an instance of a class then reference to the linkage/MovieClip holding the .png to addChild it into a target movieclip.
Attach Code
///// don't write a mountain of code to load a few images stupid ////
var swf_loader:Loader = new Loader();
var thePath:String = "CompressedPNGs.swf";
var theURLRequest:URLRequest = new URLRequest(thePath);
swf_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, populateTheUI);
swf_loader.load(theURLRequest);
function populateTheUI(event:Event)
{
var assetHolder_mc:MovieClip = new MovieClip();
assetHolder_mc.addChild(swf_loader);
addChild(assetHolder_mc);
//above adds the entire .swf to the stage
//I want to load each .png asset 1-by-1 into target movieclips
addChild(assetHolder_mc.linkeAssetName)
//this should but doesn't load the individual shared assets to the stage
}
Edited: 08/11/2008 at 04:13:18 PM by jeffjoneslive.com
Loading And External Linkage Library
I'm trying to load linkage items from a library in a different swf but I can honestly I do not have a clue how to... I've tried using attachMovie as well as loadclip to load the swf... then using attachMovie to attach the linkage item... This thing is frustrating lol. I know its possible I just cant figure it out
External Stylesheet Font Linkage Question
hi...i am trying to embed a font that will be coming from and external stylesheet. I have to embed this font because i have never seen it until i received this project, and thus, it has to be exactly this font that loads into the movie. I read this from the help:
Quote:
If using CSS styles to set fonts for TextFields or components, set the font-family CSS property to the name of the embedded font. The font-family property must contain a single name and not a list of names if you want to specify an embedded font.
I understand the above to mean, the font in my css must be called the same name as the font's linkage name in the library. My question is, in the stylesheet, must the font contain quotes, or can it go in without.
Code:
.norm{
font-family:WhackyFont;
/*or font-family:"WhackyFont"; */
font-size:10px;
color:#FFFFFF;
}
Access A Linkage Clip From An External Class
I have a simple FLA which contains a movie clip in the library. The clip has a linkage Class of "Ball". I know that to get this clip onto the stage I can simply type the following on the main timeline:
Code:
addChild(new Ball());
Doing that places the clip on the stage at runtime. Yea! Now, here is where my problem is. I delete the above code and make an instance of an external class that I have. For demonstration purposes we call the class "MyClass". So now on my main timeline I have the following:
Code:
var myClass:MyClass = new MyClass();
Here is what "MyClass" looks like currently:
Code:
package{
import flash.display.MovieClip;
public class MyClass extends MovieClip{
function MyClass(){
var ball:Ball = new Ball();
addChild(ball);
}
}
}
This produces no errors and nothing on the stage. I have tried "import Ball;", etc. Can someone tell me how, from the external class, to reference the symbol in the library which I have assigned a linkage (Ball) to in order to display it on the stage?
It was pointed out to me that adding "MyClass" as the Document Class will make this work. Is it the only way?
You can access the files being used here or attached to this thread: http://www.pixelfumes.com/uploads/flashClassTest.zip
External Preloader Library Linkage Issue
Hey Everyone,
So I recently ran into a real frustrating problem when I was trying to make an external preloader for my swf, and I thought that I would share it here so that someone else won't have to go through what I did.
Anyway, my original goal was to make a simple external preloader swf with nothing in its library, that would load my main swf that had all the resources in its library. After I got it all coded, I kept getting a reference error at runtime when I tried to run the preloader.swf file saying that variable such and such is not defined. The variable that it referred to was in fact, defined in the library of main.swf.
Main.swf would run fine on its own, and preloader.swf could load other swf's fine if I just substitued the name. So I was really at a loss as to what was causing the problem. But after banging my head against the wall for several hours, I finally found the answer.
What I had done when I did the preloader was I just made the preloader.fla and the preloader.as file and put them both in the same directory with all the source code for my main swf. The problem with this was that when I compiled the preloader it must have got "confused" and tried to link in some of the classes (.as files) that I had in there for my main.swf. Then when I ran the preloader it thought that several variables in the main.swf were not defined.
So the solution to this issue was just to move the preloader.fla and the preloader.as into its own directory with just the main.swf (no source code for main). I compiled the preloader in there and it worked fine!
So the moral of the story is...if you are doing an external preloader make sure you keep it in its own directory when you develop it, or you can run into linkage type issues.
A Semi Newbie Question About External URL Linkage From Flash
I am currently trying to make an 'enter' button for the end of my pre site movie,and it keeps producing this error.I've tried all kinds of ways,looked through nearly all the relavent tutorials here at Flash kit,but still no conclusion.Where does this mysterious ',' or ')' go?
**Error** Scene=Scene 1, layer=buttons, frame=160:Line 2: ')' or ',' expected
{getURL(http://www.freewebs.com, window=_parent)
Total ActionScript Errors: 1 Reported Errors: 1
Access Class Defined In "linkage..." From External Class
Hi
Rather strange title hu? Well, I'm trying to access a class which was defined on a library symbol in my main.fla by using the Linkage... dialog. Classname: GrungeTitle, BaseClass: BitmapData.
I'm trying to access this class to build my repeating background on my main.fla (which uses a document class: base.as).
My code of the document class:
Code:
public function init():void {
grungeBackgroundTile = new GrungeTile(300, 300);
var spr:Sprite = new Sprite();
spr.graphics.beginBitmapFill(grungeBackgroundTile);
spr.graphics.drawRect(100, 100, 100, 100);
spr.graphics.endFill();
addChild(spr);
}
This code gets called on the third frame of my main.fla by calling: init();
When I try to draw a simple square in the sprite, the rectangle gets drawn on the stage, when I try to make a fill with a library item then it doesn't display a thing.
Any help?
Thanks
Linkage
Does anyone know of a way to do sound linkage with actionscript instead of hard coding it by clicking and doing it in the library? This is REAL important for me as it looks like Generator's ability to use sound is for ****
Linkage
Hi Everyone,
I'm using an attached sound with linkage.
The problem is that Flash automaticli load it in the first frame and it takes a lot of the time (the user won't c anything meantime)
SO...
I want to put this libary in another swf and to load it.
I do it but I didn't know how can I call the sound now.
I tried this:
------------------------------------------
x = new Sound();
x.attachSound("_level1/song");
x.start(0, 99999);
------------------------------------------
But it's not working.
Any solution?
and how can I know that this new swf is loaded?
Linkage ...
Hi all
My problem is that my movie - a slideshow has a call like
this:
sound1 = new sound();
sound1.attachSound("music");
sound1.start(0, 1000);
function setV (v) {
sound1.setVolume(v);
}
and of course I got a piece off music with a linkage = music
and this works fine.
THIS CALL is placed in an frame after the preloader loop
BUT the movie seams to start load the music in the memory
and that without showing the preloader-ani. Only when the
music is in memory the preloader starts for the hole movie..
Is there a way out of this?
Have a nice day :-) PAUK
Linkage
I want to make a screensaver that detects if the person is online and if so populates the screensaver with new images..using linkage in FlashMX...
Does anyone know how you can make actionscript that can be linked..I tired a link in an MC with code that would effect the main timeline...The MC came in, but not the code
why?
does anyone now any good linkage documents?
Linkage
Hi! i have a little problem. I create a .fla file to use it as a shared library, that file have a lot of movie clips. Once it was created i have the need to change the file name. I was wondering if there is any automatic way to change the url name of every movie clip on the library.
Thanks!!!!
How To Do This... CD Linkage
hello guys
i created a button, and what to add a "GET URL" action to it... to open an HTML page located on a CD, what is the command ?
i tried: on (press) get url (webindex.html)
but it didnt work... it opens the c:webindex.html insted !!
what is the exact command to use ?
Linkage
I am trying to standardise my work, almost make it into a production line and am thinking of using the shared library way. I want to be able to make one button and so forth and then use that in all my work, is using the shared library the best way to do this, and will it mean that if i change the original button it will overwrite wherever that button is used.
Has anybody done it any other way, or is using the shared library the only way.
cheers
lee
Linkage
guys
how to change the link instead of to the website, i want to link to the scene inside the same swf
onClipEvent (load) {
daTextBox = "<a href="http://ww.yahoo.com">When you say nothing at all (Ronan) 4.17</a>
<a href="http://www.msn.com">Run to me (Oscar de La Hoya) 3.41</a>
One in a million (Bosson) 3.36
Better man (Robbie Williams) 3.22
Escape (Enrique Iglesias) 3.28";
}
tq
Plz Help Me On Linkage.
Hi,
I need help on symbol linkage, using linkage we can send action script to another swf file or we can retrieve script from that swf in another swf file I am getting that. But my problem is that I would like to get dynamically updated content.
Thanx
Linkage
Hello
does anyone know if a linkage property of a library item
can be set through actionscript
and does anyone know of a thread on shared libraries
i would really appreciate any help
thank
PDF Linkage
Could anyone tell me how to write the script for opening an external pdf file and how/where to save this file for the published flash to find it?
many thanks in advance.
Shirshiron
Linkage
hey im loading one swf into another swf. Im using the window component here my code to help explain
---------------------------------------------------------------------
on (release){
flashvideoclip = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true, {contentPath:flvvideo,<---------- closeButton:true, title:flvtitle});
flashvideoclip.setSize(1240, 930);
lo = new Object();
lo.click = function(){
flashvideoclip.deletePopUp();
}
flashvideoclip.addEventListener("click", lo);
}
---------------------------------------------------------------------
BUTTON1 (below) BUTTON2 (above)
---------------------------------------------------------------------
on (release) {
videotitle = "Carols PV"
realplayerurl.url = "removed";
realplayer.setTextFormat(realplayerurl);
flvvideo = "vp"; <----------------------
_global.flvurl = "removed";
flvtitle = "Carols PV"
}
---------------------------------------------------------------------
vp is the linkage name for a mc in the lower swf file.
meaning its in the 2nd swf that gets loaded not loaded into.
it runs fine untill i load it into the other swf. than the linkage disappears if anyone could help that would be nice.
Linkage Help Please
i have a scroll plane componet, the movie inside is named venders
i need the movie venders to link to another movie on the same level as the componet... any help with this would be great
Linkage
how to link this list.addItem("Because u love me - celine dion"); to an mp3 in flash???
the mp3 file iz already been imported into the library....
Thanks
Linkage
Agh - simple question. I need to link a button to a URL. The URL is to a downloadable file so I don't need to open a new page or anything.
Thanks,
H
Is This Due To Linkage.... Help Me Out.
I am currently involved in a commercial project. And I am in a drastic situation of loosing the project due to the fluidity of the animation.
About my project:
My project contains more number of SWF animations. There are almost 1000 swf files. I have a base file which is called main.exe ( made in FLASH ). In this exe I have a movieclip called containerMC. I have naviagtion buttons which allows me to load swf files into the movieclip containerMC.
Some swfs are around 2MB. And the most important is I have some general swf files in which I have more animations, each of 200 images. I have exported this image animation files using Linkage.
And I have imported this image animation files in lot of swf files.
My problem:
If I load the swf files (which have imported the image animation) into containerMC I have the problem of animation fluidity. The animation is not running smooth. If I run the file seperatly its running smoothly but not the case if I have loaded this into containerMC.
After testing the computer memory usage I was afraid because the usage keeps on increases when I loaded screen by screen. It goes upto 400MB too!!
My question is?
1. Why the animation is running jerky while I loaded into containerMC?
2. Why the memory usage is increasing steadily when I loaded all the screens one by one?
3. How actually linkage works? a) Is all the imported movieclips will be imported into containerMC?b) If a) is correct, will all the imported movieclips gets unloaded if I unload containerMC?c) If a) is wrong, where all the imported movieClips? Is this will be in the main.exe? It will be there always (once imported ) and never unloaded? Is this the reason for increase in runtime memory usage?Did anyone faced the problem like this?
I hope someone could help me out to solve my problem and save my project. Who will save me ...?
I really thanks a lot for those who will be interested in solving my problem.
Linkage?
Hey. I have allot of different flash files, for different pages. i.e. home, shows, images ect.. I use the same background on all these flash files.
The problem is it loads this same image obviously in each flash movie, which is a bit of a pain, as it makes it longer to load a swf.
I'm wondering if this 'linkage' "thing" will fix my problem somehow. I'm not sure what this linkage does. Some help with this little problem would be great. Thanks.
[F8] Linkage
What kind of Action Script do I need to use, if I was the use a text button that say's "View QuickTime" to play a short film (MovieClip) as a Linkage.
[F8] Linkage
hi, I know this is a long shot, but I've got a HUGE library and each of the symbols need to export for actionscript - using the default name is fine
is there any better way to do this other than right clicking on each library item one at a time?
Linkage?
if i place a button on my main timeline called "p1", and there is a mc called "clip1" with code on frame 1 that does a function when "p1" is pushed... what would the coding for it look like this to have the function happen? it does not seem to work no matter what i do... but if i put it within the mc and remove the _root it works fine. how can i have the button on the main timeline or rather "call it"
i used this
_root.p1.onRelease = function() {
Linkage
Hey,
I'm having some trouble with the linkage option in the library, is it possible to see a JPG-file in a flash movie without it being in it? (loading it from your webserver) I saw this option 'Linkage - Import this symbol from URL' but I cant figure out how it works. If anybody could help me with that...
thanks,
Linkage
I have not been able to find any reference in the help file on how to set linkage properties through action script. I want to make a scrollpane and then display movie clips in the scrollwindow but the movie clips will change depending what is clicked on in the main movie.
Linkage With .exe ?
Hey...
I'm trying to link a sound from my library
but it doesn't work...
Can anyone tell me if it's possible
to link sounds when using a .exe published movie?
Thanks !
Neuhaus3000
XML Linkage
Hi all
I have flash file that calls information from an XML file and everything works fine, the XML data is shown in the flash.
The XML is:
Code:
<portfolio>
<site>
<company>NAME1</company>
<address>www.NAME1.com</address>
<software>Flash, XML, Dreamweaver, Photoshop</software>
<description>AMAZING!!</description>
</site>
</portfolio>
My question is how to get the <address> tag to be an actual link in flash so that it opens up a new browser window? Do i need to add something to the XML or do i have to add some ActionScript ?
Www.com Linkage?
My web site (flash movie) is completely finished and uploaded to my ftp server -
index.html
index.swf
how do I link these files to open when someone types in www.caresmarketing.com???
ps... I have notified the registry company to link the domain name to the ftp server. All that's left is for it to recognize what file to open. Is it a command in Flash MX I must use on the index.fla file? Can't find an answer... please help
Swf Linkage
Ok I have
1.swf and
2.swf
1.swf
contains
movie A
2.swf
contains
button B
2.swf is loaded into level 1 of 1.swf
How do I get the button B to effect movie A.
eg. goandstop at a frame in movie A
Could you give me some actionscript examples?
Also I know you can pass variables between levels remind me how to do that.
As Linkage
Does anyone know how to go about creating a symbol of type 'button' and then linking that symbol to actionscript code?
Every example I can find shows how to create a 'movieclip' symbol and then linking that to actionscript code. The actionscript code for the 'movieclip' linkage looks something like:
class myClip extends MovieClip{
.
.
.
}
I would assume a symbol of type 'button' would extend a different class such as:
class myButton extends Button{
.
.
.
}
I've tried all kinds of combinations but the symbol ignores the actionscript code. It works fine with type 'movieclip' but this isn't what I need.
I am building a very extensive data driven system and would like to create button symbols such as 'cancel_btn', 'save_btn', etc. that are linked with actionscript class code. This allows me to visually use the symbol in the layout but encapsulate the logic at the class level.
Anyone know the magic formula for getting this to work? Maybe I'm just using the wrong superclass?
Thanks in advance!!
Linkage...
hey, i need to link from one html file to another... in the html file i have embedded a flash file. you click the button and it takes you back to the 'main' page of the site... HOWEVER... is there a way to link TO a certain frame within the NEW html document? let me say this once again...
HTML document - flash file embedded
<-Click Me-> - flash button inside the flash file
--when you click it you're linked to another HTML document. that html docuemtn has ANOTHER flash file embedded. but i want to skip by the first scene and 50 frames of the next scene... can i tell it to link to certain scene and frame from this flash file?
Help With Xml Linkage...
So im trying to make a banner/slideshow using xml so i can just make all the changes in XML. I can get the images to go through and transition and as for the links it just opens the first child link only. Trying to see if someone can help me. The problem is the Flash Portion.
Example... http://www.fottografie.com/links/events/events.html
Download.... http://www.fottografie.com/links/events.zip
Here is the XML Code:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
'timer' :: number of seconds between each image transition
'order' :: how you want your images displayed. choose either 'sequential' or 'random'
'looping' :: if the slide show is in sequential mode, this stops the show at the last image (use 'yes' for looping, 'no' for not)
'fadeTime' :: velocity of image crossfade. Increment for faster fades, decrement for slower. Approximately equal to seconds.
'xpos' :: _x position of all loaded clips (0 is default)
'ypos' :: _y position of all loaded clips (0 is default)
-->
<gallery timer="10" order="sequential" fadetime="3" looping="yes" xpos="0" ypos="0">
<image path="events/flyers/flyer1.jpg" url="http://www.fottografie.com/links/ws/popup/sinsation.html" />
<image path="events/flyers/flyer2.jpg" url="http://google.com" />
<image path="events/flyers/flyer3.jpg" url="http://yahoo.com/" />
</gallery>
The Flash Script:
Code:
// set random # variables - each must be 0 for first 'while' loop below
var randomNum = 0;
var randomNumLast = 0;
// parent container
var container_mc = this.createEmptyMovieClip("container",0);
// movie clip containers
container_mc.createEmptyMovieClip("loader1_mc",2);
container_mc.createEmptyMovieClip("loader2_mc",1);
// preload watcher
this.createEmptyMovieClip("watcher_mc",100);
// load xml
image_xml = new XML();
image_xml.ignoreWhite=true;
image_xml.onLoad = parse;
image_xml.load("flyers.xml");
function parse(success) {
if (success) {
imageArray = new Array();
var root = this.firstChild;
_global.numPause = Number(this.firstChild.attributes.timer * 1000);
_global.order = this.firstChild.attributes.order;
_global.looping = this.firstChild.attributes.looping;
_global.fadetime = Number(this.firstChild.attributes.fadetime);
_global.xpos = Number(this.firstChild.attributes.xpos);
_global.ypos = Number(this.firstChild.attributes.ypos);
var imageNode = root.lastChild;
var s=0;
while (imageNode.nodeName != null) {
imageData = new Object;
imageData.path = imageNode.attributes.path;
imageData.url = imageNode.attributes.url;
imageArray[s]=imageData;
imageNode = imageNode.previousSibling;
s++;
}
// place parent container
container_mc._x = _global.xpos;
container_mc._y = _global.ypos;
// parse array
imageArray.reverse();
imageGen(imageArray);
} else {
trace('problem');
}
}
///////////////////Button Actions//////////////////////////
container_mc.onRollOver = function(){
this._alpha = 70;
};
container_mc.onRollOut = function(){
this._alpha = 100;
};
container_mc.onRelease = function(){
getURL(imageData.url);
};
// depth swapping
function swapPlace(clip,num) {
eval(clip).swapDepths(eval("container_mc.loader"+num+"_mc"));
}
function loadImages(data,num) {
if (i==undefined || i == 2) {
i=2;
createLoader(i,data,num);
i=1;
} else if (i==1) {
createLoader(i,data,num);
i=2;
}
}
function createLoader(i,data,num) {
thisLoader=eval("container_mc.loader"+i+"_mc");
thisLoader._alpha=0;
thisLoader.loadMovie(data[num].path);
watcher_mc.onEnterFrame=function () {
var picLoaded = thisLoader.getBytesLoaded();
var picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes < 4) {
return;
}
if (picLoaded / picBytes >= 1) {
swapPlace("container_mc.loader2_mc",1);
alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_global.fadetime,true);
timerInterval = setInterval(imageGen,_global.numPause,data);
delete this.onEnterFrame;
}
}
}
function imageGen(data) {
// random, or sequential?
if (_global.order=="random") {
// choose random # between 0 and total number of images
while (randomNum == randomNumLast) {
randomNum = Math.floor(Math.random() * data.length);
trace(randomNum);
}
loadImages(data,randomNum);
randomNumLast = randomNum;
} else if (_global.order=="sequential") {
// start at 0, increment to total number of images, then drop back to zero when done
if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
loadImages(data,p);
p++;
} else {
trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
}
clearInterval(timerInterval);
}
stop();
Thanks for the Help
--otto
Linkage To A Shared Lib - HELP
This is the second time I am posing this question,
but hopefully I will get what I am looking for:
It goes like this:
I have a main movie which is blank in frame 1 except for a preloader. The main movie starts on Frame 2.
However, there is a mc in the frame 2 which is (implicity) linked to a shared library. So this mc gets its movieclip from the shared lib.
What I want to know is that while I am in frame 1 (in the preloader for the main movie itself), how can I determine when this host mc has indeed loaded the mc from the shared library. getBytesLoaded() is only for the main movie - it does not account for any links to shared libraries.
If you have done something like this I would like to know.
PLS HELP!
Problem With Linkage -- HELP
I really like the linkage feature in Flash 5, but the big drawback for me is that when I export something from the library with linkage, it puts itself in the first frame of the movie to be loaded. As a result, if I am trying to preload the movie and the first thing I want 56k modem users to see is a 2kb logo, they would have to wait until all of the exported symobls from the library are downloaded before they see the logo.
I can see this clearly on the bandwidth profiler. I was trying to export a WAV file so I could control it better with attachSound, but when I exported it, my first frame was no longer 2kb, but became 34 kb, meaning that the WAV loop was 32k and it was placed on that first frame.
My big question is, using exported symbols from the library, how can I make it so the 2kb logo loads before anything else -- so that it becomes what people see when the site begins to preload, instad of having to wait for all of the exported symbols to download first?
|