Flex :: How To Get Embedded SWF To Interact With Project Assets

Jan 13, 2011

I have a Flex project in which I am embedding a Flash SWF containing an image viewer. The SWF file I'm embedding is supplemented by an XML file, which contains a list of images to show, and an images folder containing the images. The problem I'm running into is that the embedded SWF file is unable to load the pictures. I am able to see the forward/backward navigation buttons, but there are no loaded images. When I view the SWF file outside of the Flex project it works fine. Is this because Flex isn't allowing the SWF to reach outside and access other project assets?

Here's my code for embedding the SWF:
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
[Code] .....

View 2 Replies


Similar Posts:


Actionscript :: Embedding Flash Assets In Flex Project?

Jan 28, 2010

I'm creating a project in flex builder but it's not using the flex framework, it's just pure actionscript.

At the moment I have some bitmap resources embedded for drawing things, but I'd like a little animation and thought I could create swf animations for them in flash and use the [Embed()] thing to embed them in the actionscript project.

This works perfectly well for me, however I'm a little concerned about efficiency and how well this approach will scale when my project gets larger.

Does anyone know if there are any efficiency implications to embedding maybe 20 or 30 swf files, or do they get efficiently integrated into the main swf file? Most of the animations are really simple and I could probably redo them in actionscript if needed but it's a lot easier just to draw them in flash and embed them.

View 1 Replies

Actionscript 3 :: Use Timeline Scripting On Embedded SWF Assets W/ The Flex SDK?

Sep 11, 2009

I've embedded a SWF into a class using this syntax above my class definition:

[Embed (source='/../assets/MyMovieClips.swf', symbol='SpecialMovieClip')]
public class SpecialMovieClip extends MovieClip

The MovieClip asset seems linked with my class okay, and instantiates along with it, and is visible, but:

I can't access instances placed on stage within that clip. The timeline scripting seems non-functional.

Is this the drawback of embedding SWF files at compile-time with the Flex SDK? So, maybe I should just go back to compiling with the Flash IDE if I want timeline scripting or instances positioned on-stage?

View 2 Replies

Flex :: Does Compiler Automatically Optimize Embedded PNG Assets?

Jun 29, 2010

I was trying to further reduce the filesize of a SWF file by optimizing the embedded PNG graphics (using ImageOptim tool). To my surprise, this didn't yield any effect, so I created two test Images:

Original (433883 bytes)
Optimized (273723 bytes)

When embedding either of these assets in a simple ActionScript project, the compiled SWF is ~274kb in size. Which raises the question: Does Flex optimize embedded PNG assets during compile-time? If yes, is there some documentation about the optimization going on? It can't be because of the SWF compression alone, because zipping the images doesn't reduce filesize at all.

Here's the Code for completeness:
package {
import flash.display.Sprite;
public class SizeTest extends Sprite {
[Embed("/assets/original.png")]
private var ImageAsset:Class;
public function SizeTest(){
}}}

View 2 Replies

Flex :: Asdocs Seems Unable To Find Embedded Assets?

Jul 25, 2010

I'm running asdocs from a .bat file with flex sdk 3.2.0 (I have replaced my long project root folder with PROJECTROOT):"C:Program Files (x86)AdobeFlex Builder 3sdks3.2.0inasdoc" -source-path . "C:Program Files (x86)AdobeFlex Builder 3sdks3.2.0" "_PROJECTROOT_Componentssrc" "C:\_PROJECTROOT_assets" -doc-sources .PAUSE"Unforunately, I keep getting errors similar to this:"_PROJECTROOT_assetsstyles.css(344): Error: Invalid Embed directive in stylesheet - can't resolve source 'Embed(source = "close_button.png")'.downSkin: Embed(source="close_button.png");"I really don't understand this as "close_button.png" is in the same folder as styles.css. When I build the project from within flexbuilder, it compiles it fine and does not throw any errors.

View 2 Replies

