Preview of a movieclip
Hello,
On main stage when working with a movieclip symbol that contains animation i only see first frame of that animation. And if that animation starts blank the preview of that movieclip symbol will also be blank. And its very hard to do any kind of work with that kind of movieclip symbol on the main stage - selecting, composing with other elements, because simply you dont see it. Is there a way to chose which frame of a movieclip is displayed as a preview? Currently my workaround is to insert one aditional frame at the start of movieclip's timeline and paste onto it a graphic that will represent the movieclip, then delete it after all the work has been done.
Thank you!
HAving something in the first frame is needed if you want to see the movieclip while editing on the stage. What you can do, instead of deleting after the work has been done, place the graphic on a new layer and when you are done change that layer to be a Guide layer so that it is not included when the file is compiled, but is still there in case you need it again.
Similar Messages
-
Movieclip stuck in "outlines" preview mode
I'm using Flash CS4. Not sure how this happened, if it's a glitch or what, but somehow a movie clip within a site I was building has gotten stuck in the "outlines" preview mode. If I return to the root of the site, everything shows in "full" mode (just as flash is set to full in the view > preview mode options.) But when I double click to open one of the main movie clips, it's all outlines-- and the preview mode continues to show that "full" is selected.
Is this a glitch? Or is there some keystroke or option somewhere that I'm missing to get this individual movie clip back into full preview mode?You're a genius, doc. That did the trick-- no idea how I got in that situation in the first place, but that worked. Shows how long it's been since I worked in flash :s
Thanks again! -
To use the same code for many movieclips
Dear all.
I am using the flash to build my personal book online. I need zoom many movieclip, my images.
i make the code and function perfectly. But I want to find a way to use the same function for all movieclips and so, mantaining my code clean.
mc_01.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, Drag);
mc_01.addEventListener(MouseEvent.MIDDLE_MOUSE_UP, unDrag);
mc_02.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, Drag);
mc_02.addEventListener(MouseEvent.MIDDLE_MOUSE_UP, unDrag);
and many others....
function Zoom(e:MouseEvent):void
mc_01.x = 0; //I try here for this.x but the previews movie, called "Books" is who have changed your x value.
mc_01.y = 0;
I
EDIT: For untangle, the previews movie is called MyAllPhotos and then, contain all movieclips that are each movie clip is one my imagesHi Mr Kglad.
And when I call a property like a X position I use this["mc_"+padF(i)].x = 0; for substitute the mc_01.x = 0 ?
My problem realy is inside the function. Your loop add an event to my clips and direction to function Drag and UnDrag.
But inside in this functions, I need get some informations for the clip.
Here the code:
function Zoom(e:MouseEvent):void //Sorry, but the correct name my functions is Zoom and not Drag and unDrag
var mod:Number = 50;
mc_01.scaleX += e.delta / mod; //in this name mc what I need to use? this, parent? I try and not function.
mc_01.scaleY += e.delta / mod; -
Preview is different than final compile? HELP PLEASE
This is a simple test animation, but 2 things go wrong when I compile it
1: the clouds in the compiled version move at different speeds than when I hit "play" in the workstation
2: one of the clouds dissapears (the bottom one), and then reappears randomly, something that it doesn't do in the workstation
Ive tried it in different layers, with different types of objects, and even capturing it frame-by-frame, but it always messes up when i export it!
Heres the .fla and the .swf files, if someone could look and see if i'm overlooking something and give me feedbac
http://speedy.sh/fxWTk/RECOVER-RECOVER-1.flaHi,
It looks like you have accidently added the same motion tween twice at different levels of nesting within the same symbol. Also within nesting, you're using Movieclip instance somewhere and Graphic instance at other places.
This answers both of your queries:
1. Speed is different because the resultant speed is the addition of two motions along the same path. (When previewing within application, animations within a movieclip are not shown but within Graphics are shown.)
2. The disappearance happens due to the same eason. The start and end point of a grapic animation is dependent on the parent timeline and remains the same during looping. Movieclip animations on the other hand, always play completely and may spill over multiple loops. So basically the start point of the animation is getting shifted with every loop.
You can remove one of the tweens from the nested symbol to fix this.
-Nipun -
Can't duplicate movieclips as an array within an array
Hello.
I have an animation that loads an xml into it and traces back
an array within an array. I have tried to apply this to duplicated
movieclips thereby creating a structured set of links. What I am
trying to do is this:
Chicken Nuggets
__Compression
__Texture
__Disgust
Mega Warhead
__Taste
__Hardness
__Pain
This traces fine but I can't seem to get the duplicated
movieclips to assemble in this fashion.
The code for the XML is as follows:
var controlArray:Array;
var variable:Array;
var testTopic = new Array ();
var test = new Array ();
var controlsXML:XML = new XML();
controlsXML.ignoreWhite = true;
controlsXML.onLoad = function(success:Boolean){
if (success){
var mainnode:XMLNode = controlsXML.firstChild;
var controlNodes:Array =
controlsXML.firstChild.firstChild.firstChild.firstChild.childNodes;
var list:Array = new Array();
for (var i:Number = 0; i < controlNodes.length; i++) {
var personnode:XMLNode = controlNodes
.attributes.Name;
trace(personnode);
testTopic.push (new struct (personnode));
var specificNode:Array = controlNodes.childNodes;
for (var j:Number = 0; j < specificNode.length; j++){
var itemnode:XMLNode = specificNode[j].attributes.Variable;
trace(itemnode);
test.push (new struct2 (itemnode));
printer ();
printer2 ();
} else {
trace('error reading XML');
controlsXML.load ("controls3.xml");
The code for the movieclip duplication is as follows:
x = 50;
function printer ()
for (m = 0; m < testTopic.length; m++)
duplicateMovieClip ( slotTopic, "slotTopic" + m, m );
slotTopic = eval ( "slotTopic" + m );
slotTopic._y += x;
slotTopic.slotTopicContent.text = testTopic[m].personnode;
function printer2 ()
for (k = 0; k < test.length; k++)
duplicateMovieClip ( slot, "slot" + k, k );
slot = eval ( "slot" + k );
slot._y += x;
slot.slotContent.text = test[k].itemnode;
function struct (personnode)
this.personnode = personnode;
function struct2 (itemnode)
this.itemnode = itemnode;
On the stage are two movieclips, titled "slotTopic" and
"slot". Within those are dynamic text boxes titled respectively
"slotTopicContent" and "slotContent". When I preview this file it
only displays the text within the "slot" movieclip and it lists all
six of the subtopics with no break. So, there are two dilemmas:
1) The movieclips won't duplicate into the structured set of
links that I want.
2) "slotTopic" is not displaying text at all.
If anyone has any advice, I'd really appreciate it.
Thx!ok, I'm sorry but there are quite a few things wrong here.
first though, when posting code please use the 'attach code'
button.
1) i can't imagine that you have a XML structure as deep as
your calling to or the need for it with the limited amount of
infomation your pulling, in addition your storing the info in
attributes, so I can't see how this would work, it may 'trace' out
the right text (somehow) but it's not getting into the arrays
properly.
2) you do not assign an attribute value to a XMLNode, and
then try to push it into an array.
3) you do not call a method (struct or struct2) using the
'new' operator. this is how you envoke a new 'class' instance.
4) do not use 'x' as a variable name as it is a reserved var
in flash, assigned to an Object instance.
5) the duplicateMovieClip() method needs to be called upon
the existing clip as in:
slotTopic.duplicateMovieClip('slotTopic'+m, m);
additionally you can pass the _y placement within the
initObject.
6) you do not need to use eval, it isn't doing anything here,
you will gain the correct path by calling duplicateMovieClip
correctly.
7) the reason why slotTopic is not being displayed at all is
because of the second loop, you are duplicating the clips
(incorrectly) into the same depths thereby replacing all of the
contents of the slotTopic depths previously constructed.
the solution to this problem is to construct both items with
the same loop but increament one of the depth assignments by a
specific number, in other words at depths much higher or at least
different, than that of the first element, as in:
slotTopic.duplicateMovieClip('slotTopic'+m, m, {_y:50});
slot.duplicateMovieClip('slot'+(m+100), m+100, {_y:50});
again I'm sorry man, but it will take some work to sort this
out. -
Image control with a movieclip source
I have an image control sitting inside a panel. The images
source is a movieclip. When I change the change the size of the
movie clip (scale X, scale Y) the movie clip exceeds the boundary
of the image and the panel, so no scroll bars are shown. Can anyone
shed some light on this? I'm stumped.Hey Guys,
A couple things:
We don't have preloader scripts, but the way I do it is to
load them from a regular data set and put them into a hidden DIV. I
use that here:
http://www.dbooth.net/photos/index.htm?location=italy2007#
The thumbnails are loaded into a DIV that is hidden. They are
then available as previews when you mouseover the numbers.There is
a lag of course, since that do have to load at some time.
As for MySQL scripts, we have a util file here:
http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
We have two versions for each language: One that will just
auto-convert a query and another that allows you to create your own
node names.
Let me know if you have questions.
Don -
Preview-picture making fix in After Effects CS6 before rendering
Hello guys,I use tutorials for learning after effects cs6...I can't find how I can rendering a preview-picture which will be showed in the ready movieclip. Do we have a possibility for making a special picture/ICON in CS6 before rendering? Greetings from Torsten
Hello Andrew, sorry about my english :-)
Yes I'm trying to define a special thumbnail image of a rendered clip from my timeline - I can't believe it, that AE CS6 this not can??? In a little clip with 15 sec it will rendered any picture in the middle of the timeline...I can't believe it !!! THE GREAT PROGRAMM AE CS6... :-(
You are really sure? -
Problem: Animation publishing incorrectly, but working in Cp preview.
Hi,
I created an animation in Flash CS5 with some code in it (see below for the code). What the code does is it allows the user to play/pause the movie by pressing the spacebar. It allows that keyboard shortcut to be used on all slides except certain ones (in this case: slides 9, 13, and 15). I just need to drop this animation onto the first slide of my Cp project, and the function works throughout the rest of the project. When I hit F4 to preview, it works great, but when I publish it, it has problems: It won't work, for starters, but also, when I go to a slide, press the spacebar, and then go back to the previous slide, the play/pause button down on the playbar shows the 'play' icon (meaning the video should be paused), but the video continues to play. The play/pause button in the playbar and the keyboard shortcut do nothing. Keep in mind that it works perfectly when I 'F4' it, just not when I publish it and open the SWF. Usually when stuff works in Cp but not when published, its something in the publish settings that's the problem, but I can't find anything in there that would help. Plus, F4ing the project within Cp should factor in the publish settings. Just to be clear, all I need help with is making the published file work exactly like the F4 preview. The code is below, and thanks to anyone that can help.
// Keyboard Shortcut: Play/Pause (Space)
stage.addEventListener(KeyboardEvent.KEY_DOWN, keypressPause);
function keypressPause(event:KeyboardEvent):void
switch(event.keyCode)
case Keyboard.SPACE :
var myRoot:MovieClip = MovieClip(root);
var mainmov:MovieClip = MovieClip(myRoot.parent.root);
if (mainmov.cpInfoCurrentSlide != 9 &&
mainmov.cpInfoCurrentSlide != 13 &&
mainmov.cpInfoCurrentSlide != 15)
if (mainmov.rdcmndPause == 1)
{mainmov.rdcmndResume = 1;}
else
{mainmov.rdcmndPause = 1;}
break;The issue is the way the code is obtaining Captivate's main time line (mainmov). When you F4 the movie, it's being loaded differently than when you F12 web preview... thus the main time line is obtained differently. Here's a way to search for the main time line and the rest of the code:
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.utils.describeType;
import flash.display.MovieClip;
var mainmov:MovieClip = findMainMovie();
// Keyboard Shortcut: Play/Pause (Space)
stage.addEventListener(KeyboardEvent.KEY_DOWN, keypressPause);
function keypressPause(event:KeyboardEvent):void
switch(event.keyCode)
case Keyboard.SPACE :
if (mainmov.cpInfoCurrentSlide != 9 &&
mainmov.cpInfoCurrentSlide != 13 &&
mainmov.cpInfoCurrentSlide != 15){
if (mainmov.rdcmndPause == 1){
mainmov.rdcmndPause = 0;
mainmov.rdcmndResume = 1;
}else{
mainmov.rdcmndPause = 1;
mainmov.rdcmndResume = 0;
break;
//Returns the Captivate MainTimeLine
function findMainMovie():MovieClip
var cpMovie:MovieClip;
//cpMovie = parent.parent.parent;
cpMovie = findParentByType(this.parent, "CaptivateMainTimeline") as MovieClip;
return cpMovie;
//Iteratively finds a parent object by type
function findParentByType(source:DisplayObject, parentType:String):DisplayObjectContainer {
var currentTarget:DisplayObjectContainer = source.parent;
while (currentTarget != null) {
if (describeType(currentTarget)[email protected](parentType) >= 0) return currentTarget;
currentTarget = currentTarget.parent;
return null; // We're at the root
The code to search for the main time line was gleaned from CpGears written by Whyves
I'd encourage you to think about making this into a Captivate static widget using the CpGears framework or the WidgetFactory framework by Tristan Ward. Either framework will make your life much easier.
I usually set the two variables in tandem: rdcmndPause and rdcmndResume so that all variables stay in sync.
When I dropped the animation into the Cp project, I had to set it to display for "rest of project" in order for it to work across all slides.
Report back and let us know how it goes.
Jim Leichliter -
I have a video player that plays multiple videos. I added an
item called "preview" to the XML which looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<playlist id="Adobe Developer Center - Dynamic Video
Playlist in AS3" >
<vid desc="Mitzvahpalooza featuring Chicago Jewish Teens
Got Talent"
src="
http://www.juf.org/interactive/videos/mitzvahpalooza_08.flv"
thumb="
http://www.juf.org/interactive/thumbs/mitzvahpalooza_btn.jpg"
preview="
http://www.juf.org/interactive/thumbs/mitzvahpalooza_btn.jpg"/>
<vid desc="Chicago Jewish Community Memorial Evening of
Tribute and Solidarity"
src="
http://www.juf.org/interactive/videos/mumbaimemorial.flv"
thumb="
http://www.juf.org/interactive/thumbs/MumbaiFull_btn.jpg"
preview="
http://www.juf.org/interactive/thumbs/MumbaiFull_btn.jpg"/>
</playlist>
I am trying to have a preview image of which ever video is
ready to play lay over the video layer. The AS3 is in an external
AS document. I cannot figure out how to integrate it into the
following code. Can anyone give me a hint or the answer? Thank you.
package {
import flash.display.*;
import flash.net.navigateToURL;
import flash.events.MouseEvent;
import fl.video.VideoEvent;
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import fl.controls.listClasses.CellRenderer;
import fl.controls.ScrollBarDirection;
import flash.display.SimpleButton
public class VideoPlaylist extends MovieClip {
private var xmlLoader:URLLoader;
public function VideoPlaylist():void {
// Load the playlist file, then initialize the media player.
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
var videoplaylist = '
http://www.juf.org/interactive/xml/playlist.xml';
xmlLoader.load(new URLRequest(videoplaylist));
// Format the tileList, specify its cellRenderer class.
tileList.setSize(312, 130);
tileList.columnWidth = 104;
tileList.rowHeight = 80;
tileList.direction = ScrollBarDirection.HORIZONTAL;
tileList.setStyle("cellRenderer", Thumb);
public function initMediaPlayer(event:Event):void {
var myXML:XML = new XML(xmlLoader.data);
var item:XML;
for each(item in myXML.vid) { // populate playlist.
// Get thumbnail value and assign to cellrenderer.
var thumb:String;
if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;
// Send data to tileList.
tileList.addItem({label:item.attribute("desc").toXMLString(),
data:item.attribute("src").toXMLString(),
source:thumb});;
// Select the first video.
tileList.selectedIndex = 0;
// Listen for item selection.
tileList.addEventListener(Event.CHANGE, listListener);
// And automatically load it into myVid.
myVid.source = tileList.selectedItem.data;
//Goes to a frame in the current video
myVid.bufferTime = 3;
myVid.seek(2)
// Pause video until selected or played.
myVid.pause();
// Detect when new video is selected, and play it
function listListener(event:Event):void {
myVid.play(event.target.selectedItem.data);Hi,
this is due to some restrictions with the XML forms application and can not be configured.
So you need to develop if you need a different behaviour, but it may be that XML forms behave not correctly then.
Regards,
Sascha -
Embed Flash artwork but no design preview
I can successfully embed some simple flash artworkby
following the directions in the Adobe documentation Importing Flash
CS3 assets into Flex (no scripting just a plain old static
movieclip). When I run the application, it is fine. Should I be
seeing this imported artwork in design mode? I only see a small
image icon but no preview. Is this correct?You can't see a swf in design mode, no. You have to run the
app. -
Custom MovieClip class and loadMovie
Hi, I am trying to create a custom MovieClip class with
loadMovie, but it doesn't work.
I created a movie clip symbol and action script linked to it,
such as:
class CustomMovieClip extends MovieClip { ... custom
functions to define the behavior, onPress, onMouseMove, etc ... }
It works all fine until I call loadMovie on an instance,
trying to change the shape.
As I searched, I figured loadMovie can mess you up if you do
somthing like mc.onPress = .... but
is this the case for a custom class? Hope not.
Any help???Solved the issue myself. I write it here so other people can
find it.
Basically, you can't do loadMovie directly to CustomMovieClip
class instance.
It will mess up all the methods you have defined in the
class.
Workaround is to do loadMovie to a variable in the class.
Complete working example is here:
1. Create a project MCTest.flp
2. Prepare Movie1.swf (a simple shape)
3. Create a Flash document MCTest.fla
4. Create a ActionScript file CustomMovieClip.as:
class CustomMovieClip extends MovieClip {
function onPress() {
trace("onPress");
6. Create a symbol CustomMovieClipContent:
Behavior: Movie Clip
Draw nothing.
5. Create a symbol CustomMovieClip:
Behavior: Movie Clip
Identifier: CustomMovieClip
AS 2.0 Class: CustomMovieClip
Export for ActionScript: Yes
Export in first frame: Yes
Open editor and drag&drop CustomMovieClipContent, name
it 'contents'
6. Edit ActionScript in MCTest.fla>Scene 1>Layer
1>1st Frame
attachMovie("CustomMovieClip", "customMovieClip1", 0,
{_x:100, _y:100});
customMovieClip1.contents.loadMovie("Movie1.swf");
7. Preview and you see two movie clips.
Click on the object, and "onPress" is printed in the output. -
I have found a nice free flash template to use for a portfolio site but I want to add something small to it but could not figure it out myself. I hope that somehow could help me out. The free templates creates a thumbnail preview of the image and I want to be able to create a full size preview off in another area. I will post the AC3.0 and an image to help explain.
import caurina.transitions.Tweener;
slider_info.text = "loading data...";
link_title.text = "";
link_description.text = "";
var folder:String = "thumbnails/";
var start_from:Number = 0;
var no_of_tn:Number = 5;
var i:Number;
var tn:Number = 0;
var current_no:Number = 0;
var tween_duration:Number = 0.8; // seconds
var total:Number;
var flashmo_xml:XML;
var flashmo_tn_list = new Array();
var thumbnail_group:MovieClip = new MovieClip();
this.addChild(thumbnail_group);
thumbnail_group.mask = slider_mask;
function load_gallery(xml_file:String):void
var xml_loader:URLLoader = new URLLoader();
xml_loader.load( new URLRequest( xml_file ) );
xml_loader.addEventListener(Event.COMPLETE, create_thunbnail_slider);
function create_thunbnail_slider(e:Event):void
flashmo_xml = new XML(e.target.data);
total = flashmo_xml.thumbnail.length();
for( i = 0; i < total; i++ )
flashmo_tn_list.push( {
filename: flashmo_xml.thumbnail[i].filename.toString(),
title: flashmo_xml.thumbnail[i].title.toString(),
description: flashmo_xml.thumbnail[i].description.toString(),
url: flashmo_xml.thumbnail[i].url.toString(),
target: flashmo_xml.thumbnail[i].target.toString()
load_tn();
function load_tn():void
var pic_request:URLRequest = new URLRequest( folder + flashmo_tn_list[tn].filename );
var pic_loader:Loader = new Loader();
pic_loader.load(pic_request);
pic_loader.contentLoaderInfo.addEventListener(Prog ressEvent.PROGRESS, tn_progress);
pic_loader.contentLoaderInfo.addEventListener(Even t.COMPLETE, tn_loaded);
tn++;
function tn_progress(e:ProgressEvent):void
slider_info.text = "loading thumbnail... " + tn + " of " + total;
function tn_loaded(e:Event):void
if( tn < total )
load_tn();
else
slider_info.text = "";
var flashmo_tn_bm:Bitmap = new Bitmap();
var flashmo_tn_mc:MovieClip = new MovieClip();
flashmo_tn_bm = Bitmap(e.target.content);
flashmo_tn_bm.smoothing = true;
flashmo_tn_mc.addChild(flashmo_tn_bm);
flashmo_tn_mc.name = "flashmo_tn_" + thumbnail_group.numChildren;
flashmo_tn_mc.buttonMode = true;
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
flashmo_tn_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
flashmo_tn_mc.addEventListener( MouseEvent.CLICK, tn_click );
flashmo_tn_mc.x = thumbnail_group.numChildren * 150;
thumbnail_group.addChild( flashmo_tn_mc );
function previewLoaded(e:Event):void
var previewArea:MovieClip;
while(previewArea.numChildren){ previewArea.removeChildAt(0) };
var flashmo_tn_bm:Bitmap = Bitmap(e.target.content);
flashmo_tn_bm.smoothing = true;
previewArea.addChild(flashmo_tn_bm);
function tn_over(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
Tweener.addTween( mc, { alpha: 0.5, time: tween_duration, transition: "easeIn" } );
link_title.text = flashmo_tn_list[current_no].title;
link_description.text = flashmo_tn_list[current_no].description;
var pic_request:URLRequest = new URLRequest('fullpreviewimages/' + flashmo_tn_list[current_no].filename );
var pic_loader:Loader = new Loader();
pic_loader.contentLoaderInfo.addEventListener(Even t.COMPLETE, previewLoaded);
pic_loader.load(pic_request);
function tn_out(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
Tweener.addTween( mc, { alpha: 1, time: tween_duration, transition: "easeOut" } );
link_title.text = "";
link_description.text = "";
function tn_click(e:MouseEvent):void
var mc:MovieClip = MovieClip(e.target);
current_no = parseInt(mc.name.slice(11,13));
navigateToURL( new URLRequest( flashmo_tn_list[current_no].url ),
flashmo_tn_list[current_no].target );
function move_slider():void
if( total - start_from < no_of_tn )
start_from = total - no_of_tn;
if( start_from < 0 )
start_from = 0;
Tweener.addTween( thumbnail_group, { x: - start_from * 150,
time: tween_duration, transition: "easeInOutQuart" } );
flashmo_previous.addEventListener( MouseEvent.CLICK, move_left );
flashmo_next.addEventListener( MouseEvent.CLICK, move_right );
function move_left(e:MouseEvent):void
start_from -= no_of_tn;
move_slider();
function move_right(e:MouseEvent):void
start_from += no_of_tn;
move_slider();
I thank anyone in advance for even the shred of help as I have been struggling with this the last two days.Is it because previewArea is not being declared as a valid moveclip?
-
Publish Preview returns blank flash window
Hi guys,
I recently switched computers, going from a windows vista with Adobe flash cs5.5 v to windows 8.1 with Adobe flash cs6 v12.0.2.529.
We've been working on a flash project in cs5.5 and everything worked fine however now I'm getting some strange behavior.
The problem I'm having is that the publish preview returns blank.
It has the right size and stage color but nothing is shown.
And I can't retrieve images from a runtime shared library.
Here's some sample code that illustrates the problem (this used to work fine in cs5.5):
package classes
import flash.display.MovieClip;
import flash.utils.getDefinitionByName;
import flash.display.Sprite;
import flash.external.*;
public class ExampleClass extends MovieClip
public function ExampleClass()
ExternalInterface.addCallback("Show", Show);
var test:Sprite = new Sprite();
test.graphics.beginFill(0xff00ff);
test.graphics.drawCircle(0, 0, 100);
addChild(test);
var test02:Sprite = new (getDefinitionByName("ConnectionIcon_Orange") as Class)();
addChild(test02);
private function Show():void
In this example I don't see the "test" Sprite's graphic.
When I comment the following line:
ExternalInterface.addCallback("Show", Show);
I do see the "test" Sprite's graphic.
With the test02 Sprite I try to retrieve an image from a runtime shared library but it never shows up (it did in cs5.5 do i need to make any new setting changes?).
I'm not getting any error messages and it seems fine with the code.
could anyone please point me to where I'm going wrong?
CheersFew random things I'd try..
First, are you running this in debugger? (CTRL+SHIFT+ENTER)? If not then use that means of executing and put some breakpoints in the code so you can watch the code execute step by step to see what's generating an error. In publish settings for this SWF in the SWF parameters make sure you check to permit debugging to get more verbose errors:
Explicitly including ExternalInterface rather than flash.external.*;. It should include it (and everything in the package) but I've had lookup issues with this before. So:
import flash.external.ExternalInterface;
See if that clears up the break on that line. You should set a break point above that line however so you can step into the command and watch for errors.
Make sure your access toggle (network/local files) is correct to access your RSL.
Sometimes a couple more lines of code for clarity can help a lot. Break up your getDefinitionByName line into 2 lines, maybe adding in a condition just so you can step through it and analyze exactly which part of that compound statement is going wrong. It could be as simple as your "new (...)" isn't being cast to a Sprite before you assign it so the line fails. So try:
var test2Class:Class = getDefinitionByName("ConnectionIcon_Orange") as Class;
if (test2Class)
var test02:Sprite = new test2Class() as Sprite; // cast
By stepping through it you'll see if your definition cannot be found (RSL or link issue) or if assigning it to a Sprite (test02) is the issue (perhaps it's a MovieClip or some other unexpected type and this fails). -
Why can't I preview my motion tween on the timeline?
Hi,
I created a symbol and included a motion tween and it works perfectly (has the arrow), but when I try to play it on the timeline it doesn't play (you can only see the first frame of the symbol). When I test the movie the motion tween works fine. This never happened when I used Flash CS6 :SHi,
In Flash Pro, Movieclip Symbols do not show the animation nested within them on Timeline and the full animation can only be previewed using Test Movie.
If you change the Symbol instance type to Graphic from the Properties Panel, you will be able the preview nested animation as well. (Just make sure that the frame span where your graphics symbol is placed is long enough to show the entire animation). -
Hi
Does anybody know how to create a compiled clip that diaplay
when add to the stage. I explaine. The clip I build has an outline
to know the diaplay zone. This outline visible = false at the clip
ADDED event. It means that when I publish the Fla, the outile
desapear. My problem is that when I Compiled it to a Compiled CLip,
when I put it on the stage the ADDED is execute. So I can't view
the outline to position it to the stage.
I tried to used the Component properties and set the live
preview, I put a link to a swf that is exactly the preview of it,
but when ADDED to the stage the preview is jsut a small square of
10 px. Not the real preview in the external swf.
I need to have a Compiled Clip that is visisble on the sateg
and execute the outshape visible to false on publish only
Any Ideayou can preview but movieclips won't play. graphics will.
Maybe you are looking for
-
Hi, A few people have asked this question, my macbook is running very slow and the mouse spinning circle comes up quite a lot. I am unsure of why it is doing this. I have attached a copy of the EtreCheck I have done on my system. Can you please have
-
Error when using automatic clearing (F.13)with foreign currency valuation.
Hello all below is our problem, please suggest us a solution We are experiencing a problem when running the automatic clearing in SAP. Somehow, the system seems to clear (with no reason) open items created with the revaluation of foreign currency. Le
-
How to forbid command field at user level?
Does anyone know how can i forbid at user level the command field? Thanks M.
-
Differences oracle 8.0.6 between NT Server and Windows2000 Server
hello all, today we have oracle 8.0.6 on NT Server ... we need install the same release oracle 8.0.6 on new IBM server, with Windows 2000 Server ... i´m looking information about differences between config oracle 8.0.6 in NT Server and Windows 2000 S
-
How To solve the error FJS 0012 during installation IDES4.7
Hi, I got an error FJS00012 during installation of IDES4.7. How to solve the problem? is there any way to solve the problem..... please suggest me.... and send a mail to [email protected].. regards Sankar