Loading External Swf with Other Swf Dependencies
I'm trying to load an old project into a new project via swf. My old project had local external swf dependencies.In other words A.swf is the old project swf and it loads in B.swf and C.swf. I want to load A.swf into my new project. All the .swf file are local and will be loaded locally. Using the url and loader to load the old project's swf into the new project, I get an error that says that the stage must not be null. I have put A.swf, B.swf, and C.swf all within the same folder together in the new project. Is the correct approach? I'd like to know if this is even possible and if so how should I do it? Thanks in advance!
Hmm I don't believe I have targeted the stage. Here's my code below.
package ExergameShell.screens
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;
import feathers.controls.Screen;
import starling.core.Starling;
import starling.events.Event;
public class Leaderboard extends Screen
private var url1:URLRequest;
private var loader1:Loader;
public function Leaderboard()
addEventListener(starling.events.Event.ADDED_TO_STAGE, init); // necessary for all screens
private function init():void
url1 = new URLRequest("A.swf");
trace(JSON.stringify(url1));
loader1 = new Loader();
loader1.load(url1);
//Starling.current.nativeStage.addChild(loader1);
//loader1.contentLoaderInfo.addEventListener(starling.events.Event.COMPLETE, resetFPS);
private function resetFPS(event:flash.events.Event):void
Starling.current.nativeStage.frameRate = 60;
Similar Messages
-
How to load external DLLs with C++ interface in TestStand?
Hi,
Can you please let me know how would I load external DLLs with C++ interface in TestStand?
Regards.TestStand 3.x can only call static class C++ methods. TestStand cannot call methods on a C++ object because TestStand does not know how to enstantiate the C++ object. In TestStand 3.x, there is a online help topic called "Exporting Class Methods and Functions in Visual Studio .NET".
Scott Richardson
National Instruments -
Hello Readers,
I have been working on an application.
There is a login screen for the application, in one of the swf's I have been writing the login code, along-with communications with XML.
Now once the user has been validated, I want to redirect the user to some XYZ.swf file and close the login.swf file else if not then I have to display an error message.
The issue may sound simple, but I am a beginner at this.
I would be encouraged to explore my endeavors, if some one could help me out with it.
Thank You for reading.
Regards,
Jayesh SidhwaniAbsolutely! Yup, you got it! If you want to use a SWF with all its script and interactions, you have to put it in another place and treat it as an external URL. It has to be boss of its territory (I almost said 'domain' but of course it can be in the same domain).
Go navigateToURL() and you have no problems.
The problem is, we often want to load a SWF without navigating outside our main compiled SWF, and it's frustrating to find out that it loads but doesn't use its timeline code. When you want to do this, you should forget using a SWF and make the object an MC instead. -
Loading external png with transperancy
Hi,
Im trying to create an as3.0 navigation with a few buttons.
Each button is a png image.
When im importing images to the stage i dont have any transperancy issues but the problem is that they are not smooth enough, especially
because im animating them using TweenLite.
I thought that the only way to do it properly is to load all the images using as3 into bitmap objects and then use the smoothing property.
The problem is that everytime that i assign the png to a bitmap object i lose the transperancy information and i get a white background...
Anyone knows how can i keep the transperancy information from the png onto the bitmap object ?
ThanksHere's a bit of code that loads a png with transparency, smooths it, and places it on stage.
var a:Loader = new Loader();
a.load(new URLRequest("spider.png"));
a.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
function done(e:Event){
var bit:Bitmap = e.target.content;
if(bit != null){
bit.smoothing = true;
addChild(bit); -
How to load external photo gallery in swf file
hello!
i've been using flash catalyst beta to create a simple 100% flash portfolio site. you can view the test here: http://remgriff.110mb.com/
my problem is that i want to link a button from the portfolio page to an external swf file (or html, both are ok) and i cannot do that in flash catalyst (probably because it's in beta).
how can i achieve that? can it be done so the external swf opens in the portfolio page?
please help.Heya,
I believe you can embed the .swf file using flex code in flex builder. I just did a quick google search and came up with a few articles. I don't think there is a way to do this in Catalyst yet, but please correct me if I am wrong.
I am also building my portfolio in Catalyst as a little project and although there are some bugs I am really enjoying the Beta
Hope this helps!
Chris -
Load SMP.swf in other .swf and pass parameters to it
Hello,
I am able to load the StrobeMediaPlayback.swf within my main .swf application, but I have no idea how to mimic the flashvars behaviour : how can I provide it with the source of the video wanted, etc ?
ThxHi,
The preloader sample passes all the flashvar parameters to the loaded SMP class.
You should be able to give it the same flashvars you give to StrobeMediaPlayback.swf -
Load external image & text into SWF
Can someone point me to a tutorial on how to create a
template that will load an external image file,.css styled text
& a .css style sheet into a .swf by using .xml?
Thank you for your time.
CKYou can use the MovieClipLoader class to load multiple images sequentially (one at a time), but you wouldn't use a 'for' type of loop...instead you would use a recursive loop, where a loading function is called after each load completion until all loading in done. This is done by utilizing a load-complete listener to trigger loading of the next image. So you start the loading process by loading one file, when that file is determined to be loaded, the listener proceses that file in whatever way you need to prepared (resizing, etc) and triggers the loading of the next file.
If you look up the MovieClipLoader.addListener method in the Flash help documents there is an example there that uses the onLoadInit event. You would be wanting to use the onLoadComplete event. -
Controlling swfs from other swfs.
hi there. the site i've designed has a background layer, a
navigation panel layer(menu) and the content is loaded as separate
swf files on levels behind the navigation panel. to allow for
seamless unload of the content i want to control the transition
from the navigation panel layer.
eg. When the user clicks on "Story" button, the navi panel
layer communicates with the content layer (eg. Welcome page), tells
it to play from frames 50-60 and then unload. After this, the
desired content layer (in this case "Story") is loaded into, say
layer 5.
how do i go about coding this in actionscript? i'm slightly
bamboozled by the actual script for it and i'd really appreciate
some direction.If you load your movieClips into levels, you simply use those
levels to direct them, e.g. _level5.gotoAndPlay(50)
You can't tell a movieClip to play from frame 50 to 60 and
then stop. I mean you could, but judging from the question you ask
I guess you don't want to get into so much complexity.
You tell the clip to play, and the clip should know itself
when to stop. If you want to be a bit more flexible, you can set a
variable in the clip and check it at certain keyframes via
actionscript:
in the controlling clip:
_level5.stopFrame = 60;
_level5.gotoAndPlay(50);
And in the controlled clip in possible stop frames:
if(stopFrame == _currentframe) { stop(); }
You could enable this for every frame via an onEnterFrame
event handler.
Of course you need to tell the controlling clip to continue
in some way, e.g. by sending it to another frame....
This of course is very linear and old style programming, not
object oriented.
It would be better not to load into levels, but into named
movieClips at certain depths. This allows you to use the
movieClipLoader class, and program all that event-driven. -
Linux JVM: How to load shared libraries with mutual/circular dependencies
Hi,
I am using the API
System.loadLibrary(String name)
to dynamically link shared libaries to Linux JVM.
The shared libraries has complex circular symbol dependencies among them.
I am not able to load shared libraries due to java.lang.UnsatisfiedLinkError.
Any ideas on how a number of shared libraries with interdependent realtionships
could be successfully linked in to the Linux JVM?
Thanks,
Soumen.
Background
===========
Successful execution of native code within Java virtual machine in a
host platform, has two necessary prerequisites:
Prerequisite 1: The native code is written to the JNI specification
Prerequisite 2: The native code is dynamically linked with Java virtual
machine.
The second step is achieved via simple Java interface, System.loadLibrary:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#loadLibrary(java.lang.String)
However, implementation of this interface is highly platform dependent
in regards to exact nature of dynamic linking process.
Tests
=====
I made three shared libraries libfeatureA.so, libfeatureB.so and libfeatureC.so.
Feature A and Feature B are mutually dependent on each other (i.e cicular
dependencies between libfeatureA.so, libfeatureB.so) whereas libfeatureC.so
has no external dependencies.
Case 1
I could link libfeatureC.so with java.
Case 2
Java failed to resolve circular dependency between libfeatureA.so, libfeatureB.so
resulting in linking failure. There may be repackaging workarounds which I have
not yet explored.
Java source code
================
class TestLoadLibrary
static
System.loadLibrary("featureB");
System.loadLibrary("featureA");
System.loadLibrary("featureB");
public static void main(String[] args)
System.out.println("In TestLoadLibrary.main()");
Exception in thread "main" java.lang.UnsatisfiedLinkError: /homes/soumen/work/event/featureB/libfeatureB.so.1.0: /homes/soumen/work/ev B.so.1.0: undefined symbol: featureA_func2
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1737)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1662)
at java.lang.Runtime.loadLibrary0(Runtime.java:817)
at java.lang.System.loadLibrary(System.java:986)
at TestLoadLibrary.<clinit>(TestLoadLibrary.java:5)The use of "dlopen() application programming" to achieve dynamic link closure works if there are
no circular dependencies. For example, I have the following dependency:
libfeatureD.so ==> libfeatureC.so
Even if I call Java APIs in correct dependency order, i.e.,
System.loadLibrary("featureC");
System.loadLibrary("featureD");
there would be java.lang.UnsatisfiedLinkError for call System.loadLibrary("featureD").
Now, I have a JNI method implementation, which makes native API call in same dependency order:
dlopen("libfeatureC.so", RTLD_LAZY|RTLD_GLOBAL);
dlopen("libfeatureD.so", RTLD_LAZY|RTLD_GLOBAL);
and now System.loadLibrary calls succeed. Note that I had to set environment
variable LD_LIBRARY_PATH so that dlopen call would find libraries to load.
In other words, from a JNI programming point of view, "linking chasm" has been crossed.
I am looking at circular dependency issue, i.e.,
libfeatureA.so <==> libfeatureB.so
There may be library repackaging workaround.
If anybody knows any workaround, please post.
-Soumen Sarkar
JNI code
========
#include <jni.h>
#include "TestLoadLibrary.h"
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
JNIEXPORT void JNICALL Java_TestLoadLibrary_libLoadNative
(JNIEnv * jenv, jclass class, jobjectArray libNames)
printf("native: In TestLoadLibrary.libLoadNative()\n");
char linuxLibName[1024];
jsize idx = 0;
jsize nLibs = (*jenv)->GetArrayLength(jenv, libNames);
for(idx = 0; idx < nLibs; ++idx)
/* obtain the current object from the object array */
jobject myObject = (*jenv)->GetObjectArrayElement(jenv, libNames, idx);
/* Convert the object just obtained into a String */
const char libName = (jenv)->GetStringUTFChars(jenv,myObject,0);
strcpy(linuxLibName, "lib");
strcat(linuxLibName, libName);
strcat(linuxLibName, ".so");
printf("\nnative: Trying to open lib with name %s\n", linuxLibName);
void* handle = dlopen(linuxLibName, RTLD_LAZY|RTLD_GLOBAL);
if(handle == 0)
fputs ("\nnative: Could not load lib\n", stderr);
fputs (dlerror(), stderr);
else
printf("\nnative: Loaded lib %s\n", linuxLibName);
/* Free up memory to prevent memory leaks */
(*jenv)->ReleaseStringUTFChars(jenv, myObject, libName);
return; -
How to use SQL*Loader to load XMLType Column with other columns?
Hi,
I am trying to use sqlldr to load an XML file into a table with an XMLType column. I have found plenty of examples where the entire table is an xmltype, but I would like to load many XML objects into a generic table for processing with one XMLType column and many other columns to identify the load. As a simple example, I have one constant column which I want to set during the upload.
The following example does not work :(. No errors either.
create table xml_upload
(upload_type varchar2(10) not null,
xml_data XMLType)
my control file:
LOAD DATA
INFILE * append
INTO TABLE xml_upload
XMLType(xml_data)
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
upload_type constant MARKET,
xml_data
BEGINDATA
<SALE_ORDER>
<CUST_CODE>TIM</CUST_CODE>
<ORDER_NUM>1234></ORDER_NUM>
</SALE_ORDER>
$ sqlldr my.ctl
SQL*Loader: Release 10.2.0.4.0 - Production on Sun Sep 27 22:51:52 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Commit point reached - logical record count 4
SQL> select * from xml_upload;
no rows selected
SQL>
Any ideas on how I can do this? Am I missing something...
I have also been playing with the lobfile clause of sqlldr, also without any success...
Current database version is 10g R2.
Thanks,
Tim.Hi,
I tried the same example as it is. but, I am getting the following error:
SQL*Loader-350: Syntax error at line 6.
Expecting valid column specification, "," or ")", found "filler".
,file_name char(100) fillerThe table I created is:
create table xml_upload
(upload_type varchar2(10) not null,
xml_data XMLType)The control file I used is:
LOAD DATA
INFILE *
INTO TABLE xml_upload TRUNCATE
upload_type constant 'MARKET'
,file_name char(100) filler
,xml_data LOBFILE (file_name) TERMINATED BY EOF
BEGINDATA
test.xmlThe database I am using is 10gr2 -
Error 2330 after trying to load 8.1 with other message prior to that.
Help, I have tried all the messages I have read! I unistalled Itunes, uninstalled Quicktime, tried to load earlier version 8.0 to no avail (even 7.0)!
My system will go in a circle and will constantly try to load 8.1 even after I say cancel. If I didn't love my Ipod I would post nasty messages about Apple software!
The good news is if I connect my Ipod it appears to open Itunes (I can only assume the Itunes is from my Ipod) It will sync then close Itunes, I cannot stop any activity.
How can I start over with an evenealier Version? I did try but I get this error message just before Error 2330 that States "unable to create ......\mobile device\bin or something like that. When I look at files I see or should say , saw that directory now It would appear nothing works.
Do I have to wait for 8.5 until this is fixed? I run windows XP, and tried both versions 64bit and the xp. I miss my Itunes and my 16gig of music.Ok IT IS NOW FIXED.
Here is what worked for me.
I think since I kept having a message "....\bin" I deceided to rename the primary folder C:\programs\common\apple\mobile device support. (xxxMobile device supportxxx).
I removed all programs ( Itunes updater, Quicktime, safari) using windows add / remove programs. I then emptied recycle bin. I shut off my Dell ,then turned back on.
I then installed the 32 bit XP version, and it is now working. -
I downloaded Malwarebytes to run a scan of my system. After it had detected some threats, It removed/quarantined all the threats it had found. I use Firefox & have been happy with it & have the latest version - 25.0.. I have since uninstalled it but my system loads very slow & all programs are affected including videos, etc.. The system was fine before this was done.
I have/had this exact problem -I just restored everything that Malwarebites "quarantined" (an option within the program), and it honestly seems better already. My wireless network connection was even restored and is working well again (after running Malwarebites the connection wouldn't automatically connect after sleeping as it did before).
My guess is, Malwarebites isn't so good at differentiating good from bad.
I've only been running the PC for about 20 minutes since restoring everything, but I've noticed improvements in everything (especially boot up). I'll update this if my results change, but as of now it seems to have fixed the problem.
*update -after restoring the quarantined items and removing the program from my PC everything seems to be running at it's original speed. Firefox, Photoshop, and Dreamweaver are all opening and running at near instant speeds (as they originally did). -
Preload main swf with another swf
Hey everyone,
I have two swf files, one is a preloader and the second is
the main file. I want to preload the main file using my preload
swf. It works, however the main swf starts to play after about 11%
of it is preloaded, how can i stop this? I want to preload the
entire main swf and then have it play. Here is the code i'm using
in my preloader swf. Or if anyone can tell me another way, anything
that will work at this point! I'm fairly new to this so any help is
much appreciated. I need this asap so anyone that could help,
please do! Thanks in advance!!insert a blank frame before your current 1st frame in your
main swf and attach a stop() to that frame.
in your preloader use: -
Loading external HTML with global context attributes
I am trying to use Google Finance to load a stock quote in an HTML tile.
In the Mosaic 9.5 samples the tile uri is http://www.google.com/finance?client=ob&q=${application.symbol}. This does not load the iframe in my CAF project.
In fact, I tried configuring my .cxml as
http://www.google.com/finance?client=ob&q=ADBE
http://www.google.com/finance?q=ADBE
http://www.google.com/finance
but none of these uri’s loads the iframe. The only uri that does load successfully is
http://www.google.com
What am I missing?
SteveThe Brokerage example in the Concepts sample package for ES3 now
uses a different finance website due to a change made to the Google finance site. -
Trouble figuring out pathname for embedded swf loading external swfs & xml
I have a swf that loads content from an XML file. This works fine when everything is in the same directory, but I want this swf to appear in several different HTML pages, which are in several different directories and I don't want to have to put 8 different copies of my swf online just so that they load properly. The directory structure is like this:
main_dir:
mod_dirmod01_dirmodcontent_dirmyembeddedswf.html
myflash_dirsub1
sub2:
myflash.swf
myflash.fla (not uploaded to the server)
xml_dir:myxml.xml
I created "sub1" and "sub2" just so that my swf would be the same number of directories downwards as the html has to link upwards, so that when I test the source file, it works. For the HTML, it's embedded like this (using swfobject):
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="800" height="500" id="../../../myflash_dir/sub1/sub2/myflash">
<param name="movie" value="../../../myflash_dir/sub1/sub2/myflash.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="../../../myflash_dir/sub1/sub2/myflash.swf" width="800" height="500">
<!--<![endif]-->
<div>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
And inside the Actionscript, I have a URL like this to load the XML:
../../../myflash_dir/sub1/sub2/xml_dir/myxml.xml
Testing the .fla works. But the swf does not work in the HTML. myflash.swf loads, but the loading animation spins and spins, so presumably myxml.xml is not loading. Can anyone see what I'm doing wrong?Durrr, this is not the first time I've answered my own question. Maybe something about trying to explain it to someone else lets my brain make the critical connection.
Anyway, yes it was everything to do with the external SWFs being loaded. My main swf actually loads an xml containing URLs from which to load all of the other SWFs and so I had to update the URLs inside of that, and that fixed the problem.
Sorry for wasting forum space, but maybe this will help someone else out!
Maybe you are looking for
-
Hi, Initially I had a BI Publisher 10.1.3.4.0 in OAS 10.1.3.4.0 that I sorted out from Oracle_Home\config\ias.properties file Then my clients were facing an issue with the View Button, when u'd want to print or generate reports in whichever available
-
Location of JNet TypeRepository
Hi, I would like to use the UI element Network (JNet API). To define the elements of the type repository your can create a file called "TypeRepository.xml", and provide a link to this file in the data file using the attribute "href" of the tag "TypeR
-
I can't open firefox from the firefox icon. I'm getting this error: /';0o
-
Backwards Compatability of iWeb?..Problems
On my main mac pro, I have all the latest updates of software etc. and my new iweb site (which is published but not yet launched) works great in Firefox and Safari. BTW..I'm still in the 60 day trial period. On my older mac at my other desk, I'm runn
-
Hi, I can not open any file because of this error : "impossible d'importer le presse-papiers en raison d'une fin de fichier inattendue" litteraly I suppose: "impossible to import the clipboard because an unexpected end of file" at the launch of Photo