ActionScript 3.0 :: Preload Project, But Wait For Said Project To Load External Assets?

Jun 15, 2009

I am working on this one project that has a couple of movieclips (already placed on stage) which have a custom class set to export via the Library. Each of those custom classes loads an external SWF using URLRequest().

Is it possible (or, what is the best way) to preload the whole project first, including the external SWFs?

View 7 Replies

ActionScript 3.0 :: Interact/communicate With An Embedded SWF?

Nov 13, 2010

I'm programming my game using Flash Builder 4, in an "ActionScript project". I'm not using Flex. I want to build my menus and cutscenes in Flash Professional, then export them as SWF and embed them into my final project.Embedding the SWFs works fine, I do something like this:

Code:
[Embed(source = 'test.swf')] private var SwfClass:Class;
var myMovieClip:MovieClip = new SwfClass();
parent.addChiled( myMovieClip )

My problem is that I can't access the buttons and other elements of the SWF that I need to communicate with and manipulate. For example, the main menu will have a "Play" button. I need to know if that button has been pressed. The level select screen will have a "Best Time" text field, that should show the player's best time on a level - this text needs to be set. But I can't figure out how to access these things.

I don't think that the children of the MovieClip are visible within my Actionscript project - it seems like the SWF is loaded in as one big "chunk" that can't be interacted with (it plays fine though).So what is the best way to interact/communicate with an embedded SWF? I've found a bit of information on the topic, but usually people are talking about using Flex or loading in external SWF (which seems to behave different from embedding). Is there even a way to do this?

View 3 Replies

Actionscript 3 :: Flash - How The Kernel Could Interact With An Application When Creating A Project

Mar 8, 2012

Im learning flash actionscript at a local college and have been asked to find out 3 ways how the kernel could interact with my application when creating an actionscript project.

EDIT: The Kernel is a class that is being linked to the swf. Weve been asked to find out how the Kernel can effect and interact with the application. This is the class thats been created:

public class kernel extends MovieClip
{
public function kernel()
{

[code]....

View 1 Replies

IDE :: Impossible To Have The Embedded Flash Interact With Other Portions Of The HTML?

May 8, 2010

I'm considering taking on a new project for myself - nothing particularly major - but I've a few questions that I'm certain anyone with some serious experience with Flash might be able to answer for me or perhaps (hopefully) guide me in the right direction for alternatives.

So I have an idea for a horizontal menu that I want to design using Flash (I've only experience with AS3 - odd as that is? - so that'll be how it'll be designed). As I'm coming to understand it's difficult/impossible to have the embedded flash interact with other portions of the HTML, so for every time that a menu item is clicked, is the only way to go about moving to that page just having the entire page effected - ie each page (home, port, etc) has to also include the embedded flash as well, or can I just have it affect some subwindow or section of the page, instead?

View 3 Replies

ActionScript 3.0 :: SWC With Embedded Assets?

Jan 27, 2010

I used to be able to create distributable components in AS2 (swc files) containing class code and assets (movieclips). And it used to be really easy.Now I am struggling with Flash CS4 and AS3 and all my attempts were frustrating, as no matter what I try it simply doesn't work. I am starting to assume that maybe it is not possible anymore to do in AS3? Maybe this kind of thing is deprecated in Flash now???

Let's see what I have tried:

1) I started with a new FLA and named it 'MyComponent.FLA'. Then I drawed a green square, converted it to a mc and named it as 'MySquare'. Then I tagged 'Export for ActionScript' and 'Export in Frame 1'. Then I named the class as 'MySquare' and set the base class to 'flash.display.MovieClip'. This is my asset (a green square movieclip).

2) Created an empty movieclip and dragged the asset within it. Then I named it as 'MyComponent'. Then I tagged 'Export for ActionScript' and 'Export in Frame 1'. Then I named the class as 'MyComponent' and set the base class to 'flash.display.MovieClip'.

3) Right-clicked it in the library and chose 'Component Definition'. Then in class field I typed 'MyComponent' and tagged 'Display in Components Panel'.

