Controlling one swf with another
Ok here's what I'm trying to do. I have speant quite sometime on it but can't seem to find a good resource for the solution.
I have a site I am working on which has a Flash intro. The other pages of the site hold a menu that's created in Flash. For some reason my client wants the ability to go back and view the intro again, which is easily accomplished with navigateToURL. HOWEVER the intro is broken into two distinct parts and I need to target the second part, which would require something along the lines of gotoAndPlay(500); or something to that effect.
What I am having problems with is how do I target a specific frame in a completely different movie, the intro, using a button from the Flash menu within the site. I'll try to explain it a bit easier. The top button on staticMenu.swf, which is placed throughout the site (aboutus.aspx, portfolio.aspx, etc...) needs to target frame 500 of mainIntro.swf which is embedded in default.aspx.
Any help would be greatly appreciated. It make keep me from beating my head off the wall in the future... =)
you can pass the frame to play in a query string, use javascript to parse the javascript and use the externalinterface class to evaluate the query string in flash. if it's there, goto frame 500 (assuming frame 500 is loaded - ie, you'll need a preloader), otherwise don't got frame 500.
Similar Messages
-
Fading between two pages & controlling one MC from another.
Let me see if I can explain this properly. I usually use a motion tween and the alpha channel to fade movie clips in or out. What I am currently trying to do is fade one page out and another in, but it could be one of several MCs. I basically have four "pages" for a website including services, portfolio, about, and contact. I have icons on my navigation bar (which is going to be imported into my XHTML seperately so it can float them according to the users window size). The icons need to navigate between the pages and the pages need to fade in and out (eg. fade in the Services MC when the user clicks on the services icon, and fade out of it and into the Portfolio MC when the user clicks on the portfolio icon). Please keep in mind that the icons and pages are in completely different .fla/.swf files because I couldn't figure out how to float them in Flash after several hours of looking around online, but know I can easily do it using div tags + CSS in XHTML.
If someone could quickly explain how to "gotoandplay" a label in a different .swf file (communicate between the .swf NavBar and my main .swf) as well as fade out of the current MC (whichever page the user is currently on) before fading into new page (according to the icon the user clicks on), I'm sure I could 'fill in the blanks' from the rest of the AS3 and Flash I already know. The page also needs to fade out of whatever page it's currently on when the user clicks on the hide button (located on the page in the main .swf file). There is also several subpages on each page (which shouldn't be a big deal if I can figure the rest of this out).
I'm going to be using this same concept for nearly all of the websites I design & develop in the future and really need to know how to do this for the current site I'm working on. I would greatly appreciate any suggestions on how to accomplish these two things.
P.S. Please keep in mind I'm not an advanced user in AS3, but am very computer savy, and have done my share of programming in the past. I looked around for hours online to try and complete this without using the forum, but have come up with links to dead tutorials and short answers left and right. I'm hoping I won't come across the same here.
From what I've read so far I believe I can use tweening in ActionScript instead of a motion tween on the timeline to fade in and out of clips and believe that's the method to use to accomplish what I'm trying to do. Correct me if I'm wrong though.I'm not looking for a "tutorial created especially for me".... Just perhaps someone that can copy and paste some code from a similar project that they have done so I understand how to do it.
You could have simply put here's a tutorial for how to use TweenLite to crossfade between four pages, and here's one that will let you pass information between two .swf files. If you recently watched the tutorials then it wouldn't take long to find them (maybe you have them bookmarked) and post a couple links.
Anyways, I just found an excellent tutorial on how to crossfade using TweenLite (found here) and an article that explains how to pass information from one .swf to another (here). It took some searching and knowing exactly what I was looking for to find them, but that's a much better answer for someone looking to do those two things than I've found here (or elsewhere for that matter). -
Passing variables from one swf to another
I am facing problem to pass variable from one swf to another.
I am using loadMovie to load another swf. how can I pass a variable
value to another swf. Can anyone help me plz? It is somewhat
urgent.
thanx in advance.first of all:
this is the Flash Media Server and your problem is not
related to FMS....
second thing related to the "somewhat urgent" :
we, users on this forum, are not there to do your job... so
calm down otherwise no people will answer your question. This forum
is a free support forum that community of Flash developer use to
learn tricks and to solve problems.
Possibles solutions:
If the two swf are seperate you can use LocalConnection to
establish a connection between different swf.
If you load a second swf into the first one you can interact
like a standard movieClip(only if there from the same domain or if
you a policy file on the other server)
You can use SetVariable(via Javascript) to modify a root
variable on the other swf and check with an _root.onEnterFrame to
see if the variable had changed in the second swf.
* MovieClipLoader will do a better job, in your specify case,
than the loadMovie. Use the onLoadInit event to see when the swf is
really totaly loaded into the first one otherwise you will have
timing issues.
My final answer(lol) is the solution 2 with the
notice(*) -
How to replace one variable with another in large number of queries
Hello guys!
I have this situation: our company needs to use one variable instead of another for certain amount of queries.
Is there some way to automatically replace one variable with another for a certain characteristic in big number of queries ( like 150 - 200 ) ? Doing this manually would take lots of time)
Apreciate your help!you could try (at your own risk) the following:
1. search the technical id (ELTUID) of your variable in table RSZELTDIR
2. see where this variable is used in table RSZELTXREF (by filling RSZELTDIR-ELTUIID in RSZELTXREF-TELTUID)
3. add similar entries for your new variable
4. delete the entries for the old variable (they're part of the key, so you can't simply "change" them) -
How to call one .SWF from another?
How do I call one .SWF from another. I built a very beefy
base .SWF, and want to add music overlay, and an intro slide show
to the exsting Flash animation, but put it in a second .FLA/.SWF
file. How do I call one from the other?
This will be embedded in an HTML file but I assume this is
superfluous to my question.
F.Z.I think you should open that Another SWF (FLA),
and add some actionscript..
For example, you could create a movie clip, and write
actionscript in the
first keyframe:
loadMovie("
http://www.somewebpage.com/movie.swf",
this);
"FredZimmerman" <[email protected]> wrote in
message
news:ftnjas$mj5$[email protected]..
> How do I call one .SWF from another. I built a very
beefy base .SWF, and
> want
> to add music overlay, and an intro slide show to the
exsting Flash
> animation,
> but put it in a second .FLA/.SWF file. How do I call one
from the other?
>
> This will be embedded in an HTML file but I assume this
is superfluous to
> my
> question.
>
> F.Z.
> -
I don't know if this can be done but here it goes. I have 2
flash anamation on my site. Both have several scenes in them. My
question is? When linking over from one swf. to another. Can you
script it to start at a specific scene or must you start at the
begining of the swf.
Thanksfrom the loaded swf's main timeline:
MovieClip(parent.parent)
will reference the timeline to which the swf's loader has been added. so, to reference a variable (eg, scoreVar) on that timeline, use:
MovieClip(parent.parent).scoreVar -
When I merge one project with another, Aperture 3 randomly scrambles the photos of the project being merged, instead of keeping them in the chronological order that I shot them in. What can I do to correct this?
The photos have just been dumped into a new home and need to be told how to be arranged. Go to the top left of the browser view for the merged project and select the desired sort order from the drop-down and they'll all sort according to that setting.
-
Is there any way to pass value from one SWF to another ?
I am doing project using flash, now I cant pass a value from one SWF to another, is there any way to pass value from one SWF to another.
thanksHi,
Just to confirm here do you simply want to communicate between two SWFs without involving Flash Media Server. If this is the case one good way of doing it is to use a local connection. It can be used for direct communication between two separate instances of the flash player. However if you want to involve multiple clients sharing a common variable then you may have to use Shared Object for this. Please let me know what is the actual use case, is it multiple clients sharing a common variable or different player instances communicating between themselves.
Thanks,
Abhishek -
How to merge one swf to another
Hi,
I want to merge two swf file in to a single swf file, how i
can achieve that , since i have done some part of my project
modules in cairngorm framework and other parts of module i have
coded with out using any frame work, intern both the module
generates separate swf file, i just want to merge these two swf
files in to single swf file so that i can get whole project in a
single swf.
Regards
KumarTo have one application SWF load another application SWF, use
the SWFLoader component. If you have in fact created Flex modules,
then use ModuleLoader component. -
How to communicating one application with another?
I wanted to make a web site that have the ability to view,update,insert and delete record in a database. How to do that? How can one application communicate with another? example, I wanted to have XHTML communicate with Java and Java to communicate with my database that is pointbase database.
Multi-tier application communication is a somewhat complex matter. It may be made using differents techniques and designs. But like Sum-shusSue said, a typical Java-based solution would use these Java technologies: JSP (Java Server Page) for the presentation side (the client), Servlet or EJB (Enterprise Java Bean) for the server-side logic. The communication with the Database is made through JDBC.
I suggest that you take a look at the J2EE edition of Java. That stands for Java 2 Enterprise Edition and it is specifically made for enterprise system development, such as Servlet, JSP, EJB, etc...
This is a whole lot of new subjects and, from my humble experience, it is not that easy. i.e. I would not recommend it for strict newbies. However, if you have some months of Java coding on your side, maybe you should take a look. You can check first the left menu of this site, you'll find, under Technologies the sub-menu J2EE. There's also, somewhere on the site, tutorials on differents J2EE topics. Finally, I would recommend you this book:
Professional Java Server Programming, J2EE 1.3 Edition, edited by Wrox. Of course, there a lot of other books on hte market. J2EE is a hot topic!
Hope this help...
Simon -
Stepping through a query result set, replacing one string with another.
I want to write a function that replaces the occurance of a string with another different string. I need it to be a CF fuction that is callable from another CF function. I want to "hand" this function an SQL statement (a string) like this: (Please note, don't bother commenting that "there are eaiser ways to write this SQL..., I've made this simple example to get to the point where I need help. I have to use a "sub_optimal" SQL syntax just to demonstrate the situation)
Here is the string I want to pass to the function:
SELECT
[VERYLONGTABLENAME].FIRST_NAME,
[VERYLONGTABLENAME].LAST_NAME,
[VERYLONGTABLENAME].ADDRESSS
FROM
LONGTABLENAME [VERYLONGTABLENAME]
Here is the contents of the ABRV table:
TBL_NM, ABRV <!--- Header row--->
VERYLONGTABLENAME, VLTN
SOMEWHATLONGTALBENAME, SLTN
MYTABLENAME, MTN
ATABLENAME, ATN
The function will return the original string, but with the abreviations in place of the long table names, example:
SELECT
VLTN.FIRST_NAME,
VLTN.LAST_NAME,
VLTN.ADDRESSS
FROM
LONGTABLENAME VLTN
Notice that only the table names surrounded by brackets and that match a value in the ABRV table have been replaced. The LONGTABLENAME immediately following the FROM is left as is.
Now, here is my dum amatuer attempt at writing said function: Please look at the comment lines for where I need help.
<cffunction name="AbrvTblNms" output="false" access="remote" returntype="string" >
<cfargument name="txt" type="string" required="true" />
<cfset var qAbrvs=""> <!--- variable to hold the query results --->
<cfset var output_str="#txt#"> <!--- I'm creating a local variable so I can manipulate the data handed in by the TXT parameter. Is this necessary or can I just use the txt parameter? --->
<cfquery name="qAbrvs" datasource="cfBAA_odbc" result="rsltAbrvs">
SELECT TBL_NM, ABRV FROM BAA_TBL_ABRV ORDER BY 1
</cfquery>
<!--- I'm assuming that at this point the query has run and there are records in the result set --->
<cfloop index="idx_str" list="#qAbrvs#"> <!--- Is this correct? I think not. --->
<cfset output_str = Replace(output_str, "#idx_str#", ) <!--- Is this correct? I think not. --->
</cfloop> <!--- What am I looping on? What is the index? How do I do the string replacement? --->
<!--- The chunck below is a parital listing from my Delphi Object Pascal function that does the same thing
I need to know how to write this part in CF9
while not Eof do
begin
s := StringReplace(s, '[' +FieldByName('TBL_NM').AsString + ']', FieldByName('ABRV').AsString, [rfReplaceAll]);
Next;
end;
--->
<cfreturn output_txt>
</cffunction>
I'm mainly struggling with syntax here. I know what I want to happen, I know how to make it happen in another programming language, just not CF9. Thanks for any help you can provide.RedOctober57 wrote:...
Thanks for any help you can provide.
One:
<cfset var output_str="#txt#"> <!--- I'm creating a local
variable so I can manipulate the data handed in by the TXT parameter.
Is this necessary or can I just use the txt parameter? --->
No you do not need to create a local variable that is a copy of the arguments variable as the arguments scope is already local to the function, but you do not properly reference the arguments scope, so you leave yourself open to using a 'txt' variable in another scope. Thus the better practice would be to reference "arguments.txt" where you need to.
Two:
I know what I want to happen, I know how to make it happen in another programming language, just not CF9.
Then a better start would be to descirbe what you want to happen and give a simple example in the other programming language. Most of us are muti-lingual and can parse out clear and clean code in just about any syntax.
Three:
<cfloop index="idx_str" list="#qAbrvs#"> <!--- Is this correct? I think not. --->
I think you want to be looping over your "qAbrvs" record set returned by your earlier query, maybe.
<cfloop query="qAbrvs">
Four:
<cfset output_str = Replace(output_str, "#idx_str#", ) <!--- Is this correct? I think not. --->
Continuing on that assumption I would guess you want to replace each instance of the long string with the short string form that record set.
<cfset output_str = Replace(output_str,qAbrs.TBLNM,qAbrs.ABRV,"ALL")>
Five:
</cfloop> <!--- What am I looping on? What is the index? How do I do the string replacement? --->
If this is true, then you are looping over the record set of tablenames and abreviations that you want to replace in the string. -
Load one swf after another?
Hey!
I've created a presentation in Flash that exceeds the maximum number of frames. I broke it up into a few different files, and now I need these .swfs to load one after another automatically, without prompting or clicking anything on the screen.
The presentation is for an interpretation program at work and will be played for an audience several times a day. It was originally a 6-slide-projector presentation that I simplified, and this is the last step to replacing the old projection system altogether.
Does anyone know how to solve my problem, as simply as possible?
Thank you!you'll probably want to load them all at the start of you presentation so they're ready for display without waiting.
so, use standard preloader code to load your swfs. use a loop or dispatch an event to detect when one ends and another needs to start. -
Universally replace one character with another and then change font
Hello,
I have a geologic map file where there are hundreds of labels like Cc, Cz, Cwu, etc... all in the Arial font. I need to change all of the capital C's with a character from the StratagemAge font. That is to say, I need to find all instances of one character in my file and then replace them with another character and then change the font of that selected character.
I've been trying to figure out how to write an action to do this, but I was wondering if there is a way to do this easily already.
Any suggestions?
Jeremy> how do you turn off the dialog for the Find/Replace in action palette?
At the left of each Action step is a square field. Mouse over it and the tooltip will read "Toggle Dialog On/Off".
> I got an action that I wrote to work, but it takes a button click for each instance in my file that I want to change. Would yours have that same drawback as that?
Yes, you would have to click each time to run the Action (or, you could assign a function key), but there would be no dialog to dismiss.
But you can pile several iterations of the same steps in the Action; so that one execution of the Action does ten replacements with one click, for example.
This would not be a particularly difficult thing to Javascript, but you are correct that scripting has a learning curve. This task is not something I would think often needed. Doing a few hundred replacements in a file, using an Action would not seem overly burdensome to me. But if it is a recurring need for you, it might be worth writing a script.
JET -
Controlling one embedded swf with another
I have a flash website where I am using the loadMovie()
function to load multiple swfs, buttons, etc. into my index.swf
file (so it is easier to update one component than the whole
movie).
I have a series of buttons (home, about, services, etc.) that
in are in a file called "buttons.swf" and are loading into
index.swf. I also have another button called "envelope.swf", which
brings up a screen for a "Tell a Friend about this Page" box. I
would like to have the "buttons.swf" files disabled when when the
"envelope.swf" button is clicked, but I'm not too sure how to go
about doing it BECAUSE it is called through loadMovie.
Can this be done? I know about using enabled=false/true, but
how can I use that when referring to an embedded swf?
Thanks!That's a very wise method of developing your website.
My group uses something like this:
var myComponent:MovieClip =
createEmptyMovieClip("myComponent", getNextHighestDepth());
this.loadClip(src, this.myComponent);
Then when you need to access a function or value in your
component, you just use standard dot notation:
this.myComponent.myFunction(values);
this.myComponent.button1,_width=220;
You can even embed components inside other components. -
Controling a loaded swf with another loaded swf
I have a blank stage with only AS that loads an swf
addChildAt(0) and a second one addChildAt(1). This works. When the
user interacts with (1) it calls another addChild (not indexed) and
possibly that one loads another, depending on the choices made by
the user. How can I get any of these to control that very first
child that was loaded at (0)? I have run out of ideas.
Some of the code:
(on the main swf, nothing on the stage, only code that loads
the next two)
addChildAt(pHolder, 0);
pLoader.load(pURLReq);
pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
pLoaded);
and for the second:
addChildAt(mHolder, 1);
mLoader.load(mURLReq);
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
mLoaded);
On the child of childAt(1), I have:
function replaceSWF(e:MouseEvent):void
pLoader = new Loader();
pLoader.load(new URLRequest("p.swf"));
pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
placeNewClip);
function placeNewClip(e:Event):void
removeChildAt(0);
addChildAt(e.target.content, 0);
If I use this exact same code from that very first swf, the
one that loads the first two external swfs, it works, but once I
put it on one of hte other loadeds and sub loaded swfs, I can't get
it to work. In the current state (0) it just makes everything on
the stage disappear, so I figured then using the index of (1) would
do it, but that or any other number results in absoluly nothing.
Help! I am really out of ideas here.
(the stacking looks like this) ---
sub second loaded SWF <==== needs to tell first loaded SWF
to unload then load a new swf at same index
second loaded SWF <==== loads the next one above
first loaded SWF <=== needs to be removed and another swf
loaded at the same index
mainSWF (loads two others) <=== code placed here works for
first loaded SWFKglad,
I tried your code and ran into some problems with stopping
the mc's, as the embedded mc's within the loaded swf need to stop
as well. I found the attached code to stop the mc's, but now am
having trouble with the sound objects.
Here's the issue, I used this:
this.soundPosition = currentMovie.loop1.position/1000;
this.currentMovie.loop1.stop();
... for the sound object stop commands and listed a new one
for each loop I was using. On the play button I started them back
up again. This all works, but when I start them up again they all
play, not just the one that is currently paused. Do you mind giving
me some guidance with the for (obj in mc) loop? My loop experience
is nil. What I want to do is have the code cycle through all of the
loops to see which one is playing, then store that information in a
variable, then pause and play the variable. Does that sound right?
Thanks again for the help!
-Sandy
Maybe you are looking for
-
Servlet calls to Oracle Report Server
I have an app server (oracle 9ias) which will be available to the public. However, I also have an oracle report server that produces pdf reports from an rdf template but the server will not be available to the public. How can I use JSP,java servlets
-
Need help with batch processing picture packages
Hi, I am having trouble batch processing picture packages is CS2. (Windows). I have hundreds of images that need to be processed into picture packages and would love to find a speedier way to do this. I know how to create an action. I know how to b
-
4G LTE (i mean, 1X) in Morgantown, WV
So, now AT&T has rolled out 4G in Morgantown. I also read that U.S. Cellular, a mediocre regional carrier at best, is rolling out 4G in Morgantown next month. And, where do we stand with Verizon's 4G LTE in Morgantown? Oh yeah, we don't have a clue b
-
ANN: XML Parser for Java Release 1.0.1.4
A new maintenance release of the Oracle Parser for Java is available for download. It has the following fixes and changes: Bug fixes for #893971, i.e XML parser cannot parse documents from InputStream; #900146 normalize() is wrong if the literal cont
-
I have got a problem!!!!! Hold button not working
My ipod is the ipod phota and my problem is that my hold button seems to have stopped working. It will move side to side but it remains locked no matter which side it is on. It is like it is frozen with it on lock mode so I cant restart it. If any on