| Loading external AS2 SWF in AS2 |
|
 |
Index ‹ flash-actionscript
|
- Previous
- 2
- forced reloadI am using a MovieClipLoader to load
external contents from a remote server
to a movieClip. After a while, I
would like to load it again due to
dynamic changes in the contents.
However, the flash movie keeps reloading
the temperorary cached file. Within
ActionScript, is there a way to force
my MovieClipLoader to always reload the
content from the remote server?
- 4
- Subclassing the UI componentsHey Guys,
Am trying to subclass a UI component sothat it can have additional properties.
The subclass is fairly simple !
import mx.controls.*;
class UZCheckBox extends CheckBox{
public var Id:Number;
function UZCheckBox(){
super();
}
}
And I create an instance of this class through actionscript.
var answerCheckBox:UZCheckBox = (UIMovie.createClassObject(UZCheckBox,
AnswerText, depth, {label:AnswerText}));
answerCheckBox.Id = answerNode.attributes.ID;
It complies fine but does not show the checkbox on the screen. I think I have
not been able to import all the properties of the checkbox into this new
subclass. Any ideas on how to accomplish such stuff?
Thanks in advance,
-Punit.
- 4
- grab and drag a flash movie playhead?I have a imported movie of a 360deg. shot of a car that loops. I want to
know if it is possible in AS2 to mousedown in the movie and have that movie
stop then as you move the mouse back and forth have the playhead move
forward and backward as with the mouse. I guess you could call it a grab and
rotate. I will try and find a site with it and post it.
- 5
- Drawing co-ordinates in actionscriptI am relying on the draw methods i.e line,curve to create a movie. But the
things I draw do not appear in the correct place. i.e. i draw a rectangle
starting at 0,0 and it appears in the middle of the entire document when I run
it. I beleive this may be as it is drawing it relelvant to the movie clip
rather than the document itself. I tryed making all my movieclips the same size
as the document in the hope the co-ordinate system would match but to no avail.
Does anyone have any ideas as to how I can use drawing tools and moveto's to
get my movieclips or dynamic drawing where I actually want it?
Thanks
- 5
- Problem with Sound.positionI find that Sound.position does not reset to 0 when using Sound.loadSound(). It
seems to continue with the last value. If a loaded sound is stopped at position
500. Starting the sound again plays the sound from 0 but position starts at
500?
I have worked around this by making a new sound object when a loadedSound is
stopped. Is there a better solution?
- 6
- Homemade Scrollbar SticksI created a homemade scrollbar because I just need to preform simple scroll
functions and can customize the scrollbar fast and easy. However, the current
code I use has one flaw: if you scroll too quickly, even when you release your
mouse, you are still controlling the scrollbar. To set the scrollbar in motion,
it uses an onEnterFrame and then deletes it when you release. It seems like a
simple event issue but then again, you might have a much better way altogether.
Here is the code and an example is at braillehiphop.com if you need it. Thanks
for any help.
horz_scrubber.onPress = function()
{
horz_scrubber.onEnterFrame = function()
{
theScrubber = this._x + (this._width/2);
leftEdge = windowSize_horzLine._x - Math.floor(this._width/2);
rightEdge = (windowSize_horzLine._x) + (windowSize_horzLine._width -
horz_scrubber._width) + Math.floor(this._width/2);
this.startDrag(false, leftEdge + 14, windowSize_horzLine._y -
(horz_scrubber._height/2), rightEdge - 14, windowSize_horzLine._y -
(horz_scrubber._height/2));
scrollPercent = (((currentScrollPosition - scrollTop) / (scrollBottom -
scrollTop)) * 100)*.01;
thePercentage = Math.floor((((theScrubber) - windowSize_horzLine._x)/
windowSize_horzLine._width)*100);
horzWindows = Math.ceil(thePercentage/10);
drawWindows();
}
}
horz_scrubber.onRelease = function()
{
this.stopDrag();
delete horz_scrubber.onEnterFrame;
}
- 6
- Text HighlightHi All,
Sorry if this is a repeated question..
Is it possible to change the color of the selection of a input text. Right
now it selects in black color. How do I change it ? please let me know ASAP!
Thanks in advance!! : )
- 6
- Scroll PainsThanks in advance to anyone who has a tip!
I'm building an app that has a sign in and register feature. The form is
longer than the viewable area so i thought.. swell! there's a handy scroll pane
component I can load a movie clip into, so the content will scroll. everything
works fine until i need to repopulate the form with the user info from the
database. i'm using the same movie clip for the register/edit functionality. I
can fill out the form, send the info for processing and the data goes into the
db just fine. when the user signs in (or if they've already signed in...) their
record is retrieved and the form is loaded into the scroll pane.
<b>here comes the hard part ;)</b> for the life of me i can't get the data to
go back into the form fields. in a nutshell, i'm getting the result from the
db, creating a user object and using a for in loop to repopulate the form
fields. the form movie itself has an object array of the fields to flag them as
certain 'types' for validation before being sent to the server.
when debugging, i can see the array inside the scroll pane instance but can't
seem to reference it in actionscript. the path i can see is
spInstance.spContentHolder.formFields. tracing the objects actually shows the
correct values but no text shows up in the fields. I'm already using a
CSSStyleDeclaration to embed the fonts in the text object globally so it's not
an embedding or font issue.
after tracing, debugging and beating my head against the keyboard i'm still at
a total loss......
any suggestions would be greatly appreciated!!
Sean
- 6
- Help with 'chasing' objectsHello all,
I'm new to Flash, so please bear with me. I need to create an effect
and I haven't been able to figure out the best approach for. The best
way for me to describe the effect is 'chasing objects'.
The animation will demonstrate voltage flowing through a circuit. The
shape of circuit is "L" shaped. The voltage flowing along the "L"
shape will be represented by a small 1/4" black square.
At a certain frame, the voltage is then sent through a bypass circuit
which is represented by a small "U" shaped path extending from the
original path.
I've figured out how to create the animation using the motion guide.
But this approach only allows me to attach a single symbol to it. I'll
need to have multiple symbols moving along the path at a constant
spacing.
Any thoughts or comments would be appreciated!
ammdaddy
- 9
- Using sequenze-named variables...Is there any way to use for statements with sequenze-named variables?
The variables are named _root.image1, _root.image2 ...
Something like this:
var fjImage:Number = 5
for (var i = 0; i<fjImage; i++) {
_root.image+i
'or something like this!!!
);
}
Please help, this would save me a lot of time...
- 10
- Instance names usage in actionscriptHello,
I coulnt find a post that matched my question, so here it goes.
I have checked the instance names in this flash document to check that they
match the action script. I use this action script:
//This script takes the user to Scene 2 when goScene_btn is released
hT_1-1_btn.onRelease = function (){
clicker_1_mc._x = 200;
clicker_1_mc._y = 150;
};
And get this error on publishing:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: Syntax error.
hT_1-1_btn.onRelease = function (){
Total ActionScript Errors: 1 Reported Errors: 1
Does any one know why?
thank you in advance
solex
- 10
- Listener NamingI have a for loop that places external images, each image is loaded with a move
clip loader that is created each cycle. I set them up generically like you
would for the move clip names.
var ListenerName = "LName"+i
var mcLoaderName = "MCload"+i
//
It works if I do this or just use the same name for all of them, so what I'm
asking is, do they need individual names like move clips?
- 11
- Shopping cart using flash mx 2004Hi people
i am working on a shopping cart project using Flash mx 2004 and PHP.
(1) i need to display the products stored in the MYSQL table in flash
(2) the customer should be able to drag a particular product into a basket (
its like take a product and drop in to to shoppin cart while we shop in the
super market ) where the basket will be a image
please help me out
thanks in advance
regards
viajy
- 13
- Expanding Dynamic Text FieldI'd like to create a dynamic text field that is a fixed width, but expands
vertically to accommodate however much text is assigned to it from a database.
It seems that this is possible, because I have one text field in my application
that does this, but I have no idea which setting change made it work and I
can't replicate it.
All I can get is a text field of fixed width and height - then all additional
text is cut off at the bottom.
Any help would be greatly appreciated. Thanks
- Michael
- 16
- scrollTrackColor solutionI hadn't seen a solution to this in the the group archives, so here is an
article that tells you how to get it working.-
http://www.person13.com/blog/archives/2004_02.html
Cheers,
TonyG
|
| Author |
Message |
AmarShah

|
Posted: 2007-12-12 3:11:44 |
Top |
flash-actionscript, Loading external AS2 SWF in AS2
I want to load the external SWF file which is in AS2 in to my SWF file which is
also in AS2.. The problem I am facing is I am able to load external SWF but I
am not able to pass the Flash vars to that SWF.. Here is my Code
var _mcl:MovieClipLoader = new MovieClipLoader();
var _listener:Object = new Object();
_listener.onLoadInit = function(_mc:MovieClip)
{
trace("Done loading...");
}
_mcl.addListener(_listener);
this._mc1.removeMovieClip(clip_1);
this.createEmptyMovieClip("_mc", this.getNextHighestDepth());
_mcl.loadClip("http://www.xyz.com/xyz/xyz.swf?200711900&local=true", _mc);
So the xyz.swf is not able to read the variable local I am passing as a flash
variable..
So how can I accomplish passing flashvars to this xyz.swf
Thanks
|
| |
|
| |
 |
Bob Pierce

|
Posted: 2007-12-12 5:00:00 |
Top |
flash-actionscript >> Loading external AS2 SWF in AS2
I don't know if you can pass variables this way, but since you are hard coding them in AS why not pass them directly to _mc once your .swf has loaded?
|
| |
|
| |
 |
| |
 |
Index ‹ flash-actionscript |
- Next
- 1
- Sending an email in FLash on a CD-ROMOK I create my flash file load it on a cd-rom, usig the post method I point it
to a cfmmail file on my server.
AS long as I use a real email address instead of an alias it works fine, but
if I use an alias and then point
that to an email address it doesn't work. Any ideas? This project has 4
clients with different email addresses
and I don't have access to any of their servers. So I'm posting the email to
my server and then forwarding it on
to them.
Last thing is they can choose multiple people to send this too, I assume I can
modify the file to except multiple "from" ?
Thanks.
- 2
- onRollOut Stop ActionPLEASE Advise me "How to write the code where one button stop an the second
button is still activated. The code follows:
stop();
Test1_btn.onRollOver=function (){
_root.createEmptyMovieClip("controller_mc",2);
controller_mc.onEnterFrame=function(){
_root.gotoAndStop(_root._currentframe+1);
if (_root._currentframe+1 > _root._totalframes - 20){
_root.gotoAndStop(_root._currentframe = 18);
}
}
}
Test1_btn.onRelease=function (){
controller_mc.removeMovieClip();
}
Test1_btn.onReleaseOutside=function (){
controller_mc.removeMovieClip();
}
Test1_btn.onRollOut=function (){
_root.createEmptyMovieClip("controller_mc",2);
controller_mc.onEnterFrame=function(){
_root.gotoAndStop(_root._currentframe-1);
if (_root._currentframe-1 < 1){
_root.gotoAndPlay("Start");
}
}
}
Test1_btn.onRelease=function (){
controller_mc.removeMovieClip();
}
Test1_btn.onReleaseOutside=function (){
controller_mc.removeMovieClip();
}
//invisible Button 1
Invis_btn.onRollOver=function (){
_root.createEmptyMovieClip("controller_mc",2);
controller_mc.onEnterFrame=function(){
_root.gotoAndStop(_root._currentframe-1);
if (_root._currentframe-1 < 1){
_root.gotoAndPlay("2");
}
}
}
Invis_btn.onRelease=function (){
controller_mc.removeMovieClip();
}
Invis_btn.onReleaseOutside=function (){
controller_mc.removeMovieClip();
}
- 3
- Actionscript in text file?I've imported a text file into a nice scrollin text field.
I can put in regular HTML links no problem.
But now the question is: Is it possible to execute actionscript from that file
as well?
What I need to do is if someone clicks a word in the file (like a regular
link) I want to load a new swf movie into, for instance, level 10
- 4
- onLoadInit failing - due to caching?I am running an app both locally and across the net. It involves loading movies
in and out of a level, an monitoring them with onLoadInit. The second time I
load a movie across the net, onLoadInit fails completely. It's fine on my local
machine.
this.movieClipLoader.loadClip (this.requiredMovie, this.stage_mc);
Interestingly, I am also tracing the onLoadComplete event. I see the following
differences:
1) Second load, locally
<<<<< //////////////// Movie loaded url -
http://localhost/CDApp1/1/vidTest1.swf >>>>>>
<<<<< //////////////// Movie loaded http status- 200 >>>>>>
<<<<< Parent is _level0.Content1, depth is 1 >>>>>>
2) Second load, net
<<<<< //////////////// Movie loaded url -
http://www.blammo.com/CDApp1/1/spTest.swf >>>>>>
<<<<< //////////////// Movie loaded http status- 200 >>>>>>
<<<<< Parent is _level0.Content1, depth is -32770 >>>>>>
This is a pretty major problem for me. Any ideas?
- 5
- Define and load a list of sound objectsUsing a list, I am (unsuccessfully ) attempting to define some sound objects
and load the appropriate external MP3 files. Below are the desired sound
objects and associated files (which are on the same directory level as the SWF):
multi1 -- "multi1.mp3
multi2 -- "multi2.mp3"
multi3 -- "multi3.mp3"
To accomplish this, I am using the following code:
//establish the list of sounds
mySoundList = new array("multi1", "multi2", "multi3");
//create sound objects and load the external MP3 files
for (var i = 0; i<mySoundList.length; i++)
{
trace(mySoundList);
mySoundList = new Sound();
mySoundList.loadSound(mySoundList + ".mp3");
}
However, I receive the following error when running the movie:
- Error opening URL "file:///E|[object Object].mp3" -
Can anyone provide me some guidance on how to fix this problem? I am obviously
doing something fundamentally wrong.
I appreciate any assistance!
Phil
- 6
- 7
- mc actionsI want to make it so when a button is clicked, it will tell other movie clips to go to frame 1.
This is the situation. I have 4 MC that are acting as buttons. There is an nimation for each. I need to make it so if one button is clicked it will play its animation, and it tells the other 3 MC's to go to frame 1 in their MC. The MC's are already loaded.
Thanks
- 8
- initiate a variable == loss of mem?If I initiate a variable like this..
var myArray:Array = new Array();
do this..
myArray.push(someDumbStuffHere01);
myArray.push(someDumbStuffHere01);
myArray.push(someDumbStuffHere01);
myArray.push(someDumbStuffHere01);
myArray.push(someDumbStuffHere01);
what would happen if I do this..
var myArray:Array = new Array();
Obviously I loose my data (I think), but would this make a memory leak
or just reset the whole variable and start over as far as memory?
Thanks
-Richard
- 9
- setInterval and XML Load ProblemHello,
I 'm having the simple problem of making sure the XML is loaded before
beginning the Interval sequence. Therefore it is missing some of the XML data
when loading. See example:
http://alt.coxnewsweb.com/statesman/img/advertising/_jacob/Site1/products.html
I tried a success boolean with the XML onLoad Handler, but my setInterval
stopped working. I could easily just not know how to properly implement XML
onLoad.
Can someone help me out with properly loading the XML document before the
setInterval is initiated.
Thank You - Jacob
Here is the Working Code of the example given...
//New XML Object
var mydata:XML = new XML();
//ignores formatting of XML files tabs, returns, ect.
mydata.ignoreWhite = true;
//Setup onLoad Function
mydata.onLoad = loadXML;
//Loads actual XML Data File
mydata.load("data.xml");
//setInerval Vars
var intervalId:Number;
var count:Number = 1;
var maxCount:Number = 20;
var duration:Number = 100;
//Thumbnail Position Vars
var originalx:Number = 20;
var originaly:Number = 55;
currentx = originalx;
currenty = originaly;
var i:Number = 0;
//Create Thumbnails Interval
function thumbInterval():Void {
//trace(i);
//Controls # of Thumbnails per line
if ((i % 5 == 0) && (i > 0)) {
currenty += 125;
currentx=originalx;
}
//Attatch Library MC
_root.attachMovie("thumbnailMC", "thumbnailMC" + i, 1000 + i);
//Load Image, text, and position
_root["thumbnailMC" + i].thumbnailname =
mydata.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
_root["thumbnailMC" + i].textbox.productdescr =
mydata.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
_root["thumbnailMC" + i]._x = currentx;
_root["thumbnailMC" + i]._y = currenty;
currentx += 130;
i++
if(count >= maxCount) {
clearInterval(intervalId);
}
count++;
}
intervalId = setInterval(this, "thumbInterval", duration);
- 10
- update array from external variableHiya,
Im inside a movie clip called 'apple'. On the first frame of this mc i have
the following actions
text.push([this._name])
'text' is the name of a global array.
I also have an external 'text' file holding the the value of the variable
'apple'. When this MC is entered I am hoping for the array 'text' to read 'an
apple' which is the string alue of the variable 'apple' in my external text
file.
does this make sense guys, its pretty simple but I may have made it sound
difficult. the array should use the mc name to pull in a value for that
variable from an external text file.
Any help would be good, thanks again all.
- 11
- 12
- Keep the movie playing:disgust;
I have a movie acting as button with labels for Up, Out, Over and End. The
button launches another SWF file when it gets to the last frame of the End
labeled section. The function is called to play from the label OnRelease. The
problem occurs when the user moves the mouse off the button before the tween
has fully played. I would like to know how you make a mc keep playing
regardless of the mouse being over the button for the full tween or not.
- 13
- continuing in timeline after FLV playsI want to play an .flv in the timeline, then continue to play the timeline
after the video has finished. How is this done? I've tried to understand cue
points (I get the basic idea), but how do I utilize them in ActionScript?
- 14
- remove a class fileHello,
is it possible to remove a class file after its been imported?
Im working on a project that calls an 'options.as' file with the same name
from different folder locations - Each 'options.as' is slightly different.
but the class file wont update itself.
is there a way to import - then remove/replace the .as file with a new one?
thanks,
anton.
- 15
- InputText_ProblemsSelection.setFocus() will not work in the authoring mode... it works fine when you test your movie in browser.
|
|
|