4) Crated a new AS file, called it 'MyComponent.AS' and typed the following code:

Code:
package {
import flash.display.MovieClip;
public class MyComponent extends MovieClip

[code]....

5) Back to 'MyComponent.FLA', right-clicked the 'MyComponent' object in the library and chose 'Export SWC file'. That was ok, no warnings, no errors. Then I just copied this new SWC to my components folder.

6) Created a new FLA and named it 'test.FLA'.

7) Reloaded the components panel, and my new component showed up. Then I dragged it into library.

8) Then I type the following code:

Code:
var test:MyComponent = new MyComponent();
trace (test.visible)

9) I ran the new app and it was ok, no errors and no warnings. The trace statement spit out 'true' what means that the new class is really there, but... I cannot see the green square. But when I click onto the 'MyComponent' in the library, the preview shows up the green square, what means that it IS THERE in the component. So, why it doesn't show up in the stage after the class be intantiated?

View 4 Replies

Actionscript 3 :: Embeding Assets(images) In Project?

Sep 16, 2011

I am using flex sdk 4.5.1 and flash develop to compile my AS3 project. I have small images, about 12KB which is silly to load them using Loader class, so embeding is better solution.

However when this line at the top of my Main class is uncomented i get blank swf[URL]..(when i comment it out, the compilated swf is ok)

What could be the error. Why do I get the blank swf?

View 2 Replies

ActionScript 3.0 :: Embedded Swf Not Loading Assets?

Oct 3, 2011

I have a site that contains a page with a fancybox pop up which contains a .swf.This swf loads a sound file and a thumbnail (mp3 and jpeg). When I view this by double clicking the swf it works fine, when I navigate directly to the swf in the browser it works fine, however when I try to view the embedded swf it does not load the jpeg or the sound file. I have another page which does the exact same thing except it loads a different swf which only loads a video file and this works perfectly.

AS3 code :

