Get Property Of A Jpg After LoadMovie
Hello fellow flashers! I'm loading a jpeg on an MC. The idea is that depending on whether the jpeg is longer or wider the playhead will move to a different point to start an animation. The problem is, the MC doesn't have a defined width or height, and it doesn't seem to acquire the lenght or width of the jpeg loaded in it. Any ideas on how to resolve this?
Thanks a bunch! Michael
Here's the AS I'm using: __________________________________________________ ______________ loadMovie("image" + imageNumber + ".jpg", "holder");
if (holder.getProperty(_root.holder, _x) > holder.getProperty(_root.holder, _y)){ gotoAndPlay ("startWide"); } else if (holder.getProperty(_root.holder, _x) < holder.getProperty(_root.holder, _y)){ gotoAndPlay ("startLong"); } __________________________________________________ __________
FlashKit > Flash Help > Flash MX
Posted on: 07-10-2003, 05:15 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
LoadMovie _width Property..
I`ve done a createEmptyMovieClip and used loadMovie to load a jpeg into it but it won`t give me the ._length or ._width value for the clip. _scale seems to work ok so why not length/width?
Code:
answerThis = this.main["a"+(i+1)];
trace("answerThis._width = "+answerThis._width);
This outputs: 0
This code is part of a for loop which (should!) go on to insert the width value of each clip into an array. Why`s this not working?
Get Property Visibility Set Property Visibilty
I am trying to work out some navigation on a site to make it more user friendly.
I have a number of buttons which when clicked set their correspoding graphic to visible and all the other relevant graphics to invisible.
This is so I can get the graphics to appear in the same place but only one visible at any time so no overlap.
What I already have is a rollover so that when the user rolls over the buttons the corresponding graphic will appear. Then dissappear on rollout. And the script to place my graphic in the right place and make it visible. Here is the script.
on (rollOver) {
setProperty("_root.drag0", _visible, "1");
setProperty("_root.drag1", _visible, "0");
setProperty("_root.drag2", _visible, "0");
}
on (rollOut) {
setProperty("_root.drag0", _visible, "0");
setProperty("_root.drag1", _visible, "0");
setProperty("_root.drag2", _visible, "0");
}
on (release) {
setProperty ("_root.drag0", _x , 323.4);
setProperty ("_root.drag0", _y , 360);
setProperty("_root.drag0", _visible, "1");
}
The bit I can't work out is how to get the graphic which has last been clicked and locked visible (rather than temporaly visible on rollover/out)to revert to being visible on the rollout of the other buttons.
I think I need to use the get property and set property but can't quite work out how to link the two so that it checks which graphic is visible before the rollover on a different button, makes it invisble on the rollover and reverts it back to being visible on the roll out.
Sorry That was long finding it hard to explain.
Thanks for any help you can offer. I am using flash mx 6.0.
Preloder ScaleX Property And X Property
Hi!
within the loader listener's progressevent I had my preloader mc update the scaleX property and works fine, thus, it moves and scales just like a preloader does until it reaches 100. My only concern is when scaleX updates the preloader mc 'x' location seems to be moving as well making the preloader clip looked liked it scales on both sides (both ends of the line). As i examined the preloader mc 'x' property it stays the same all throughout. This is weird.
anyone?
thank you in advance.
Object.property.property ?
I'm making a movie that will read data from an object and build some rows and columns of radio buttons, but I'm having some trouble dealing with the objects that I'm using to store data on the _root.
Here's what I'm trying to test:
I have the following code on the root of my movie:
PHP Code:
radio_button_object = new Object ();
radio_button_object.row_2 = 2;
radio_button_object.row_2.radio_button_1 = true;
radio_button_object.row_2.radio_button_3 = true;
Within a movie clip named "radio_button", I've got the following code:
PHP Code:
myObj = eval ("_root." + this._name + "_object");
// inside a for loop I'm going through rows
// inside that for loop, I have another for loop that goes through columns
for (i...) {
for (j...) {
if (myObj ["row_" + i]) {
if (myObj ["row_" + i + ".radio_button_" + j]) {
(eval ("row_" + i + ".radio_button_" + j)).gotoAndStop ("selected");
}
}
}
}
I've tried:
PHP Code:
myObj ["row_" + i ["radio_button_" + j]]
and:
PHP Code:
myObj ["row_" + i] ["radio_button_" + j]
But I've had no luck.
Essentially, I'm looking for object.property.property, except that the object name and all property names are variables.
Can anyone help me out?
Thanks!
cooper
www.pigdogtoad.com
My Property Is Your Property.thankyou.
im trying to create a drag and drop where you drag the image to the left of the screen and if dropped more than half way across the stage the image has a word,but once dropped can also be dragged back to how it was originally. I was thinking its something to do with getting thexproperty(as its all horizontal)
I'm new to flash so would really appreciate anyones help,
ta.
How To Loadmovie The Place Iwant? I Have Loadmovie But It Just Take All The Screen
i load a swf and it just take all the space
and my buttoms and others are all been covered
here is how i do it
onClipEvent (enterFrame) {
ifFrameLoaded (1) {
loadMovieNum ("first.swf", 0);
}
}
i put this in the layer called middle where i have put a instance of a w700 h270 movieclip so i can try to loadmovie the same size of it but it just failed
did i miss anything else? i know i did
please tell me~~~~~~~~~~~~~~~~~~~~~
Set Property, Get Property
I want a box to stay the same distance away from a sencond box as you drag and resize the second box. I was thinking that i could be done useing a getproperty set inside a set property but I am having trouble with just getting set property to work any help out there
GET / SET PROPERTY
I would like to know how to move an object in certain 'Ypos' intervals using button(s)... In other words I would like to press a button and make another object move 10pixels up or down each time...??!?
I know this is possible, can someone help PLEASE ????
Set Property..
could somebody plz help me. is there sthing i'm doing wrong here.. ? i have this one button that when pressed a movie clip would pop up or vice versa. doesn't seem to work
on (press) {
if (_visible = 1) {
setProperty ("/mc", _visible, "1");
} else {
setProperty ("/mc", _visible, "0");
}
}
Trying To Set Property Once Only.... But Keeps Going
im attempting to create a trail effect. i have an MC that moves randomly throughout the stage and i want to duplicate another MC thats identical to it continually and place each new instance where the first MC was at the time it was duplicated. my problem is all the duplicated MCs keep moving with the original MC, they dont stay put. heres what i have so far:
onClipEvent(enterFrame)
{
//lead is the white circle that the duplicated ones will
//'trail'.
//f is just a random name for the duplicated movie clip.
x = _root.lead._x
y = _root.lead._y
duplicateMovieClip(this, "_root.f" + i, i)
setProperty("_root.f" + i, _x, _root.lead._x)
setProperty("_root.f" + i, _y, _root.lead._y)
i = i + 1;
}
someone help! if its not clear enough, i will try to explain it in more detail
Set Property
Let me explain in detail:
This is the structure of my movie :
MainScene - MC - MC2 - MC3 - Button
In MC2 I've got a variable called Aix.
When I click on the button (in MC3), I want this to happen :
on(release){
setProperty("Aix",_height,25)
I want the height to reduce by that much.
Two questions : Is my code correct?
How do I correct it?
Set Property Help
i was trying to set the property of a mc at a random _x position butonly only between a two x position say 12 to 200 only. can anone help me out
Property
I need to create a movie (size unlimited) which will take several symbols at random and bring them onto the stage. I am stuck as to get the alpha random and the x y position random. There cannot be any user imput. The movie when activated will fill up and continue to do so with these randomly chosen symbols in random positions with random alpha.
HELP PLEASE
Get Property?
Hi,
I'm trying to write a simple interactive that, when all the objects are in a certain position (from the player dragging them into the correct position) the timeline then progresses to the next keyframe. I presume I have to use the getProperty but I'm not sure how to do it - especially when there are 8 objects I want to be in place before the timeline proceeds.
Any ideas?
Thanks
Set Property?
I have created an activity in which the user drags and drops bits of text into one of 3 areas, what I want is the functionality that makes it possible for the user to place any bit of text in any of the 3 areas and it will be self tidying. e.g which ever piece of text you place first in any area it snaps to the top left, the next piece of text would then follow beneath an so on. Any ideas?
Set.property
I made a button and a MC called pijl
This is the actionscript for my button
on (rollOver) {
setProperty(_pijl, _x, _x=_x+50);
}
I want that my "pijl" moves 50 pixels. But instead my "pijl" moves 50px whole my movie (with button) moves.
Can somebody help me ?
Get Property
Hi, Im struggling to understand this very simple concept!!
I create a Movieclip called "ball" and put an instance of it on the stage, and give it a name of "redball"
I then create a text box with a var of "ballname"...
I want the instance name to display in the text box when the mouse rolls over the "redball" seems simple? I tried it loads of ways!!
I tried:
On (rollover) ballname = GetProperty("redball",_name)
Can someone tell me where I am messing up?
Please dont tell me to go to the tutorials as I already have! this is where I got it from, I just dont understand.
Thanks
Get Property
i would like to set a variable to retrieve the frame number/label that a particular movie is located at, but have been unable to find any code to do it. Is this even possible? Thank you!
No Property?
Hello everyone,
I was given several files for language adptation. After a short communication with the developer he adviced to install the latest updates for Flash MX. However I'm still getting the following errors on export:
**Error** C:classessvrInterfaceThirdNavConnector.as: Line 152: There is no property with the name 'onPageRequested'.
_localConnection.onPageRequested = function(contentUrl:String, asAction:String) {
**Error** C:classessvrInterfaceThirdNavConnector.as: Line 155: There is no property with the name 'onConnectionSet'.
_localConnection.onConnectionSet = function(success:Boolean, newTNSatelliteName:String) {
**Error** C:classessvrInterfaceLocalConnector.as: Line 97: There is no property with the name 'setPageChangeRequest'.
receiving_lc.setPageChangeRequest = function(requestObj:Object) {
I'm not a wizard with flash and any suggestions what might be the problem are welcomed. Thank you.
Get Property By Name
Howdy.
I have defined a class in ActionScript that holds a bunch of properties. I want to enumerate the properties and do emit their values. My code to do this looks like:
Code:
for (var prop in this)
{
var value = getProperty(this, prop);
trace("var " + prop + "=" + value);
}
However, getProperty() fails with the following message:
Quote:
Property name expected in GetProperty.
How do I get and set the value of a property by _name_?
I can GET the value of the property like this if I have to:
Code:
var value = eval("this." + prop);
But setting it in a analogous way fails:
Code:
eval("this." + prop) = 999;
with this error:
Quote:
Left side of assignment operator must be variable or property.
Thanks!
JW
No Property Name
I found this beautiful color wheel app..
http://www.peterjoel.com/Samples/index.php?go=cmyk
When I publish it in AS 2.0 I get this error:
There is no property with the name 'RGB_to_HSB'.
Color.RGB_to_HSB = function(colRGB) {
}
Can this logic be easily updated to AS 2? If not, can someone point me in the right direction? I have searched the forums and read the AS Migration documents and couldn't find anything in my language.
No Property With The Name '_x'
Hello -
I'm using the below code, and when I test my movie, I get the following message in the output panel
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 10: There is no property with the name '_x'.
MessageX._x = 7;
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 11: There is no property with the name '_y'.
MessageX._y = (PrevMessage._y + PrevMessage._height);
Any suggestions?
Code:
function attachMessage(n:Number):Void{
var MessageX:String = ("Message" + n);
trace (MessageX);
this.attachMovie("mcMessageHolder", MessageX, this.getNextHighestDepth());
if (MessageX != "Message0"){
var PrevMessage:String = ("Message" + n--);
trace(PrevMessage);
MessageX._x = 7;
MessageX._y = (PrevMessage._y + PrevMessage._height);
}
else{
Message0._x = 7;
Message0._y = 79;
}
}
Xml Property?
Is it possible to have property with xml data in my class instance?
i tried
package {
public class MyClass extends Sprite {
public var x1:xml;
public function MyClass():void {
//loading xml
}
private function onXMLLoad(event:Event) {
x1 = new XML(event.currentTarget.data);
}
public function get xmlProperty():XML {
return x1;
}
}
}
...create instance of my class
var cl:MyClass = new MyClass();
trace(cl.x1+" "+ cl.xmlProperty);
//output: null null
is there a way to keep data from xml in my instance?
btw, code is valid- all imports and stuff are there, just didn't type all...
Name Property
i have a movieclip on the stage, i named it myclip on the proprty inspector.
i made a listener and a function so this clip will trace its name when clicked:
addEventListener(MouseEvent.CLICK,traceName);
function traceName(evt:MouseEvent)
{ trace(evt.target.name)}
however it returns "instance1" in the output panel
why doesn't it trace "myClip", if that's its name??
please help, i'm very confused
[i]._x Property ?
Hello,
Does anyone know why I can't access the _x property of buttonArray[i]._x. Here is my code:
-------------------------------------------------------------
layoutNav = function() {
buttonArray = new Array("aLogo_mc", "bLogo_mc", "cLogo_mc");
buttonsY = 10;
for (var i=0; i < buttonArray.length; i++) {
this.attachMovie(buttonArray[i], buttonArray[i], 10 + i);
buttonArray[i]._x = 10;
buttonArray[i]._y = buttonsY;
buttonArray[i].onRelease = function() {
kickFeed();
}
buttonsY += 28;
}
}
-------------------------------------------------------------
Thanks,
Stephen.
Set Property's
i wondering if anyone could help me with a question here:
i want to know the action script for changing the fps on an mc..
i ahve a couple of mc's and i want them to all have difeerent frames per second number ..i know it's set properties but i dont know the rest
cheers!
Set Property Problem
Hi
I wanted to use the set property option but i can't make it work
I want to create a menu with submenus which drop down as u click on the main menu and which pulls up if you click again on it.
But as it drops down i want it to push the other main menus down and so i wanted to use the y positioning. But
I've made one frame with the action stop
2 buttons in it one instance name boys the others girls
i gave the boys button the action on (release)
setProperty ("_root.teamspop.girls", _y, 400);
but nothing happens. Why???
Or if someone knows such a kind of menu i would be very happy if you could tell me how to do it
Thanks
Set Property (it Does Not Work)
I want to zoom in/zoom out on an movieclip.
I have tried to give the buttons an actionscrip
it has an error and i don't know what because it doens't work
Action:
setProperty ("porsche", _xscale, (int(getProperty ("porsche", _xscale))/1.15))
PLEASE HELP ME
Set Property Question
hi, i have this menu which i make visible by clicking a button. i use this code to make the menu visible:
on (press) {
setProperty ("_root.menu", _alpha, "100");
}
how can i use the same button so that i can make the menu invisible again?
[Edited by spidergrant on 07-16-2001 at 03:11 PM]
Get Property Question
Hi,
How do I get a property from a loded swf? (LoadMovie).
For example the total number of frames?
Please write me a the action.
I need help help help.
Thanks.
Robot009, [avidanp@hotmail.com]
Help With Some Set Property Actions
hi, i am making an option in my site to set the movie quality to either high, medium or low by pressing 3 different buttons on the main timeline. Can anyone help me with the set property _quality action? How do i go about doing this? Do i need to have the buttons in a movie clip and target the main timeline or what?? Please help!!
Thanks
[Edited by paul_moses on 08-09-2001 at 09:21 PM]
Set Property Alpha
Ive got an instance (called "scherm") of an MC.
I want this MC set to alpha 20, when you rollover an object on the screen.
Why isn't this working?
on (rollOver) {
setProperty (scherm, _alpha, 20);
}
Instead of setting the alpha of SCHERM to 20, it sets the alpha of the OBJECT to 20
why is this?
Text Property
Is there anyway I can change the text property? say from input text type to just static type using actionscript?
Set Property Of Mask?
hi all,
any idea how i can manipulate the properties of an mc which is plased on a layer with maski checked?
tried it with set property but doesn't work...
thanks daarbooven
Set Property Problem
I have a behavioral clip inside another which haves scipt for folloing mouse with inertia and so that if the parent MC falls above a certain _y it will move to a set point off the screen where another MC's property is set to start at whatever coordinates the parent was at. the problem is that if while testing the movie I mouve the mouse too fast down past the _y it actually starts too far down past the set _y point.
Here is the script involving the switch
[code]
if (_parent._y>=449) {
setProperty (_root.landleft, _x, _parent._x-2.8);
setProperty (_root.landleft, _y, _parent._y+10.1);
_root.landleft.play();
gotoAndStop (4);
}
Set Property Of A Tweened MC
Im trying to move a tweened MC on the stage to an x and y posiion. It needs to animate to that postion no matter where that MC is on the stage. Any ideas?
thanks
j
Coordinates Property
Is there a property for a set of coordinates I've missed somwhere? Or do I constantly have to set coords individually by using 2 statements for the 2 properties _x and _y?
Set Property IMPORTANT
Can anyone help me with using Set Property. I want to make a page that has 10 images on it and once you go over an image it scales up and alpha goes to 100 instead of 30. Once you roll out of the image, it scales down and the alpha goes back to 30. How can I do this efficiently for every image?
Please help
Goran
Playback Property
Is there a way of telling if a movie is currently in playback or stopped without creating a variable to tell you so?
Set Property Question
hi everyone i have question....
When you call a MovieClip and you wanna set de property of this movie clip how you can for example set the property to make a fade effect whit the _Alpha
EX: My movie clip is as window first of all i set the alpha of my window at zero so when you click on a button the Window come to appears whit a fade effect!
someone help me whit this?
Visability Property
I am attempting to set the visability of a mc on scene1 from an mc. this is what my code looks like.
button inside mc:
on (release) {
setProperty("window1", _visible, "1");
}
Scene1, frame1:
stop();
setProperty("scroller", _visible, "0");
HELP?
Invinsible Property Available?
Okay guys,
I ve done this when I design in Visual Basic, but have no clue if this is possible in Flash. I am sure there may be another way so your ideas are appreciated.
SCENARIO:
I have dragable objects in a single frame. I do not want any of them to be visible when that frame is loaded. Instead, i want each of them to appear individually as the user clicks on some button.
I am sure this is possible, but I cannot figure out how to do it in flash. Please help.
AutoSize Property
hi!
could anybody tell me please if autoSize (property from TextField objets) works?
i'm tryin' with textfieldname.autoSize = "left"; (or "center", "right", true...) & nothin'
thanx
Set Property Action?
How does one use the set property action with Flash MX
to position a flashtyper file within a movie and why doesn't dragging around a flashtyper file
on the stage effect it's position in the movie when
both movies share the same dimensions?
Set Property Action
How does one use the set property action with Flash MX
to position a .swf file within a movie (level1) and
why doesn't dragging around a .swf file on the stage effect it's position in the movie when both movies
share the same dimensions?
thks
SET PROPERTY QUESTION :
Hi, ya'll.
When you use the set property action, for instance for setting the alpha of a movie clip to -let's say 25% from 100%. It works great -but it makes a jump from 100% to 25% without a tween. Is there a way to achieve this with a smooth tween from one value to the other ???
Thanks I appreciate the help.
_root[something].property
Hiya all,
Could someone let me know if it's possible to use the square bracket syntax to emulate the old Flash 4 style of targeting movie clips dynamically.
I'm fine with the syntax if it's only one level deep - as in:
_root["myMC"+dynamicBit]._x
to control a movie clip one level down from root or parent or whatever - the problem is if I want to specify a path to a clip with a dynamic name inside a clip with a dynamic name as in:
clip1.clip2._x
I know it can be done by using
var1="clip1"
var2="clip2"
_root[var1][var2]._x
but that requires you to construct the name using individual path elements - tricky if this is to change.
What I'd really like to be able to do would be:
myString="clip1.clip2.clip3.clip4"
_root[myString]._x
in the old days you could have said
myString="clip1/clip2/clip3/clip4"
getProperty(myString,_x);
I hope someone understands what I'm trying to get at!
Thanks in advance,
sCam
|