Code:
package www.elementalstudios.co.za {
import flash.display.Sprite;[code].....

Where the $theInner is a javascript variable that is used to set the innerHTML value of the div that I want to have containing the swf and $jUrlArray is an array of filepaths to various folders containing different sound files and thumbnails (each folder also contains the swf).The thinking is that the swf looks for the files as "sound.mp3" so the swf would assume that file is in the same folder it is in, therefore I'm only loading the swf from the different folders.

View 1 Replies

AS3 :: Flash Using Custom Graphical Assets In Pure Project

Mar 27, 2011

I created some button states in flash (swc), and I want to use them in a pure AS3 project. They are movie clips with class of neatButton_on and neatButton_off respectively. I call them like this:[code]I've also used assets, especially for different states of the same item, where I've put everything in one movie clip and then switched frames as needed. Is one way faster than the other? is there a best practice?

View 2 Replies

Actionscript 3 :: Clear Out Embedded Bitmap Assets In AIR?

Mar 15, 2012

I'm creating an AIR 3.0 app.

For a lot of my graphical assets I'm using the Flex embed metadata to embed bitmap objects as Classes and then instantiating them.

The problem is that it seems these never get garbage collected. I haven't found much info online but I've seen a couple of posts that seem to confirm this.

Anytime one of my classes gets instantiated that has these embedded assets, they always create new instances of the Bitmaps and BitmapDatas rather than reusing what's already in memory. This is a huge problem for memory. And I can't find any way of de-referenciong them or getting them to leave memory.

So the only solution I can think is to just load the graphics from disk rather than using the embed tag. But I'd rather not do this seeing as how when the app is packaged and installed, all of those graphcial assets will be on the end users computer rather than contained within the SWF.

View 2 Replies

ActionScript 3.0 :: Executing Code Before Loading Embedded Assets?

May 27, 2011

Is there a way to execute code (like a preloader) before loading the embedded assets? I'm using the [embed] tag with CS5, and I'd like to avoid using an external preloader.

View 9 Replies

Actionscript :: Use Embedded Images In FlexLib Project?

Jan 14, 2011

I have a FlexLib Project with a embed class:

package
{
public class EmbedAssets
{

[code]....

And I have another Actionscript Project that use this FlexLib Project and add the Visual class on stage:

package
{
import flash.display.Sprite;
public class AsTest extends Sprite

[code]....

The image don't show up, just.I had debug the application and found the bitmapData of aa was NULL. But if I implement out of Lib Project, this work!In properties of projects ai tried a lot configurations on Flex Library Build Path -> Classes / Assets. But none work correctly.

View 2 Replies

Professional :: Loop A Video That Embedded Into A Flash Project?

Jan 14, 2011

I have a video that I've embedded into a project by means of linking it from my server, where it lives (not embedding it into the actual project) and I cant for the life of me find a way to get the video to continually loop when it finishes. Any looping meathod I've found so far using AS3 only loops the basic animations in the movie, not the video.

View 1 Replies

Android :: Convert Flex Mobile Project To Flex Web Project?

Jun 29, 2011

I have a flex mobile project and I want to convert it into web-based project. What is the best way to do it.

View 1 Replies

Flash :: Professional - Embedded Component In Silverlight Application(ASP.NET Project)?

Mar 18, 2010

I am ASP.NET developer & wright now I am working on Silverlight project. SinceSilverlight has few drawbacks like we can get Clipboard IMAGE data using silverlight application(however we can access Clipboard TEXT data from Silverlight), but this is not an issue with flash. We can access to clipboard image as well as text data using flash.

[Code]...

View 4 Replies

Flex :: Interact With SWF Loader

Jul 7, 2009

I embedded a swf file in my application [code]now with the help of the flex documentation I wanted to interact with my loaded swf by creating a SystemManager.[code]But when starting the application the error#1034 occurs and says that Main__ embed_ mxml_mod_ VideoModule_ swf_856293516@33f53c1 could not be converted into mx.managers.SystemManager.

View 2 Replies

JavaScript :: How To Interact With 3D PDF From Flex

Feb 6, 2012

I'm working on a web application which displays a 3D model (Acrobat 3D PDF file) and allows users to interact with the model. I need to be able to communicate with PDF from the web page:
1) Programmatically highlight a node in the 3D PDF (given the node name) when, say, the user clicks on a list item referencing that node name in the web page
2) The reverse way, know which node the user selected in the 3D PDF so I can highlight that node name in the web page.

My questions:
a) The UI of my page is Flex. Is it possible to do this interaction directly from Flex?
b) If not, is it possible to do this from browser javascript? (which I will in turn call from Flex) I have seen an article on browser-pdf communication [URL] but am not sure if 3D objects can be accessed from external browser javascript.
c) Or does the Acrobat Reader ActiveX control expose methods to perform these operations from browser javascript?
d) Lastly, do folks have any recommendations based on their experience, on which 3D CAD viewer software integrate with browsers and enable this kind of interaction? (Apart from Acrobat 3D, I am evaluating a few such as 3DVIA Composer Player).

View 1 Replies

Flash :: Self Updating Air Application Assets Without Re-downloading Assets Already Downloaded

Feb 10, 2011

I want an air application to be able to update the assets it uses, but minimizing the download needed, so only downloading files added since it last updated.I'm thinking this would include a server portion which would zip the needed files based on a version number? Has anyone implemented anything similar / got any thoughts on the best approach to building this sort of system?

View 1 Replies

Flex :: Interact With Content Behind Transparent App?

Feb 23, 2010

I have a Flex application with wmode=transparent and a transparent section that allows whatever is underneath it on the HTML page to show through. In this case, what's showing through is another Flash application. This works fine, but I can't interact with the Flash application showing through.

I tried setting the z-index of the Flash app to something greater than my Flex app, and that worked, but unfortunately that solution doesn't work for my case because the Flex application has components that occasionally overlay in that area, and setting the z-index of the Flash app to be higher means those components are always stuck behind it.

View 1 Replies

Flex Can't Interact With Button In Itemrenderer

May 28, 2010

I have a list with a itemrenderer. When I put a button in the itemrenderer I can not interact with it. If I rollover the button the list item rollover is triggered but not the button's rollover. I can't click on the button either. You can see below I have a click event set in the itemrenderer and it is not called on click when I run app. Must I override rollover and click methods of itemrender? Why is it such a pain to put a button in an itemrenderer?[code]...

View 1 Replies

Java :: New Project Created With Flex Mojo's Archetype Throws Cannot Find Parent Project-Maven Exception

Jun 15, 2010

Maven 2.2.1 unzipped,M2_HOME set and repository altered to point to different drive location in settings.xml Flex 4.0:

Installed Created a multi-modular webapp project using flexmojo:

mvn archetype:generate
-DarchetypeRepository=http://repository.sonatype.org/content/groups/flexgroup
-DarchetypeGroupId=org.sonatype.flexmojos
-DarchetypeArtifactId=flexmojos-archetypes-modular-webapp
-DarchetypeVersion=RELEASE

with following options

groupId=com.test
artifactId=test
version=1.0-snapshot

[code]....

Parent pom has swc, swf, war as modules.

Dependency is war->swf->swc.

With parent artifactId of swf, swc, war set to swf, swc, test respectively.On executing mvn on test folder(for that matter clean or anything) I get this following error.

G:Projects est>mvn -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/test/swc/1.0-snapshot/swc-1.0-snapshot.pom

[code]....

Looks like its trying to download the project from maven's central repository instead of building it.

View 2 Replies

Flex :: Dynamically Add Image Objects To Display And Then Interact With Them?

Jan 13, 2010

Below is sample code from a Module I have in my Flex app. I want to dynamically create mx.controls.Image objects and add them to the display. I want the user to be able to move them (this works as below) and be able to change their z-index as well as record new X and Y coords after moving back to the database. How do I determine which object in this.getChildren() is the 'selected' item the user is working with? When I add a MOUSE_OVER event, for example, it does not work.[code]

View 1 Replies

Embed SWF File In Flex And Interact With ExternalInterface Functions

Sep 1, 2011

I use a SWF file that exposes functions and events using ExternalInterface. Here is an example of an exposed function:
ExternalInterface.addCallback("myFunction", ExecuteMyFunction);

If I embed the file in an HTML page, I can access those functions using JavaScript. Now, I'm embedding that same SWF file dynamically in a Flex app using the mx:SWFLoader component, something like:
<mx:SWFLoader id="myLoader" source="[URL]" autoLoad="true"/>

I'm trying to access those exposed functions and events, but I can't find how to interact with those from the Flex app. I would like to be able to call a function just like from JavaScript, like:
myLoader.myFunction();
How can I access a function that is exposed by the ExternalInterface within Flex?

View 1 Replies

Actionscript :: Disadvantages Of A Flex Project Vs Project?

Oct 20, 2009

I've recently started making a game in FlexBuilder. The game is currently a Flex project. Is there any downside to using Flex as opposed to just Actionscript? A friend of a friend told me that Flex is slower than an Actionscript project. I've been unable to validate this on the internet; is there any truth to that claim?

View 6 Replies

Flex :: Get Project Framework Into ActionScript Project?

Mar 27, 2011

If I create a new flex project with flashbuilder, these are the libraries that get included by default through the Flex SDK[code]...

View 1 Replies

Flash :: Flex Project In A CodeIgniter Project?

Jun 18, 2011

I have a CodeIgniter project and I made a back-office in Flex. I was wondering how I can implement the Flex project in my CodeIgniter since I'm working with routing I can't route to any directory. So there isn't a way to display the back-office.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved